1
- using LinearSolve, RecursiveFactorization
1
+ using LinearSolve, LinearAlgebra, RecursiveFactorization
2
2
3
3
alglist = (
4
4
LUFactorization,
5
5
QRFactorization,
6
- DiagonalFactorization,
7
- DirectLdiv!,
8
- SparspakFactorization,
9
- KLUFactorization,
10
- UMFPACKFactorization,
11
6
KrylovJL_GMRES,
12
7
GenericLUFactorization,
13
8
RFLUFactorization,
14
- LDLtFactorization,
15
- BunchKaufmanFactorization,
16
- CHOLMODFactorization,
17
9
SVDFactorization,
18
- CholeskyFactorization,
19
10
NormalCholeskyFactorization,
20
- AppleAccelerateLUFactorization,
21
- MKLLUFactorization,
22
11
KrylovJL_CRAIGMR,
23
12
KrylovJL_LSMR
24
13
)
@@ -28,14 +17,23 @@ alglist = (
28
17
A = [2.0 1.0 ; - 1.0 1.0 ]
29
18
b = [- 1.0 , 1.0 ]
30
19
prob = LinearProblem (A, b)
31
- linsolve = init (prob, alg)
20
+ linsolve = init (prob, alg () )
32
21
sol = solve! (linsolve)
33
22
@test SciMLBase. successful_retcode (sol. retcode) || sol. retcode == ReturnCode. Default # The latter seems off...
34
23
end
35
24
end
36
25
26
+ lualgs = (
27
+ LUFactorization (),
28
+ QRFactorization (),
29
+ GenericLUFactorization (),
30
+ LinearSolve. DefaultLinearSolver (LinearSolve. DefaultAlgorithmChoice. LUFactorization; safetyfallback= false ),
31
+ RFLUFactorization (),
32
+ NormalCholeskyFactorization (),
33
+ )
37
34
@testset " Failure" begin
38
- for alg in alglist
35
+ for alg in lualgs
36
+ @show alg
39
37
A = [1.0 1.0 ; 1.0 1.0 ]
40
38
b = [- 1.0 , 1.0 ]
41
39
prob = LinearProblem (A, b)
44
42
@test ! SciMLBase. successful_retcode (sol. retcode)
45
43
end
46
44
end
45
+
46
+ rankdeficientalgs = (
47
+ QRFactorization (LinearAlgebra. ColumnNorm ()),
48
+ KrylovJL_GMRES (),
49
+ SVDFactorization (),
50
+ KrylovJL_CRAIGMR (),
51
+ KrylovJL_LSMR (),
52
+ LinearSolve. DefaultLinearSolver (LinearSolve. DefaultAlgorithmChoice. LUFactorization)
53
+ )
54
+
55
+ @testset " Rank Deficient Success" begin
56
+ for alg in rankdeficientalgs
57
+ @show alg
58
+ A = [1.0 1.0 ; 1.0 1.0 ]
59
+ b = [- 1.0 , 1.0 ]
60
+ prob = LinearProblem (A, b)
61
+ linsolve = init (prob, alg)
62
+ sol = solve! (linsolve)
63
+ @test SciMLBase. successful_retcode (sol. retcode)
64
+ end
65
+ end
0 commit comments