Skip to content

Commit 073a9c8

Browse files
expand the tests of the default algorithm
1 parent c4f8ed5 commit 073a9c8

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

src/factorization.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ function SciMLBase.solve(cache::LinearCache, alg::AbstractFactorization)
44
cache = set_cacheval(cache, fact)
55
end
66

7-
ldiv!(cache.u,cache.cacheval, cache.b)
7+
ldiv!(cache.u, cache.cacheval, cache.b)
88
end
99

1010
## LUFactorization

test/runtests.jl

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using LinearSolve, LinearAlgebra
1+
using LinearSolve, LinearAlgebra, SparseArrays
22
using Test
33

44
n = 8
@@ -38,6 +38,26 @@ end
3838
A1 = prob1.A; b1 = prob1.b; x1 = prob1.u0
3939
y = solve(prob1)
4040
@test A1 * y b1
41+
42+
_prob = LinearProblem(SymTridiagonal(A1.A), b1; u0=x1)
43+
y = solve(prob1)
44+
@test A1 * y b1
45+
46+
_prob = LinearProblem(Tridiagonal(A1.A), b1; u0=x1)
47+
y = solve(prob1)
48+
@test A1 * y b1
49+
50+
_prob = LinearProblem(Symmetric(A1.A), b1; u0=x1)
51+
y = solve(prob1)
52+
@test A1 * y b1
53+
54+
_prob = LinearProblem(Hermitian(A1.A), b1; u0=x1)
55+
y = solve(prob1)
56+
@test A1 * y b1
57+
58+
_prob = LinearProblem(sparse(A1.A), b1; u0=x1)
59+
y = solve(prob1)
60+
@test A1 * y b1
4161
end
4262

4363
@testset "Concrete Factorizations" begin

0 commit comments

Comments
 (0)