@@ -2,6 +2,7 @@ using OptimizationManopt
22using OptimizationBase
33using Manifolds
44using ForwardDiff, Zygote, Enzyme, FiniteDiff, ReverseDiff
5+ using DifferentiationInterface: SecondOrder
56using Manopt, RipQP, QuadraticModels
67using Test
78using SciMLBase
@@ -40,12 +41,12 @@ R2 = Euclidean(2)
4041 prob_forwarddiff = OptimizationProblem (
4142 optprob_forwarddiff, x0, p; manifold = R2, stepsize = stepsize)
4243 sol = OptimizationBase. solve (prob_forwarddiff, opt)
43- @test sol. minimum < 0.2
44+ @test sol. objective < 0.2
4445
4546 optprob_grad = OptimizationFunction (rosenbrock; grad = rosenbrock_grad!)
4647 prob_grad = OptimizationProblem (optprob_grad, x0, p; manifold = R2, stepsize = stepsize)
4748 sol = OptimizationBase. solve (prob_grad, opt)
48- @test sol. minimum < 0.2
49+ @test sol. objective < 0.2
4950 end
5051
5152 @testset " Nelder-Mead" begin
@@ -58,7 +59,7 @@ R2 = Euclidean(2)
5859 prob = OptimizationProblem (optprob, x0, p; manifold = R2)
5960
6061 sol = OptimizationBase. solve (prob, opt)
61- @test sol. minimum < 0.7
62+ @test sol. objective < 0.7
6263 end
6364
6465 @testset " Conjugate gradient descent" begin
@@ -72,7 +73,7 @@ R2 = Euclidean(2)
7273 prob = OptimizationProblem (optprob, x0, p; manifold = R2)
7374
7475 sol = OptimizationBase. solve (prob, opt, stepsize = stepsize)
75- @test sol. minimum < 0.5
76+ @test sol. objective < 0.5
7677 end
7778
7879 @testset " Quasi Newton" begin
@@ -89,7 +90,7 @@ R2 = Euclidean(2)
8990 prob = OptimizationProblem (optprob, x0, p; manifold = R2)
9091
9192 sol = OptimizationBase. solve (prob, opt, callback = callback, maxiters = 30 )
92- @test sol. minimum < 1e-14
93+ @test sol. objective < 1e-14
9394 end
9495
9596 @testset " Particle swarm" begin
@@ -102,7 +103,7 @@ R2 = Euclidean(2)
102103 prob = OptimizationProblem (optprob, x0, p; manifold = R2)
103104
104105 sol = OptimizationBase. solve (prob, opt)
105- @test sol. minimum < 0.1
106+ @test sol. objective < 0.1
106107 end
107108
108109 @testset " CMA-ES" begin
@@ -115,7 +116,7 @@ R2 = Euclidean(2)
115116 prob = OptimizationProblem (optprob, x0, p; manifold = R2)
116117
117118 sol = OptimizationBase. solve (prob, opt)
118- @test sol. minimum < 0.1
119+ @test sol. objective < 0.1
119120 end
120121
121122 @testset " ConvexBundle" begin
@@ -129,7 +130,7 @@ R2 = Euclidean(2)
129130
130131 sol = OptimizationBase. solve (
131132 prob, opt, sub_problem = Manopt. convex_bundle_method_subsolver)
132- @test sol. minimum < 0.1
133+ @test sol. objective < 0.1
133134 end
134135
135136 # @testset "TruncatedConjugateGradientDescent" begin
@@ -142,7 +143,7 @@ R2 = Euclidean(2)
142143 # prob = OptimizationProblem(optprob, x0, p; manifold = R2)
143144
144145 # sol = OptimizationBase.solve(prob, opt)
145- # @test_broken sol.minimum < 0.1
146+ # @test_broken sol.objective < 0.1
146147 # end
147148
148149 @testset " AdaptiveRegularizationCubic" begin
@@ -153,11 +154,12 @@ R2 = Euclidean(2)
153154
154155 # TODO : This autodiff currently provides a Hessian that seem to not provide a Hessian
155156 # ARC Fails but also AD before that warns. So it passes _some_ hessian but a wrong one, even in format
156- optprob = OptimizationFunction (rosenbrock, AutoForwardDiff ())
157+ optprob = OptimizationFunction (rosenbrock, SecondOrder ( AutoForwardDiff (), AutoForwardDiff () ))
157158 prob = OptimizationProblem (optprob, x0, p; manifold = R2)
158159
159160 sol = OptimizationBase. solve (prob, opt)
160- @test sol. minimum < 0.1
161+ @test sol. objective < 0.1
162+ @test SciMLBase. successful_retcode (sol) broken= true
161163 end
162164
163165 @testset " TrustRegions" begin
@@ -168,11 +170,12 @@ R2 = Euclidean(2)
168170
169171 # TODO : This autodiff currently provides a Hessian that seem to not provide a Hessian
170172 # TR Fails but also AD before that warns. So it passes _some_ hessian but a wrong one, even in format
171- optprob = OptimizationFunction (rosenbrock, AutoForwardDiff ())
173+ optprob = OptimizationFunction (rosenbrock, SecondOrder ( AutoForwardDiff (), AutoForwardDiff () ))
172174 prob = OptimizationProblem (optprob, x0, p; manifold = R2)
173175
174176 sol = OptimizationBase. solve (prob, opt)
175- @test sol. minimum < 0.1
177+ @test sol. objective < 0.1
178+ @test SciMLBase. successful_retcode (sol) broken= true
176179 end
177180
178181 @testset " Custom constraints" begin
0 commit comments