Skip to content

Commit b576e40

Browse files
authored
If INCLUDE_SPARSE is false, then default to KrylovJL_GMRES() for sparse matrices
1 parent f418c7c commit b576e40

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

src/default.jl

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,17 @@ function defaultalg(A::SymTridiagonal, b, ::OperatorAssumptions{true})
3434
GenericFactorization(; fact_alg = ldlt!)
3535
end
3636

37-
function defaultalg(A::SparseMatrixCSC, b, ::OperatorAssumptions{true})
38-
if length(b) <= 10_000
39-
KLUFactorization()
40-
else
41-
UMFPACKFactorization()
37+
@static if INCLUDE_SPARSE
38+
function defaultalg(A::SparseMatrixCSC, b, ::OperatorAssumptions{true})
39+
if length(b) <= 10_000
40+
KLUFactorization()
41+
else
42+
UMFPACKFactorization()
43+
end
44+
end
45+
else
46+
function defaultalg(A::SparseMatrixCSC, b, ::OperatorAssumptions{true})
47+
KrylovJL_GMRES()
4248
end
4349
end
4450

@@ -51,11 +57,7 @@ function defaultalg(A::GPUArraysCore.AbstractGPUArray, b, ::OperatorAssumptions{
5157
end
5258

5359
function defaultalg(A, b::GPUArraysCore.AbstractGPUArray, ::OperatorAssumptions{true})
54-
if VERSION >= v"1.8-"
55-
LUFactorization()
56-
else
57-
QRFactorization()
58-
end
60+
KrylovJL_GMRES()
5961
end
6062

6163
function defaultalg(A::SciMLBase.AbstractDiffEqOperator, b,

0 commit comments

Comments
 (0)