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.

6 Sparse Matrices<br />

The following <strong>MATLAB</strong> functions implement the approximate minimum<br />

degree algorithm:<br />

• symamd — Use with symmetric matrices<br />

• colamd — Use with nonsymmetric matrices and symmetric matrices <strong>of</strong> the<br />

form A*A' or A'*A.<br />

See “Reordering and Factorization” on page 6-31 for an example using symamd.<br />

You can change various parameters associated with details <strong>of</strong> the algorithms<br />

using the spparms function.<br />

For details on the algorithms used by colamd and symamd, see [5]. The<br />

approximate degree the algorithms use is based on [1].<br />

Factorization<br />

This section discusses four important factorization techniques for sparse<br />

matrices:<br />

• LU, or triangular, factorization<br />

• Cholesky factorization<br />

• QR, or orthogonal, factorization<br />

• Incomplete factorizations<br />

LU Factorization<br />

If S is a sparse matrix, the following command returns three sparse matrices L,<br />

U, and P such that P*S = L*U.<br />

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

lu obtains the factors by Gaussian elimination with partial pivoting. The<br />

permutation matrix P has only n nonzero elements. As with dense matrices, the<br />

statement [L,U] = lu(S) returns a permuted unit lower triangular matrix and<br />

an upper triangular matrix whose product is S. By itself, lu(S) returns L and<br />

U in a single matrix without the pivot information.<br />

The three-output syntax<br />

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

6-30

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

Saved successfully!

Ooh no, something went wrong!