Get Cholesky Factors of sparse input matrix in Julia v0.7/1.0

Hi everyone,

is there any way to extract the lower triangular matrix L from the cholesky factorization F of a sparse matrix
A = L*L' obtained by

F = cholesky(A)

MWE:

using LinearAlgebra

# create a sparse random positive definite matrix
A = sprandn(10,10,0.1)
A = A*A'
A = A + 10*Diagonal(ones(10))

F = cholesky(A)

# F.L only returns the SuiteSparse.CHOLMOD Factor
using LinearAlgebra
m = Matrix(Diagonal(ones(2)))
cholesky(m).L

That only works for dense input matrices though

Please provide a minimal working example.

1 Like

In Julia 1.1, after using SparseArrays, calling sparse(F.L) returned a 10×10 SparseMatrixCSC{Float64,Int64} with 19 stored entries

2 Likes