KLUFactor

class sksparse.klu.KLUFactor[source]

Class to compute and store the KLU factorization of a sparse matrix.

The constructor computes the symbolic analysis of a sparse matrix \(A\) and determines a fill-reducing ordering such that:

\[L U + F = R P A Q.\]

The numeric factorization is not computed until factorize() is called.

Note

Note that the use of the scale factor R differs between KLU and UMFPACK:

\[\begin{split}L U &= P R_{\mathrm{umf}} A Q \quad &&\text{(UMFPACK)}, \\ L U + F &= R_{\mathrm{klu}} P A Q \quad &&\text{(KLU)}.\end{split}\]

They are related by \(R_{\mathrm{klu}} = P R_{\mathrm{umf}} P^{\top}\).

is_numeric[source]

Whether the numeric factorization has been computed.

Type:

bool

lnz[source]

The number of nonzeros in the \(L\) factor.

Type:

int

unz[source]

The number of nonzeros in the \(U\) factor.

Type:

int

nzoff[source]

The number of nonzeros in the \(F\) factor.

Type:

int

nblocks[source]

The number of blocks in the BTF ordering of the matrix.

Type:

int

nnz[source]

The number of nonzeros in the original matrix.

Type:

int

shape[source]

The shape of the original matrix.

Type:

tuple of int

dtype[source]

The data type of the matrix entries (float64 or complex128).

Type:

numpy.dtype

itype[source]

The integer type used for indexing (int32 or int64).

Type:

numpy.dtype

L[source]

The \(L\) factor as a sparse CSC matrix.

Type:

scipy.sparse.csc_array

U[source]

The \(U\) factor as a sparse CSC matrix.

Type:

scipy.sparse.csc_array

F[source]

The \(F\) factor as a sparse CSC matrix.

Type:

scipy.sparse.csc_array

perm_r, perm_c

The row and column permutation arrays.

Type:

numpy.ndarray

rscale[source]

The row scaling array.

Type:

numpy.ndarray

rblocks[source]

The row blocks in the BTF ordering.

Type:

numpy.ndarray of int

info[source]

An object containing information about the factorization.

Type:

KLUInfo

Notes

This object is an interface to the SuiteSparse KLU library [1].

Added in version 0.5.0.

References

Methods

__init__

Compute the KLU factorization of a sparse matrix.

copy

Return a deep copy of the current KLUFactor object.

factorize

Compute the numeric factorization of the matrix.

solve

Solve a linear system using the KLU factorization.