@@ -88,27 +88,44 @@ function LinearSolve.init_cacheval(
8888end
8989
9090function LinearSolve. init_cacheval (
91- alg:: Union{LUFactorization, GenericLUFactorization} , A:: AbstractSparseArray{Float64, Int32 } , b, u,
91+ alg:: Union{LUFactorization, GenericLUFactorization} , A:: AbstractSparseArray{T, Int64 } , b, u,
9292 Pl, Pr,
9393 maxiters:: Int , abstol, reltol,
94- verbose:: Bool , assumptions:: OperatorAssumptions )
95- SparseArrays. UMFPACK. UmfpackLU (SparseMatrixCSC {Float64, Int32} (0 , 0 , [Int32 (1 )], Int32[], Float64[]))
94+ verbose:: Bool , assumptions:: OperatorAssumptions ) where {T<: BLASELTYPES }
95+ SparseArrays. UMFPACK. UmfpackLU (SparseMatrixCSC {T, Int64} (zero (Int64), zero (Int64), [Int64 (1 )], Int64[], T[]))
96+ end
97+
98+ function LinearSolve. init_cacheval (
99+ alg:: Union{LUFactorization, GenericLUFactorization} , A:: AbstractSparseArray{T, Int32} , b, u,
100+ Pl, Pr,
101+ maxiters:: Int , abstol, reltol,
102+ verbose:: Bool , assumptions:: OperatorAssumptions ) where {T<: BLASELTYPES }
103+ SparseArrays. UMFPACK. UmfpackLU (SparseMatrixCSC {T, Int32} (zero (Int32), zero (Int32), [Int32 (1 )], Int32[], T[]))
96104end
97105
98106function LinearSolve. init_cacheval (
99107 alg:: UMFPACKFactorization , A:: AbstractSparseArray{Float64, Int} , b, u, Pl, Pr,
100108 maxiters:: Int , abstol,
101109 reltol,
102110 verbose:: Bool , assumptions:: OperatorAssumptions )
111+
103112 PREALLOCATED_UMFPACK
104113end
105114
106115function LinearSolve. init_cacheval (
107- alg:: UMFPACKFactorization , A:: AbstractSparseArray{Float64, Int32 } , b, u,
116+ alg:: UMFPACKFactorization , A:: AbstractSparseArray{T, Int64 } , b, u,
108117 Pl, Pr,
109118 maxiters:: Int , abstol, reltol,
110- verbose:: Bool , assumptions:: OperatorAssumptions )
111- SparseArrays. UMFPACK. UmfpackLU (SparseMatrixCSC {Float64, Int32} (0 , 0 , [Int32 (1 )], Int32[], Float64[]))
119+ verbose:: Bool , assumptions:: OperatorAssumptions ) where {T<: BLASELTYPES }
120+ SparseArrays. UMFPACK. UmfpackLU (SparseMatrixCSC {T, Int64} (zero (Int64), zero (Int64), [Int64 (1 )], Int64[], T[]))
121+ end
122+
123+ function LinearSolve. init_cacheval (
124+ alg:: UMFPACKFactorization , A:: AbstractSparseArray{T, Int32} , b, u,
125+ Pl, Pr,
126+ maxiters:: Int , abstol, reltol,
127+ verbose:: Bool , assumptions:: OperatorAssumptions ) where {T<: BLASELTYPES }
128+ SparseArrays. UMFPACK. UmfpackLU (SparseMatrixCSC {T, Int32} (zero (Int32), zero (Int32), [Int32 (1 )], Int32[], T[]))
112129end
113130
114131function SciMLBase. solve! (
@@ -208,17 +225,35 @@ function SciMLBase.solve!(cache::LinearSolve.LinearCache, alg::KLUFactorization;
208225 end
209226end
210227
211- const PREALLOCATED_CHOLMOD = cholesky (SparseMatrixCSC ( 0 , 0 , [ 1 ], Int[], Float64[] ))
228+ const PREALLOCATED_CHOLMOD = cholesky (sparse ( reshape ([ 1.0 ], 1 , 1 ) ))
212229
213230function LinearSolve. init_cacheval (alg:: CHOLMODFactorization ,
214231 A:: Union{SparseMatrixCSC{T, Int}, Symmetric{T, SparseMatrixCSC{T, Int}}} , b, u,
215232 Pl, Pr,
216233 maxiters:: Int , abstol, reltol,
217234 verbose:: Bool , assumptions:: OperatorAssumptions ) where {T < :
218- BLASELTYPES }
235+ Float64 }
219236 PREALLOCATED_CHOLMOD
220237end
221238
239+ function LinearSolve. init_cacheval (alg:: CHOLMODFactorization ,
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 (reshape ([one (T)],1 ,1 )))
246+ end
247+
248+ function LinearSolve. init_cacheval (alg:: CHOLMODFactorization ,
249+ A:: AbstractArray , b, u,
250+ Pl, Pr,
251+ maxiters:: Int , abstol, reltol,
252+ verbose:: Bool , assumptions:: OperatorAssumptions ) where {T < :
253+ BLASELTYPES}
254+ nothing
255+ end
256+
222257function LinearSolve. init_cacheval (alg:: NormalCholeskyFactorization ,
223258 A:: Union {AbstractSparseArray{T}, LinearSolve. GPUArraysCore. AnyGPUArray,
224259 Symmetric{T, <: AbstractSparseArray{T} }}, b, u, Pl, Pr,
0 commit comments