Skip to content

Commit 83cefb6

Browse files
fix AD Tests
1 parent 051a0f1 commit 83cefb6

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

test/ADtests.jl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using Optimization, OptimizationOptimJL, OptimizationMOI, Ipopt, Test
1+
using Optimization, OptimizationOptimJL, OptimizationMOI, OptimizationLBFGSB
2+
using Ipopt, Test
23
using ForwardDiff, Zygote, ReverseDiff, FiniteDiff, Tracker, Mooncake
34
using Enzyme, Random
45

@@ -22,7 +23,7 @@ end
2223
optf = OptimizationFunction(rosenbrock; grad = g!, hess = h!)
2324

2425
prob = OptimizationProblem(optf, x0)
25-
sol = solve(prob, Optimization.LBFGS())
26+
sol = solve(prob, OptimizationLBFGSB.LBFGSB())
2627

2728
@test 10 * sol.objective < l1
2829
@test sol.retcode == ReturnCode.Success
@@ -66,7 +67,7 @@ end
6667
end
6768
end
6869

69-
sol = solve(prob, Optimization.LBFGS(), maxiters = 1000)
70+
sol = solve(prob, OptimizationLBFGSB.LBFGSB(), maxiters = 1000)
7071
@test 10 * sol.objective < l1
7172
@test sol.retcode == ReturnCode.Success
7273
end
@@ -82,7 +83,7 @@ end
8283
prob = OptimizationProblem(
8384
optf, x0, lb = [-1.0, -1.0], ub = [1.0, 1.0], lcons = [0.0], ucons = [0.0])
8485

85-
sol = solve(prob, Optimization.LBFGS(), maxiters = 1000)
86+
sol = solve(prob, OptimizationLBFGSB.LBFGSB(), maxiters = 1000)
8687
@test 10 * sol.objective < l1
8788

8889
# Requires Hession, which Mooncake doesn't support at the moment.
@@ -107,7 +108,7 @@ end
107108
prob = OptimizationProblem(optf, x0, lb = [-1.0, -1.0], ub = [1.0, 1.0],
108109
lcons = [1.0, -2.0], ucons = [1.0, 2.0])
109110

110-
sol = solve(prob, Optimization.LBFGS(), maxiters = 1000)
111+
sol = solve(prob, OptimizationLBFGSB.LBFGSB(), maxiters = 1000)
111112
@test 10 * sol.objective < l1
112113

113114
# Requires Hession, which Mooncake doesn't support at the moment.

0 commit comments

Comments
 (0)