-
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix returncodes and stats for iterative solvers and add test coverage.
- Loading branch information
1 parent
175a74f
commit 8ac858d
Showing
3 changed files
with
48 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
@testset "Return codes" begin | ||
alglist = ( | ||
LUFactorization, | ||
QRFactorization, | ||
DiagonalFactorization, | ||
DirectLdiv!, | ||
SparspakFactorization, | ||
KLUFactorization, | ||
UMFPACKFactorization, | ||
KrylovJL_GMRES, | ||
GenericLUFactorization, | ||
RFLUFactorization, | ||
LDLtFactorization, | ||
BunchKaufmanFactorization, | ||
CHOLMODFactorization, | ||
SVDFactorization, | ||
CholeskyFactorization, | ||
NormalCholeskyFactorization, | ||
AppleAccelerateLUFactorization, | ||
MKLLUFactorization, | ||
KrylovJL_CRAIGMR, | ||
KrylovJL_LSMR, | ||
) | ||
|
||
@testset "Success" begin | ||
for alg in alglist | ||
A = [2.0 1.0; -1.0 1.0] | ||
b = [-1.0, 1.0] | ||
prob = LinearProblem(A, b) | ||
linsolve = init(prob, alg) | ||
sol = solve!(linsolve) | ||
@test SciMLBase.successful_retcode(sol.retcode) || sol.retcode == ReturnCode.Default # The latter seems off... | ||
end | ||
end | ||
|
||
@testset "Failure" begin | ||
for alg in alglist | ||
A = [1.0 1.0; 1.0 1.0] | ||
b = [-1.0, 1.0] | ||
prob = LinearProblem(A, b) | ||
linsolve = init(prob, alg) | ||
sol = solve!(linsolve) | ||
@test !SciMLBase.successful_retcode(sol.retcode) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters