JuliaSparse / SparseArrays.jl

SparseArrays.jl is a Julia stdlib
https://sparsearrays.juliasparse.org/
Other
92 stars 52 forks source link

missing `ldiv!` overload for sparse Cholesky #319

Closed stevengj closed 3 months ago

stevengj commented 1 year ago

It seems like this should be supported:

julia> using SparseArrays, LinearAlgebra

julia> A = sprand(10,10,0.1); A = A'A + I;

julia> F = cholesky(A)
SuiteSparse.CHOLMOD.Factor{Float64}
type:    LLt
method:  simplicial
maxnnz:  11
nnz:     11
success: true

julia> b = rand(10); x = similar(b);

julia> ldiv!(x, F, b)
ERROR: MethodError: no method matching ldiv!(::SuiteSparse.CHOLMOD.Factor{Float64}, ::Vector{Float64})

Similar to #242, except in this case CHOLMOD does seem to provide an in-place API (whereas currently we are calling the out-of-place cholmod_l_spsolve):

image

cc @ChrisRackauckas, since this just came up in https://github.com/SciML/LinearSolve.jl/pull/246

stevengj commented 6 months ago

See also this discourse thread.