|
1 | 1 | using LinearSolve, LinearAlgebra, SparseArrays, Test, JET
|
2 | 2 | @test LinearSolve.defaultalg(nothing, zeros(3)).alg ===
|
3 | 3 | LinearSolve.DefaultAlgorithmChoice.GenericLUFactorization
|
| 4 | +prob = LinearProblem(rand(3, 3), rand(3)) |
| 5 | +solve(prob) |
| 6 | + |
4 | 7 | @test LinearSolve.defaultalg(nothing, zeros(50)).alg ===
|
5 | 8 | LinearSolve.DefaultAlgorithmChoice.RFLUFactorization
|
| 9 | +prob = LinearProblem(rand(50, 50), rand(50)) |
| 10 | +solve(prob) |
| 11 | + |
6 | 12 | @test LinearSolve.defaultalg(nothing, zeros(600)).alg ===
|
7 | 13 | LinearSolve.DefaultAlgorithmChoice.GenericLUFactorization
|
| 14 | +prob = LinearProblem(rand(600, 600), rand(600)) |
| 15 | +solve(prob) |
| 16 | + |
8 | 17 | @test LinearSolve.defaultalg(LinearAlgebra.Diagonal(zeros(5)), zeros(5)).alg ===
|
9 | 18 | LinearSolve.DefaultAlgorithmChoice.DiagonalFactorization
|
10 | 19 |
|
11 | 20 | @test LinearSolve.defaultalg(nothing, zeros(5),
|
12 | 21 | LinearSolve.OperatorAssumptions(false)).alg ===
|
13 | 22 | LinearSolve.DefaultAlgorithmChoice.QRFactorization
|
14 | 23 |
|
15 |
| -@test LinearSolve.defaultalg(sprand(1000, 1000, 0.01), zeros(1000)).alg === |
| 24 | +@test LinearSolve.defaultalg(sprand(1000, 1000, 0.5), zeros(1000)).alg === |
16 | 25 | LinearSolve.DefaultAlgorithmChoice.KLUFactorization
|
| 26 | +prob = LinearProblem(sprand(1000, 1000, 0.5), zeros(1000)) |
| 27 | +solve(prob) |
| 28 | + |
17 | 29 | @test LinearSolve.defaultalg(sprand(11000, 11000, 0.001), zeros(11000)).alg ===
|
18 | 30 | LinearSolve.DefaultAlgorithmChoice.UMFPACKFactorization
|
| 31 | +prob = LinearProblem(sprand(11000, 11000, 0.5), zeros(11000)) |
| 32 | +solve(prob) |
19 | 33 |
|
20 | 34 | @static if VERSION >= v"v1.7-"
|
21 | 35 | # Test inference
|
|
0 commit comments