KLU.jl
Documentation for KLU.jl
KLU.klu — Functionklu(A::SparseMatrixCSC) -> K::KLUFactorization
klu(n, colptr::Vector{Ti}, rowval::Vector{Ti}, nzval::Vector{Tv}) -> K::KLUFactorizationCompute the LU factorization of a sparse matrix A using KLU.
For sparse A with real or complex element type, the return type of K is KLUFactorization{Tv, Ti}, with Tv = Float64 or ComplexF64 respectively and Ti is an integer type (Int32 or Int64).
The individual components of the factorization K can be accessed by indexing:
| Component | Description |
|---|---|
L | L (lower triangular) part of LU of the diagonal blocks |
U | U (upper triangular) part of LU of the diagonal blocks |
F | F (upper triangular) part of LU + F, the off-diagonal blocks |
p | right permutation Vector |
q | left permutation Vector |
Rs | Vector of scaling factors |
The relation between K and A is
K.L * K.U + K.F == K.Rs` A[K.p, K.q]`
K further supports the following functions:
LinearAlgebra.\
klu(A::SparseMatrixCSC) uses the KLU library that is part of SuiteSparse. As this library only supports sparse matrices with Float64 or ComplexF64 elements, lu converts A into a copy that is of type SparseMatrixCSC{Float64} or SparseMatrixCSC{ComplexF64} as appropriate.