Skip to content

Commit 829785f

Browse files
fix CHOLMOD dispatches
1 parent 0ce03c2 commit 829785f

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

ext/LinearSolveSparseArraysExt.jl

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,19 +225,28 @@ function SciMLBase.solve!(cache::LinearSolve.LinearCache, alg::KLUFactorization;
225225
end
226226
end
227227

228-
const PREALLOCATED_CHOLMOD = cholesky(SparseMatrixCSC(0, 0, [1], Int[], Float64[]))
228+
const PREALLOCATED_CHOLMOD = cholesky(sparse([1.0]))
229229

230230
function LinearSolve.init_cacheval(alg::CHOLMODFactorization,
231-
A::Symmetric{T, SparseMatrixCSC{T, Int}}, b, u,
231+
A::Union{SparseMatrixCSC{T, Int}, Symmetric{T, SparseMatrixCSC{T, Int}}}, b, u,
232232
Pl, Pr,
233233
maxiters::Int, abstol, reltol,
234234
verbose::Bool, assumptions::OperatorAssumptions) where {T <:
235-
BLASELTYPES}
235+
Float64}
236236
PREALLOCATED_CHOLMOD
237237
end
238238

239239
function LinearSolve.init_cacheval(alg::CHOLMODFactorization,
240-
A::SparseMatrixCSC{T, Int}, b, u,
240+
A::Union{SparseMatrixCSC{T, Int}, Symmetric{T, SparseMatrixCSC{T, Int}}}, b, u,
241+
Pl, Pr,
242+
maxiters::Int, abstol, reltol,
243+
verbose::Bool, assumptions::OperatorAssumptions) where {T <:
244+
BLASELTYPES}
245+
cholesky(sparse([one(T)]))
246+
end
247+
248+
function LinearSolve.init_cacheval(alg::CHOLMODFactorization,
249+
A::AbstractArray, b, u,
241250
Pl, Pr,
242251
maxiters::Int, abstol, reltol,
243252
verbose::Bool, assumptions::OperatorAssumptions) where {T <:

0 commit comments

Comments
 (0)