@@ -25,6 +25,10 @@ struct LUFactorization{P} <: AbstractFactorization
2525 pivot:: P
2626end
2727
28+ struct GenericLUFactorization{P} <: AbstractFactorization
29+ pivot:: P
30+ end
31+
2832function LUFactorization ()
2933 pivot = @static if VERSION < v " 1.7beta"
3034 Val (true )
@@ -34,6 +38,15 @@ function LUFactorization()
3438 LUFactorization (pivot)
3539end
3640
41+ function GenericLUFactorization ()
42+ pivot = @static if VERSION < v " 1.7beta"
43+ Val (true )
44+ else
45+ RowMaximum ()
46+ end
47+ GenericLUFactorization (pivot)
48+ end
49+
3750function do_factorization (alg:: LUFactorization , A, b, u)
3851 A = convert (AbstractMatrix,A)
3952 if A isa SparseMatrixCSC
@@ -44,7 +57,13 @@ function do_factorization(alg::LUFactorization, A, b, u)
4457 return fact
4558end
4659
47- init_cacheval (alg:: LUFactorization , A, b, u, Pl, Pr, maxiters, abstol, reltol, verbose) = ArrayInterface. lu_instance (convert (AbstractMatrix,A))
60+ function do_factorization (alg:: GenericLUFactorization , A, b, u)
61+ A = convert (AbstractMatrix,A)
62+ fact = LinearAlgebra. generic_lufact! (A, alg. pivot)
63+ return fact
64+ end
65+
66+ init_cacheval (alg:: Union{LUFactorization,GenericLUFactorization} , A, b, u, Pl, Pr, maxiters, abstol, reltol, verbose) = ArrayInterface. lu_instance (convert (AbstractMatrix,A))
4867
4968# This could be a GenericFactorization perhaps?
5069Base. @kwdef struct UMFPACKFactorization <: AbstractFactorization
0 commit comments