@@ -72,26 +72,19 @@ const PREALLOCATED_UMFPACK = SparseArrays.UMFPACK.UmfpackLU(SparseMatrixCSC(0, 0
7272 Int[], Float64[]))
7373
7474function LinearSolve. init_cacheval (
75- alg:: UMFPACKFactorization , A:: SparseMatrixCSC{Float64, Int} , b, u,
75+ alg:: UMFPACKFactorization , A:: AbstractArray , b, u,
7676 Pl, Pr,
7777 maxiters:: Int , abstol, reltol,
7878 verbose:: Bool , assumptions:: OperatorAssumptions )
79- PREALLOCATED_UMFPACK
79+ nothing
8080end
8181
8282function LinearSolve. init_cacheval (
83- alg:: UMFPACKFactorization , A:: AbstractSparseArray{Float64} , b, u, Pl, Pr,
83+ alg:: UMFPACKFactorization , A:: AbstractSparseArray{Float64, Int } , b, u, Pl, Pr,
8484 maxiters:: Int , abstol,
8585 reltol,
8686 verbose:: Bool , assumptions:: OperatorAssumptions )
87- if size (A,1 ) == size (A,2 )
88- A = convert (AbstractMatrix, A)
89- zerobased = SparseArrays. getcolptr (A)[1 ] == 0
90- return SparseArrays. UMFPACK. UmfpackLU (SparseMatrixCSC (size (A)... , getcolptr (A),
91- rowvals (A), nonzeros (A)))
92- else
93- PREALLOCATED_UMFPACK
94- end
87+ PREALLOCATED_UMFPACK
9588end
9689
9790function SciMLBase. solve! (
@@ -134,25 +127,19 @@ const PREALLOCATED_KLU = KLU.KLUFactorization(SparseMatrixCSC(0, 0, [1], Int[],
134127 Float64[]))
135128
136129function LinearSolve. init_cacheval (
137- alg:: KLUFactorization , A:: SparseMatrixCSC{Float64, Int} , b, u, Pl,
130+ alg:: KLUFactorization , A:: AbstractArray , b, u, Pl,
138131 Pr,
139132 maxiters:: Int , abstol, reltol,
140133 verbose:: Bool , assumptions:: OperatorAssumptions )
141- PREALLOCATED_KLU
134+ nothing
142135end
143136
144137function LinearSolve. init_cacheval (
145- alg:: KLUFactorization , A:: AbstractSparseArray{Float64} , b, u, Pl, Pr,
138+ alg:: KLUFactorization , A:: AbstractSparseArray{Float64, Int } , b, u, Pl, Pr,
146139 maxiters:: Int , abstol,
147140 reltol,
148141 verbose:: Bool , assumptions:: OperatorAssumptions )
149- if size (A,1 ) == size (A,2 )
150- A = convert (AbstractMatrix, A)
151- return KLU. KLUFactorization (SparseMatrixCSC (size (A)... , getcolptr (A), rowvals (A),
152- nonzeros (A)))
153- else
154- PREALLOCATED_KLU
155- end
142+ PREALLOCATED_KLU
156143end
157144
158145# TODO : guard this against errors
247234function LinearSolve. defaultalg (
248235 A:: AbstractSparseMatrixCSC{<:Union{Float64, ComplexF64}, Ti} , b,
249236 assump:: OperatorAssumptions{Bool} ) where {Ti}
250- @show " here"
251237 if assump. issq
252238 if length (b) <= 10_000 && length (nonzeros (A)) / length (A) < 2e-4
253239 LinearSolve. DefaultLinearSolver (LinearSolve. DefaultAlgorithmChoice. KLUFactorization)
0 commit comments