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 />

selects P via numerical partial pivoting, but does not pivot to improve sparsity<br />

in the LU factors. On the other hand, the four-output syntax<br />

[L,U,P,Q]=lu(S)<br />

selects P via threshold partial pivoting, and selects P and Q to improve sparsity<br />

in the LU factors.<br />

You can control pivoting in sparse matrices using<br />

lu(S,thresh)<br />

where thresh is a pivot threshold in [0,1]. Pivoting occurs when the diagonal<br />

entry in a column has magnitude less than thresh times the magnitude <strong>of</strong> any<br />

sub-diagonal entry in that column. thresh = 0 forces diagonal pivoting.<br />

thresh = 1 is the default. (The default for thresh is 0.1 for the four-output<br />

syntax).<br />

When you call lu with three or less outputs, <strong>MATLAB</strong> automatically allocates<br />

the memory necessary to hold the sparse L and U factors during the<br />

factorization. Except for the four-output syntax, <strong>MATLAB</strong> does not use any<br />

symbolic LU prefactorization to determine the memory requirements and set<br />

up the data structures in advance.<br />

Reordering and Factorization. If you obtain a good column permutation p that<br />

reduces fill-in, perhaps from symrcm or colamd, then computing lu(S(:,p))<br />

takes less time and storage than computing lu(S). Two permutations are the<br />

symmetric reverse Cuthill-McKee ordering and the symmetric approximate<br />

minimum degree ordering.<br />

r = symrcm(B);<br />

m = symamd(B);<br />

The three spy plots produced by the lines below show the three adjacency<br />

matrices <strong>of</strong> the Bucky Ball graph with these three different numberings. The<br />

local, pentagon-based structure <strong>of</strong> the original numbering is not evident in the<br />

other three.<br />

spy(B)<br />

spy(B(r,r))<br />

spy(B(m,m))<br />

6-31

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

Saved successfully!

Ooh no, something went wrong!