@@ -4,11 +4,14 @@ using LinearSolve: LinearSolve, BLASELTYPES, pattern_changed, ArrayInterface,
4
4
@get_cacheval , CHOLMODFactorization, GenericFactorization, GenericLUFactorization,
5
5
KLUFactorization, LUFactorization, NormalCholeskyFactorization, OperatorAssumptions,
6
6
QRFactorization, RFLUFactorization, UMFPACKFactorization, solve
7
- using LinearAlgebra: LinearAlgebra, I, Hermitian, Symmetric, cholesky, ldiv!, lu, lu!
7
+ using ArrayInterface: ArrayInterface
8
+ using LinearAlgebra: LinearAlgebra, I, Hermitian, Symmetric, cholesky, ldiv!, lu, lu!, QR
8
9
using SparseArrays: SparseArrays, AbstractSparseArray, AbstractSparseMatrixCSC, SparseMatrixCSC,
9
10
nonzeros, rowvals, getcolptr, sparse, sprand
11
+ using SparseArrays. UMFPACK: UMFPACK_OK
10
12
using Base: / , \ , convert
11
13
using SciMLBase: SciMLBase, LinearProblem, ReturnCode
14
+ import StaticArraysCore: SVector
12
15
13
16
# Can't `using KLU` because cannot have a dependency in there without
14
17
# requiring the user does `using KLU`
@@ -192,7 +195,7 @@ function SciMLBase.solve!(
192
195
end
193
196
194
197
F = LinearSolve. @get_cacheval (cache, :UMFPACKFactorization )
195
- if F. status == SparseArrays . UMFPACK . UMFPACK_OK
198
+ if F. status == UMFPACK_OK
196
199
y = ldiv! (cache. u, F, cache. b)
197
200
SciMLBase. build_linear_solution (alg, y, nothing , cache; retcode = ReturnCode. Success)
198
201
else
@@ -303,36 +306,36 @@ function LinearSolve.init_cacheval(alg::NormalCholeskyFactorization,
303
306
Symmetric{T, <: AbstractSparseArray{T} }}, b, u, Pl, Pr,
304
307
maxiters:: Int , abstol, reltol, verbose:: Bool ,
305
308
assumptions:: OperatorAssumptions ) where {T <: BLASELTYPES }
306
- LinearSolve . ArrayInterface. cholesky_instance (convert (AbstractMatrix, A))
309
+ ArrayInterface. cholesky_instance (convert (AbstractMatrix, A))
307
310
end
308
311
309
312
# Specialize QR for the non-square case
310
313
# Missing ldiv! definitions: https://github.com/JuliaSparse/SparseArrays.jl/issues/242
311
314
function LinearSolve. _ldiv! (x:: Vector ,
312
- A:: Union {SparseArrays . QR, LinearAlgebra. QRCompactWY,
315
+ A:: Union {QR, LinearAlgebra. QRCompactWY,
313
316
SparseArrays. SPQR. QRSparse,
314
317
SparseArrays. CHOLMOD. Factor}, b:: Vector )
315
318
x .= A \ b
316
319
end
317
320
318
321
function LinearSolve. _ldiv! (x:: AbstractVector ,
319
- A:: Union {SparseArrays . QR, LinearAlgebra. QRCompactWY,
322
+ A:: Union {QR, LinearAlgebra. QRCompactWY,
320
323
SparseArrays. SPQR. QRSparse,
321
324
SparseArrays. CHOLMOD. Factor}, b:: AbstractVector )
322
325
x .= A \ b
323
326
end
324
327
325
328
# Ambiguity removal
326
- function LinearSolve. _ldiv! (:: LinearSolve. SVector ,
329
+ function LinearSolve. _ldiv! (:: SVector ,
327
330
A:: Union {SparseArrays. CHOLMOD. Factor, LinearAlgebra. QR,
328
331
LinearAlgebra. QRCompactWY, SparseArrays. SPQR. QRSparse},
329
332
b:: AbstractVector )
330
333
(A \ b)
331
334
end
332
- function LinearSolve. _ldiv! (:: LinearSolve. SVector ,
335
+ function LinearSolve. _ldiv! (:: SVector ,
333
336
A:: Union {SparseArrays. CHOLMOD. Factor, LinearAlgebra. QR,
334
337
LinearAlgebra. QRCompactWY, SparseArrays. SPQR. QRSparse},
335
- b:: LinearSolve. SVector )
338
+ b:: SVector )
336
339
(A \ b)
337
340
end
338
341
@@ -365,16 +368,10 @@ function LinearSolve.init_cacheval(
365
368
nothing
366
369
end
367
370
368
- function LinearSolve. init_cacheval (alg:: QRFactorization , A:: SparseMatrixCSC{Float64, Int } , b, u, Pl, Pr,
371
+ function LinearSolve. init_cacheval (alg:: QRFactorization , A:: SparseMatrixCSC{Float64, <:Integer } , b, u, Pl, Pr,
369
372
maxiters:: Int , abstol, reltol, verbose:: Bool ,
370
373
assumptions:: OperatorAssumptions )
371
- LinearSolve. ArrayInterface. qr_instance (convert (AbstractMatrix, A), alg. pivot)
372
- end
373
-
374
- function LinearSolve. init_cacheval (alg:: QRFactorization , A:: SparseMatrixCSC{Float64, Int32} , b, u, Pl, Pr,
375
- maxiters:: Int , abstol, reltol, verbose:: Bool ,
376
- assumptions:: OperatorAssumptions )
377
- LinearSolve. ArrayInterface. qr_instance (convert (AbstractMatrix, A), alg. pivot)
374
+ ArrayInterface. qr_instance (convert (AbstractMatrix, A), alg. pivot)
378
375
end
379
376
380
377
function LinearSolve. init_cacheval (
0 commit comments