@@ -34,13 +34,13 @@ u0 = [1.0, 1.0]
34
34
35
35
sol = benchmark_immutable (ff, cu0)
36
36
@test sol. retcode === ReturnCode. Success
37
- @test all (sol. u .* sol. u .- 2 .< 1e-9 )
37
+ @test all (abs .( sol. u .* sol. u .- 2 ) .< 1e-9 )
38
38
sol = benchmark_mutable (ff, u0)
39
39
@test sol. retcode === ReturnCode. Success
40
- @test all (sol. u .* sol. u .- 2 .< 1e-9 )
40
+ @test all (abs .( sol. u .* sol. u .- 2 ) .< 1e-9 )
41
41
sol = benchmark_scalar (sf, csu0)
42
42
@test sol. retcode === ReturnCode. Success
43
- @test sol. u * sol. u - 2 < 1e-9
43
+ @test abs ( sol. u * sol. u - 2 ) < 1e-9
44
44
45
45
# @test (@ballocated benchmark_immutable(ff, cu0)) < 200
46
46
# @test (@ballocated benchmark_mutable(ff, cu0)) < 200
@@ -59,7 +59,7 @@ u0 = [1.0, 1.0]
59
59
60
60
sol = benchmark_inplace (ffiip, u0)
61
61
@test sol. retcode === ReturnCode. Success
62
- @test all (sol. u .* sol. u .- 2 .< 1e-9 )
62
+ @test all (abs .( sol. u .* sol. u .- 2 ) .< 1e-9 )
63
63
64
64
u0 = [1.0 , 1.0 ]
65
65
probN = NonlinearProblem {true} (ffiip, u0)
@@ -160,13 +160,13 @@ u0 = [1.0, 1.0]
160
160
161
161
sol = benchmark_immutable (ff, cu0)
162
162
@test sol. retcode === ReturnCode. Success
163
- @test all (sol. u .* sol. u .- 2 .< 1e-9 )
163
+ @test all (abs .( sol. u .* sol. u .- 2 ) .< 1e-9 )
164
164
sol = benchmark_mutable (ff, u0)
165
165
@test sol. retcode === ReturnCode. Success
166
- @test all (sol. u .* sol. u .- 2 .< 1e-9 )
166
+ @test all (abs .( sol. u .* sol. u .- 2 ) .< 1e-9 )
167
167
sol = benchmark_scalar (sf, csu0)
168
168
@test sol. retcode === ReturnCode. Success
169
- @test sol. u * sol. u - 2 < 1e-9
169
+ @test abs ( sol. u * sol. u - 2 ) < 1e-9
170
170
171
171
function benchmark_inplace (f, u0)
172
172
probN = NonlinearProblem {true} (f, u0)
@@ -181,7 +181,7 @@ u0 = [1.0, 1.0]
181
181
182
182
sol = benchmark_inplace (ffiip, u0)
183
183
@test sol. retcode === ReturnCode. Success
184
- @test all (sol. u .* sol. u .- 2 .< 1e-9 )
184
+ @test all (abs .( sol. u .* sol. u .- 2 ) .< 1e-9 )
185
185
186
186
u0 = [1.0 , 1.0 ]
187
187
probN = NonlinearProblem {true} (ffiip, u0)
@@ -263,7 +263,7 @@ f = (u, p) -> 0.010000000000000002 .+
263
263
0.0011552453009332421 u .- p
264
264
g = function (p)
265
265
probN = NonlinearProblem {false} (f, u0, p)
266
- sol = solve (probN, TrustRegion ())
266
+ sol = solve (probN, TrustRegion (), abstol = 1e-10 )
267
267
return sol. u
268
268
end
269
269
p = [0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 , 0.0 ]
@@ -295,7 +295,7 @@ for options in list_of_options
295
295
expand_factor = options[7 ],
296
296
max_shrink_times = options[8 ])
297
297
298
- probN = NonlinearProblem (f, u0, p)
299
- sol = solve (probN, alg)
300
- @test all (f (u, p) .< 1e-10 )
298
+ probN = NonlinearProblem {false} (f, u0, p)
299
+ sol = solve (probN, alg, abstol = 1e-10 )
300
+ @test all (abs .( f (u, p) ) .< 1e-10 )
301
301
end
0 commit comments