1- using LinearSolve, RecursiveFactorization
1+ using LinearSolve, LinearAlgebra, RecursiveFactorization
22
33alglist = (
44 LUFactorization,
55 QRFactorization,
6- DiagonalFactorization,
7- DirectLdiv!,
8- SparspakFactorization,
9- KLUFactorization,
10- UMFPACKFactorization,
116 KrylovJL_GMRES,
127 GenericLUFactorization,
138 RFLUFactorization,
14- LDLtFactorization,
15- BunchKaufmanFactorization,
16- CHOLMODFactorization,
179 SVDFactorization,
18- CholeskyFactorization,
1910 NormalCholeskyFactorization,
20- AppleAccelerateLUFactorization,
21- MKLLUFactorization,
2211 KrylovJL_CRAIGMR,
2312 KrylovJL_LSMR
2413)
@@ -28,14 +17,23 @@ alglist = (
2817 A = [2.0 1.0 ; - 1.0 1.0 ]
2918 b = [- 1.0 , 1.0 ]
3019 prob = LinearProblem (A, b)
31- linsolve = init (prob, alg)
20+ linsolve = init (prob, alg () )
3221 sol = solve! (linsolve)
3322 @test SciMLBase. successful_retcode (sol. retcode) || sol. retcode == ReturnCode. Default # The latter seems off...
3423 end
3524end
3625
26+ lualgs = (
27+ LUFactorization (),
28+ QRFactorization (),
29+ GenericLUFactorization (),
30+ LinearSolve. DefaultLinearSolver (LinearSolve. DefaultAlgorithmChoice. LUFactorization; safetyfallback= false ),
31+ RFLUFactorization (),
32+ NormalCholeskyFactorization (),
33+ )
3734@testset " Failure" begin
38- for alg in alglist
35+ for alg in lualgs
36+ @show alg
3937 A = [1.0 1.0 ; 1.0 1.0 ]
4038 b = [- 1.0 , 1.0 ]
4139 prob = LinearProblem (A, b)
4442 @test ! SciMLBase. successful_retcode (sol. retcode)
4543 end
4644end
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