@@ -5,24 +5,37 @@ jac = (J,u,p,t) -> (J[1,1] = 1/t; J[2,2] = 1/t; J)
5
5
jp_diag = Diagonal (zeros (2 ))
6
6
fun = ODEFunction (f; jac= jac, jac_prototype= jp_diag)
7
7
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
+
8
12
sol = solve (prob,Rosenbrock23 (autodiff= false ))
9
13
@test sol[end ] ≈ [10.0 ,10.0 ]
10
14
@test length (sol) < 60
11
15
12
16
jp = Tridiagonal (jp_diag)
13
17
fun = ODEFunction (f; jac= jac, jac_prototype= jp)
14
18
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
+
15
24
sol = solve (prob,Rosenbrock23 (autodiff= false ))
16
25
@test sol[end ] ≈ [10.0 ,10.0 ]
17
26
@test length (sol) < 60
18
27
19
28
jp = SymTridiagonal (jp_diag)
20
29
fun = ODEFunction (f; jac= jac, jac_prototype= jp)
21
30
prob = ODEProblem (fun,ones (2 ),(1.0 ,10.0 ))
22
- sol = solve (prob,Rosenbrock23 (autodiff = false ))
31
+ sol = solve (prob,Rosenbrock23 ())
23
32
@test sol[end ] ≈ [10.0 ,10.0 ]
24
33
@test length (sol) < 60
25
34
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
+
26
39
@test_broken begin
27
40
jp = Hermitian (jp_diag)
28
41
fun = ODEFunction (f; jac= jac, jac_prototype= jp)
0 commit comments