@@ -3,7 +3,7 @@ using DifferentialEquations, Test
3
3
f_2dlinear = (du, u, p, t) -> (@. du = p * u)
4
4
f_2dlinear_analytic = (u0, p, t) -> @. u0 * exp (p * t)
5
5
prob_ode_2Dlinear = ODEProblem (ODEFunction (f_2dlinear, analytic = f_2dlinear_analytic),
6
- rand (4 , 2 ), (0.0 , 1.0 ), 1.01 )
6
+ rand (4 , 2 ), (0.0 , 1.0 ), 1.01 )
7
7
8
8
alg, kwargs = default_algorithm (prob_ode_2Dlinear; dt = 1 // 2 ^ (4 ))
9
9
integ = init (prob_ode_2Dlinear; dt = 1 // 2 ^ (4 ))
@@ -36,12 +36,14 @@ sol = solve(prob_ode_2Dlinear; alg_hints = [:stiff], reltol = 1e-1)
36
36
@test typeof (sol. alg) <: Rosenbrock23
37
37
38
38
const linear_bigα = parse (BigFloat, " 1.01" )
39
- f = (du, u, p, t) -> begin for i in 1 : length (u)
40
- du[i] = linear_bigα * u[i]
41
- end end
39
+ f = (du, u, p, t) -> begin
40
+ for i in 1 : length (u)
41
+ du[i] = linear_bigα * u[i]
42
+ end
43
+ end
42
44
(:: typeof (f))(:: Type{Val{:analytic}} , u0, p, t) = u0 * exp (linear_bigα * t)
43
45
prob_ode_bigfloat2Dlinear = ODEProblem (f, map (BigFloat, rand (4 , 2 )) .* ones (4 , 2 ) / 2 ,
44
- (0.0 , 1.0 ))
46
+ (0.0 , 1.0 ))
45
47
46
48
sol = solve (prob_ode_bigfloat2Dlinear; dt = 1 // 2 ^ (4 ))
47
49
@test typeof (sol. alg. algs[1 ]) <: Vern9
@@ -60,12 +62,12 @@ sol = solve(prob_ode_bigfloat2Dlinear, nothing; alg_hints = [:stiff])
60
62
struct FooAlg end
61
63
62
64
@test_throws DiffEqBase. NonSolverError solve (prob_ode_bigfloat2Dlinear, FooAlg ();
63
- default_set = true )
65
+ default_set = true )
64
66
65
67
struct FooAlg2 <: DiffEqBase.DEAlgorithm end
66
68
67
69
@test_throws DiffEqBase. ProblemSolverPairingError solve (prob_ode_bigfloat2Dlinear,
68
- FooAlg2 (); default_set = true )
70
+ FooAlg2 (); default_set = true )
69
71
70
72
prob = ODEProblem (f, rand (4 , 2 ) .* ones (4 , 2 ) / 2 , (0.0 , 1.0 ))
71
73
0 commit comments