@@ -14,8 +14,11 @@ function defaultalg(A, b)
14
14
ArrayInterfaceCore. can_setindex (b)
15
15
if length (b) <= 10
16
16
alg = GenericLUFactorization ()
17
- elseif (length (b) <= 100 || (isopenblas () && length (b) <= 500 ))
17
+ elseif (length (b) <= 100 || (isopenblas () && length (b) <= 500 )) &&
18
+ eltype (A) <: Union{Float32, Float64}
18
19
alg = RFLUFactorization ()
20
+ # elseif A === nothing || A isa Matrix
21
+ # alg = FastLUFactorization()
19
22
else
20
23
alg = LUFactorization ()
21
24
end
@@ -30,7 +33,7 @@ function defaultalg(A, b)
30
33
elseif A isa SymTridiagonal
31
34
alg = GenericFactorization (; fact_alg = ldlt!)
32
35
elseif A isa SparseMatrixCSC
33
- alg = UMFPACKFactorization ()
36
+ alg = KLUFactorization ()
34
37
35
38
# This catches the cases where a factorization overload could exist
36
39
# For example, BlockBandedMatrix
@@ -40,7 +43,7 @@ function defaultalg(A, b)
40
43
# This catches the case where A is a CuMatrix
41
44
# Which does not have LU fully defined
42
45
elseif A isa GPUArraysCore. AbstractGPUArray || b isa GPUArraysCore. AbstractGPUArray
43
- alg = QRFactorization ( false )
46
+ alg = LUFactorization ( )
44
47
45
48
# Not factorizable operator, default to only using A*x
46
49
else
@@ -68,9 +71,13 @@ function SciMLBase.solve(cache::LinearCache, alg::Nothing,
68
71
if length (b) <= 10
69
72
alg = GenericLUFactorization ()
70
73
SciMLBase. solve (cache, alg, args... ; kwargs... )
71
- elseif (length (b) <= 100 || (isopenblas () && length (b) <= 500 ))
74
+ elseif (length (b) <= 100 || (isopenblas () && length (b) <= 500 )) &&
75
+ eltype (A) <: Union{Float32, Float64}
72
76
alg = RFLUFactorization ()
73
77
SciMLBase. solve (cache, alg, args... ; kwargs... )
78
+ # elseif A isa Matrix
79
+ # alg = FastLUFactorization()
80
+ # SciMLBase.solve(cache, alg, args...; kwargs...)
74
81
else
75
82
alg = LUFactorization ()
76
83
SciMLBase. solve (cache, alg, args... ; kwargs... )
@@ -89,7 +96,7 @@ function SciMLBase.solve(cache::LinearCache, alg::Nothing,
89
96
alg = GenericFactorization (; fact_alg = ldlt!)
90
97
SciMLBase. solve (cache, alg, args... ; kwargs... )
91
98
elseif A isa SparseMatrixCSC
92
- alg = UMFPACKFactorization ()
99
+ alg = KLUFactorization ()
93
100
SciMLBase. solve (cache, alg, args... ; kwargs... )
94
101
95
102
# This catches the cases where a factorization overload could exist
@@ -101,7 +108,7 @@ function SciMLBase.solve(cache::LinearCache, alg::Nothing,
101
108
# This catches the case where A is a CuMatrix
102
109
# Which does not have LU fully defined
103
110
elseif A isa GPUArraysCore. AbstractGPUArray
104
- alg = QRFactorization ( false )
111
+ alg = LUFactorization ( )
105
112
SciMLBase. solve (cache, alg, args... ; kwargs... )
106
113
107
114
# Not factorizable operator, default to only using A*x
@@ -126,9 +133,13 @@ function init_cacheval(alg::Nothing, A, b, u, Pl, Pr, maxiters, abstol, reltol,
126
133
if length (b) <= 10
127
134
alg = GenericLUFactorization ()
128
135
init_cacheval (alg, A, b, u, Pl, Pr, maxiters, abstol, reltol, verbose)
129
- elseif (length (b) <= 100 || (isopenblas () && length (b) <= 500 ))
136
+ elseif (length (b) <= 100 || (isopenblas () && length (b) <= 500 )) &&
137
+ eltype (A) <: Union{Float32, Float64}
130
138
alg = RFLUFactorization ()
131
139
init_cacheval (alg, A, b, u, Pl, Pr, maxiters, abstol, reltol, verbose)
140
+ # elseif A isa Matrix
141
+ # alg = FastLUFactorization()
142
+ # init_cacheval(alg, A, b, u, Pl, Pr, maxiters, abstol, reltol, verbose)
132
143
else
133
144
alg = LUFactorization ()
134
145
init_cacheval (alg, A, b, u, Pl, Pr, maxiters, abstol, reltol, verbose)
@@ -147,7 +158,7 @@ function init_cacheval(alg::Nothing, A, b, u, Pl, Pr, maxiters, abstol, reltol,
147
158
alg = GenericFactorization (; fact_alg = ldlt!)
148
159
init_cacheval (alg, A, b, u, Pl, Pr, maxiters, abstol, reltol, verbose)
149
160
elseif A isa SparseMatrixCSC
150
- alg = UMFPACKFactorization ()
161
+ alg = KLUFactorization ()
151
162
init_cacheval (alg, A, b, u, Pl, Pr, maxiters, abstol, reltol, verbose)
152
163
153
164
# This catches the cases where a factorization overload could exist
@@ -159,7 +170,7 @@ function init_cacheval(alg::Nothing, A, b, u, Pl, Pr, maxiters, abstol, reltol,
159
170
# This catches the case where A is a CuMatrix
160
171
# Which does not have LU fully defined
161
172
elseif A isa GPUArraysCore. AbstractGPUArray
162
- alg = QRFactorization ( false )
173
+ alg = LUFactorization ( )
163
174
init_cacheval (alg, A, b, u, Pl, Pr, maxiters, abstol, reltol, verbose)
164
175
165
176
# Not factorizable operator, default to only using A*x
0 commit comments