@@ -22,7 +22,9 @@ sol = benchmark_scalar(sf, csu0)
2222@test sol. retcode === ReturnCode. Success
2323@test sol. u * sol. u - 2 < 1e-9
2424
25- @test (@ballocated benchmark_scalar (sf, csu0)) == 0
25+ if VERSION >= v " 1.7"
26+ @test (@ballocated benchmark_scalar (sf, csu0)) == 0
27+ end
2628
2729# Broyden
2830function benchmark_scalar (f, u0)
3335sol = benchmark_scalar (sf, csu0)
3436@test sol. retcode === ReturnCode. Success
3537@test sol. u * sol. u - 2 < 1e-9
36- @test (@ballocated benchmark_scalar (sf, csu0)) == 0
38+ if VERSION >= v " 1.7"
39+ @test (@ballocated benchmark_scalar (sf, csu0)) == 0
40+ end
3741
3842# Klement
3943function benchmark_scalar (f, u0)
4448sol = benchmark_scalar (sf, csu0)
4549@test sol. retcode === ReturnCode. Success
4650@test sol. u * sol. u - 2 < 1e-9
47- @test (@ballocated benchmark_scalar (sf, csu0)) == 0
51+ if VERSION >= v " 1.7"
52+ @test (@ballocated benchmark_scalar (sf, csu0)) == 0
53+ end
4854
4955# TrustRegion
5056function benchmark_scalar (f, u0)
@@ -66,7 +72,7 @@ for alg in [SimpleNewtonRaphson(), Broyden(), Klement(),
6672 TrustRegion (10.0 )]
6773 g = function (p)
6874 probN = NonlinearProblem {false} (f, csu0, p)
69- sol = solve (probN, alg, tol = 1e-9 )
75+ sol = solve (probN, alg, abstol = 1e-9 )
7076 return sol. u[end ]
7177 end
7278
@@ -137,20 +143,11 @@ f, u0 = (u, p) -> u .* u .- 2.0, @SVector[1.0, 1.0]
137143probN = NonlinearProblem (f, u0)
138144
139145@test solve (probN, SimpleNewtonRaphson ()). u[end ] ≈ sqrt (2.0 )
140- @test solve (probN, SimpleNewtonRaphson (); immutable = false ). u[end ] ≈ sqrt (2.0 )
141- @test solve (probN, SimpleNewtonRaphson (; autodiff = false )). u[end ] ≈ sqrt (2.0 )
142146@test solve (probN, SimpleNewtonRaphson (; autodiff = false )). u[end ] ≈ sqrt (2.0 )
143-
144147@test solve (probN, TrustRegion (10.0 )). u[end ] ≈ sqrt (2.0 )
145- @test solve (probN, TrustRegion (10.0 ); immutable = false ). u[end ] ≈ sqrt (2.0 )
146- @test solve (probN, TrustRegion (10.0 ; autodiff = false )). u[end ] ≈ sqrt (2.0 )
147148@test solve (probN, TrustRegion (10.0 ; autodiff = false )). u[end ] ≈ sqrt (2.0 )
148-
149149@test solve (probN, Broyden ()). u[end ] ≈ sqrt (2.0 )
150- @test solve (probN, Broyden (); immutable = false ). u[end ] ≈ sqrt (2.0 )
151-
152150@test solve (probN, Klement ()). u[end ] ≈ sqrt (2.0 )
153- @test solve (probN, Klement (); immutable = false ). u[end ] ≈ sqrt (2.0 )
154151
155152for u0 in [1.0 , [1 , 1.0 ]]
156153 local f, probN, sol
0 commit comments