15.11.2014 Views

MATLAB Mathematics - SERC - Index of

MATLAB Mathematics - SERC - Index of

MATLAB Mathematics - SERC - Index of

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Sparse Matrix Operations<br />

The function p = colperm(S) computes this column-count permutation. The<br />

colperm M-file has only a single line.<br />

[ignore,p] = sort(sum(spones(S)));<br />

This line performs these steps:<br />

1 The inner call to spones creates a sparse matrix with ones at the location <strong>of</strong><br />

every nonzero element in S.<br />

2 The sum function sums down the columns <strong>of</strong> the matrix, producing a vector<br />

that contains the count <strong>of</strong> nonzeros in each column.<br />

3 full converts this vector to full storage format.<br />

4 sort sorts the values in ascending order. The second output argument from<br />

sort is the permutation that sorts this vector.<br />

Reordering to Reduce Bandwidth<br />

The reverse Cuthill-McKee ordering is intended to reduce the pr<strong>of</strong>ile or<br />

bandwidth <strong>of</strong> the matrix. It is not guaranteed to find the smallest possible<br />

bandwidth, but it usually does. The function symrcm(A) actually operates on<br />

the nonzero structure <strong>of</strong> the symmetric matrix A + A', but the result is also<br />

useful for asymmetric matrices. This ordering is useful for matrices that come<br />

from one-dimensional problems or problems that are in some sense “long and<br />

thin.”<br />

Approximate Minimum Degree Ordering<br />

The degree <strong>of</strong> a node in a graph is the number <strong>of</strong> connections to that node. This<br />

is the same as the number <strong>of</strong> <strong>of</strong>f-diagonal nonzero elements in the<br />

corresponding row <strong>of</strong> the adjacency matrix. The approximate minimum degree<br />

algorithm generates an ordering based on how these degrees are altered during<br />

Gaussian elimination or Cholesky factorization. It is a complicated and<br />

powerful algorithm that usually leads to sparser factors than most other<br />

orderings, including column count and reverse Cuthill-McKee. Because the<br />

keeping track <strong>of</strong> the degree <strong>of</strong> each node is very time-consuming, the<br />

approximate minimum degree algorithm uses an approximation to the degree,<br />

rather than the exact degree.<br />

6-29

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!