Skip to content

Commit f40873e

Browse files
fix possible test failure
1 parent 6ef0cf6 commit f40873e

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

test/downstream/default_linsolve_structure.jl

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,37 @@ jac = (J,u,p,t) -> (J[1,1] = 1/t; J[2,2] = 1/t; J)
55
jp_diag = Diagonal(zeros(2))
66
fun = ODEFunction(f; jac=jac, jac_prototype=jp_diag)
77
prob = ODEProblem(fun,ones(2),(1.0,10.0))
8+
sol = solve(prob,Rosenbrock23())
9+
@test sol[end] [10.0,10.0]
10+
@test length(sol) < 60
11+
812
sol = solve(prob,Rosenbrock23(autodiff=false))
913
@test sol[end] [10.0,10.0]
1014
@test length(sol) < 60
1115

1216
jp = Tridiagonal(jp_diag)
1317
fun = ODEFunction(f; jac=jac, jac_prototype=jp)
1418
prob = ODEProblem(fun,ones(2),(1.0,10.0))
19+
20+
sol = solve(prob,Rosenbrock23())
21+
@test sol[end] [10.0,10.0]
22+
@test length(sol) < 60
23+
1524
sol = solve(prob,Rosenbrock23(autodiff=false))
1625
@test sol[end] [10.0,10.0]
1726
@test length(sol) < 60
1827

1928
jp = SymTridiagonal(jp_diag)
2029
fun = ODEFunction(f; jac=jac, jac_prototype=jp)
2130
prob = ODEProblem(fun,ones(2),(1.0,10.0))
22-
sol = solve(prob,Rosenbrock23(autodiff=false))
31+
sol = solve(prob,Rosenbrock23())
2332
@test sol[end] [10.0,10.0]
2433
@test length(sol) < 60
2534

35+
# Don't test the autodiff=false version here because it's not as numerically stable,
36+
# so lack of optimizations would lead to unsymmetric which causes an error:
37+
# LoadError: ArgumentError: broadcasted assignment breaks symmetry between locations (1, 2) and (2, 1)
38+
2639
@test_broken begin
2740
jp = Hermitian(jp_diag)
2841
fun = ODEFunction(f; jac=jac, jac_prototype=jp)

0 commit comments

Comments
 (0)