@@ -33,7 +33,11 @@ function defaultalg(A, b)
33
33
elseif A isa SymTridiagonal
34
34
alg = GenericFactorization (; fact_alg = ldlt!)
35
35
elseif A isa SparseMatrixCSC
36
- alg = KLUFactorization ()
36
+ if length (b) <= 10_000
37
+ alg = KLUFactorization ()
38
+ else
39
+ alg = UMFPACKFactorization ()
40
+ end
37
41
38
42
# This catches the cases where a factorization overload could exist
39
43
# For example, BlockBandedMatrix
@@ -96,8 +100,14 @@ function SciMLBase.solve(cache::LinearCache, alg::Nothing,
96
100
alg = GenericFactorization (; fact_alg = ldlt!)
97
101
SciMLBase. solve (cache, alg, args... ; kwargs... )
98
102
elseif A isa SparseMatrixCSC
99
- alg = KLUFactorization ()
100
- SciMLBase. solve (cache, alg, args... ; kwargs... )
103
+ b = cache. b
104
+ if length (b) <= 10_000
105
+ alg = KLUFactorization ()
106
+ SciMLBase. solve (cache, alg, args... ; kwargs... )
107
+ else
108
+ alg = UMFPACKFactorization ()
109
+ SciMLBase. solve (cache, alg, args... ; kwargs... )
110
+ end
101
111
102
112
# This catches the cases where a factorization overload could exist
103
113
# For example, BlockBandedMatrix
@@ -158,8 +168,13 @@ function init_cacheval(alg::Nothing, A, b, u, Pl, Pr, maxiters, abstol, reltol,
158
168
alg = GenericFactorization (; fact_alg = ldlt!)
159
169
init_cacheval (alg, A, b, u, Pl, Pr, maxiters, abstol, reltol, verbose)
160
170
elseif A isa SparseMatrixCSC
161
- alg = KLUFactorization ()
162
- init_cacheval (alg, A, b, u, Pl, Pr, maxiters, abstol, reltol, verbose)
171
+ if length (b) <= 10_000
172
+ alg = KLUFactorization ()
173
+ init_cacheval (alg, A, b, u, Pl, Pr, maxiters, abstol, reltol, verbose)
174
+ else
175
+ alg = UMFPACKFactorization ()
176
+ init_cacheval (alg, A, b, u, Pl, Pr, maxiters, abstol, reltol, verbose)
177
+ end
163
178
164
179
# This catches the cases where a factorization overload could exist
165
180
# For example, BlockBandedMatrix
0 commit comments