@@ -63,18 +63,22 @@ sol = solve(prob, AmplNLWriter.Optimizer(Ipopt_jll.amplexe))
63
63
64
64
# equality constraint, lcons == ucons
65
65
cons2 = [0.0 ~ x^ 2 + y^ 2 ]
66
+ out = zeros (1 )
66
67
sys2 = OptimizationSystem (loss, [x, y], [a, b], name = :sys2 , constraints = cons2)
67
68
prob = OptimizationProblem (sys2, [x => 0.0 , y => 0.0 ], [a => 1.0 , b => 1.0 ], lcons = [1.0 ],
68
69
ucons = [1.0 ], grad = true , hess = true )
69
70
sol = solve (prob, IPNewton ())
70
71
@test sol. minimum < 1.0
71
- @test prob. f. cons (sol. minimizer, [1.0 , 1.0 ]) ≈ [1.0 ]
72
+ prob. f. cons (out, sol. minimizer, [1.0 , 1.0 ])
73
+ @test out ≈ [1.0 ]
72
74
sol = solve (prob, Ipopt. Optimizer ())
73
75
@test sol. minimum < 1.0
74
- @test prob. f. cons (sol. minimizer, [1.0 , 1.0 ]) ≈ [1.0 ]
76
+ prob. f. cons (out, sol. minimizer, [1.0 , 1.0 ])
77
+ @test out ≈ [1.0 ]
75
78
sol = solve (prob, AmplNLWriter. Optimizer (Ipopt_jll. amplexe))
76
79
@test sol. minimum < 1.0
77
- @test prob. f. cons (sol. minimizer, [1.0 , 1.0 ]) ≈ [1.0 ]
80
+ prob. f. cons (out, sol. minimizer, [1.0 , 1.0 ])
81
+ @test out ≈ [1.0 ]
78
82
79
83
rosenbrock (x, p) = (p[1 ] - x[1 ])^ 2 + p[2 ] * (x[2 ] - x[1 ]^ 2 )^ 2
80
84
x0 = zeros (2 )
0 commit comments