SelectedInversion
Quickly compute selected entries of the inverse of a sparse matrix.
Introduction
Sparse matrices are one of the pillars of scientific computing. Sparse factorization methods allow us to solve linear systems involving the inverse efficiently. But in some applications, we might need a bunch of entries of the inverse. Selected inversion algorithms efficiently compute those entries of the inverse that correspond to non-zero entries in the factorization.
SelectedInversion.jl directly interfaces with CHOLMOD-based Cholesky factorizations, which are the default for sparse symmetric positive-definite matrices in Julia.
Installation
SelectedInversion.jl is not yet a registered Julia package. Until it is, you can install it from this GitHub repository. To do so:
Launch the Julia REPL and type
] add https://github.com/timweiland/SelectedInversion.jl
.
SelInv API
Make sure to also check the Tutorial.
SelectedInversion.selinv
— Functionselinv(A::SparseMatrixCSC; depermute=false)
-> @NamedTuple{Z::AbstractMatrix, p::Vector{Int64}}
Compute the selected inverse Z
of A
. The sparsity pattern of Z
corresponds to that of the Cholesky factor of A
, and the nonzero entries of Z
match the corresponding entries in A⁻¹
.
Arguments
A::SparseMatrixCSC
: The sparse symmetric positive definite matrix for which the selected inverse will be computed.
Keyword arguments
depermute::Bool
: Whether to depermute the selected inverse or not.
Returns
A named tuple Zp
. Zp.Z
is the selected inverse, and Zp.p
is the permutation vector of the corresponding sparse Cholesky factorization.
selinv(F::SparseArrays.CHOLMOD.Factor; depermute=false)
-> @NamedTuple{Z::AbstractMatrix, p::Vector{Int64}}
Compute the selected inverse Z
of some matrix A
based on its sparse Cholesky factorization F
.
Arguments
F::SparseArrays.CHOLMOD.Factor
: Sparse Cholesky factorization of some matrixA
.F
will be used internally for the computations underlying the selected inversion ofA
.
Keyword arguments
depermute::Bool
: Whether to depermute the selected inverse or not.
Returns
A named tuple Zp
. Zp.Z
is the selected inverse, and Zp.p
is the permutation vector of the corresponding sparse Cholesky factorization.