@@ -46,10 +46,10 @@ sol = benchmark_scalar(sf, csu0)
4646@test sol. u * sol. u - 2 < 1e-9
4747@test (@ballocated benchmark_scalar (sf, csu0)) == 0
4848
49- # SimpleNewtonRaphsonTrustRegion
49+ # TrustRegion
5050function benchmark_scalar (f, u0)
5151 probN = NonlinearProblem {false} (f, u0)
52- sol = (solve (probN, SimpleNewtonRaphsonTrustRegion ( 1 .0 )))
52+ sol = (solve (probN, TrustRegion ( 10 .0 )))
5353end
5454
5555sol = benchmark_scalar (sf, csu0)
@@ -63,7 +63,7 @@ using ForwardDiff
6363f, u0 = (u, p) -> u .* u .- p, @SVector [1.0 , 1.0 ]
6464
6565for alg in [SimpleNewtonRaphson (), Broyden (), Klement (),
66- SimpleNewtonRaphsonTrustRegion (10.0 )]
66+ TrustRegion (10.0 )]
6767 g = function (p)
6868 probN = NonlinearProblem {false} (f, csu0, p)
6969 sol = solve (probN, alg, tol = 1e-9 )
7979# Scalar
8080f, u0 = (u, p) -> u * u - p, 1.0
8181for alg in [SimpleNewtonRaphson (), Broyden (), Klement (),
82- SimpleNewtonRaphsonTrustRegion (10.0 )]
82+ TrustRegion (10.0 )]
8383 g = function (p)
8484 probN = NonlinearProblem {false} (f, oftype (p, u0), p)
8585 sol = solve (probN, alg)
@@ -121,7 +121,7 @@ for alg in [Bisection(), Falsi()]
121121end
122122
123123for alg in [SimpleNewtonRaphson (), Broyden (), Klement (),
124- SimpleNewtonRaphsonTrustRegion ( 1 .0 )]
124+ TrustRegion ( 10 .0 )]
125125 global g, p
126126 g = function (p)
127127 probN = NonlinearProblem {false} (f, 0.5 , p)
@@ -141,10 +141,10 @@ probN = NonlinearProblem(f, u0)
141141@test solve (probN, SimpleNewtonRaphson (; autodiff = false )). u[end ] ≈ sqrt (2.0 )
142142@test solve (probN, SimpleNewtonRaphson (; autodiff = false )). u[end ] ≈ sqrt (2.0 )
143143
144- @test solve (probN, SimpleNewtonRaphsonTrustRegion ( 1 .0 )). u[end ] ≈ sqrt (2.0 )
145- @test solve (probN, SimpleNewtonRaphsonTrustRegion ( 1 .0 ); immutable = false ). u[end ] ≈ sqrt (2.0 )
146- @test solve (probN, SimpleNewtonRaphsonTrustRegion ( 1 .0 ; autodiff = false )). u[end ] ≈ sqrt (2.0 )
147- @test solve (probN, SimpleNewtonRaphsonTrustRegion ( 1 .0 ; autodiff = false )). u[end ] ≈ sqrt (2.0 )
144+ @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 )
147+ @test solve (probN, TrustRegion ( 10 .0 ; autodiff = false )). u[end ] ≈ sqrt (2.0 )
148148
149149@test solve (probN, Broyden ()). u[end ] ≈ sqrt (2.0 )
150150@test solve (probN, Broyden (); immutable = false ). u[end ] ≈ sqrt (2.0 )
@@ -162,9 +162,9 @@ for u0 in [1.0, [1, 1.0]]
162162 @test solve (probN, SimpleNewtonRaphson ()). u ≈ sol
163163 @test solve (probN, SimpleNewtonRaphson (; autodiff = false )). u ≈ sol
164164
165- @test solve (probN, SimpleNewtonRaphsonTrustRegion ( 1 .0 )). u ≈ sol
166- @test solve (probN, SimpleNewtonRaphsonTrustRegion ( 1 .0 )). u ≈ sol
167- @test solve (probN, SimpleNewtonRaphsonTrustRegion ( 1 .0 ; autodiff = false )). u ≈ sol
165+ @test solve (probN, TrustRegion ( 10 .0 )). u ≈ sol
166+ @test solve (probN, TrustRegion ( 10 .0 )). u ≈ sol
167+ @test solve (probN, TrustRegion ( 10 .0 ; autodiff = false )). u ≈ sol
168168
169169 @test solve (probN, Broyden ()). u ≈ sol
170170
0 commit comments