lu
- :
Y =lu(A)¶ - :
[L, U] =lu(A)¶ - :
[L, U, P] =lu(A)¶ - :
[L, U, P] =lu(A, "vector")¶ - :
[L, U, P, Q] =lu(S)¶ - :
[L, U, P, Q, R] =lu(S)¶ - :
[…] =lu(S, thresh)¶ - :
[…] =lu(S, thresh, "vector")¶ -
Compute the LU factorization of a matrix with partial (row) pivoting.
For a full or sparse matrix A,
[L, U, P] = lu (A)returns a unit lower triangular L, an upper triangular U and a permutation matrix P such thatP*A = L*U. With only two outputs, L absorbs the permutation so thatL*U = A. With a single output, Y packs both factors asL + U - eye (…).The option
"vector"returns the permutations as row index vectors instead of matrices; for p the relation isA(p,:) = L*U.Sparse matrices additionally support a fill-reducing column permutation Q (fourth output) with
P*S*Q = L*U, and a row scaling R (fifth output) withP*(R\S)*Q = L*U. The optional thresh is a pivot threshold in the range 0 to 1, or a two-element vector of pivot and diagonal thresholds.