umf_luget — retrieve lu factors at the scilab level
[L,U,p,q,Rd] = umf_luget(LU_ptr)
a pointer to umf lu factors (L,U,p,q,R)
scilab sparse matrix
column vectors storing the permutations
vector storing the (row) scaling factors
This function may be used if you want to plot the sparse pattern of the lu factors (or if you code something which use the lu factors). The factorization provided by umfpack is of the form:
P R^(-1) A Q = LU
where P and Q are permutation matrices, R is a diagonal matrix (row scaling), L a lower triangular matrix with a diagonal of 1, and U an upper triangular matrix. The function provides the matrices L and U as Sparse scilab matrices but P and Q are given as permutation vectors p and q (in fact p is the permutation associated to P') and Rd is the vector corresponding to the diagonal of R.
// this is the test matrix from UMFPACK A = sparse( [ 2 3 0 0 0; 3 0 4 0 6; 0 -1 -3 2 0; 0 0 1 0 0; 0 4 2 0 1] ); Lup = umf_lufact(A); [L,U,p,q,R] = umf_luget(Lup); B = A; for i=1:5, B(i,:) = B(i,:)/R(i); end // apply the row scaling B(p,q) - L*U // must be a (quasi) nul matrix umf_ludel(Lup) // clear memory // the same with a complex matrix A = sparse( [ 2+%i 3+2*%i 0 0 0; 3-%i 0 4+%i 0 6-3*%i; 0 -1+%i -3+6*%i 2-%i 0; 0 0 1-5*%i 0 0; 0 4 2-%i 0 1] ); Lup = umf_lufact(A); [L,U,p,q,R] = umf_luget(Lup); B = A; for i=1:5, B(i,:) = B(i,:)/R(i); end // apply the row scaling B(p,q) - L*U // must be a (quasi) nul matrix umf_ludel(Lup) // clear memory