@@ -25,6 +25,10 @@ struct LUFactorization{P} <: AbstractFactorization
25
25
pivot:: P
26
26
end
27
27
28
+ struct GenericLUFactorization{P} <: AbstractFactorization
29
+ pivot:: P
30
+ end
31
+
28
32
function LUFactorization ()
29
33
pivot = @static if VERSION < v " 1.7beta"
30
34
Val (true )
@@ -34,6 +38,15 @@ function LUFactorization()
34
38
LUFactorization (pivot)
35
39
end
36
40
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
+
37
50
function do_factorization (alg:: LUFactorization , A, b, u)
38
51
A = convert (AbstractMatrix,A)
39
52
if A isa SparseMatrixCSC
@@ -44,7 +57,13 @@ function do_factorization(alg::LUFactorization, A, b, u)
44
57
return fact
45
58
end
46
59
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))
48
67
49
68
# This could be a GenericFactorization perhaps?
50
69
Base. @kwdef struct UMFPACKFactorization <: AbstractFactorization
0 commit comments