Hello,
I wrote an addition to the UMFPack module of PySparse that lets users
retrieve the details of the factorization. Here is an example:
from pysparse import spmatrix, umfpack
A = spmatrix.ll_mat_from_mtx('bcsstk11.mtx')
LU = umfpack.factorize(A)
(L, U, P, Q, R, do_recip) = LU.lu()
The help of lu() is as follows:
-------
lu(...)
self.lu()
Returns L and U factors, permutation and scaling information.
Use: (L, U, P, Q, R, do_recip) = self.lu().
The original matrix A is factorized into
L U = P R A Q
where L is unit lower triangular,
U is upper triangular,
P and Q are permutation matrices,
R is a row-scaling diagonal matrix such that
the i-th row of A has been divided by R[i] if do_recip = True,
the i-th row of A has been multiplied by R[i] if do_recip = False.
L and U are returned as ll_mat sparse matrices.
P, Q and R are returned as NumPy arrays.
-------
I would very much like to see this function included in PySparse. I
will e-mail the code directly to Daniel Wheeler.
Comments welcome.
Cheers,
Dominique
|