using SparseArrays
using LinearAlgebra
a = sparse([1, 2, 3, 4], [1, 2, 3, 4], [1.0, 2.0, 3.0, 4.0], 4, 4)
af = cholesky(a)
b = rand(4)
y = zeros(4)
ldiv!(y, af, b)
Seems like it’s just that no one has gotten around to it. The initial implementation of \ used CHOLMOD’s out-of-place API, but it looks like there is an in-place API we could use to implement ldiv!:
There’s some question of how much of the underlying API should be exposed. e.g. CHOLMOD also lets you re-use a temporary workspace vector, should we expose that?
(I think it hasn’t been a high priority since for people doing large sparse solves the allocation of the solution vector is probably not a big part of the computational cost.)
If the solution allocations are 1% of the cost for a single solve (even without including the factorization cost), then they should still be 1% of the cost if you do hundreds of solves, no?