File tree Expand file tree Collapse file tree 4 files changed +7
-5
lines changed
Expand file tree Collapse file tree 4 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -27,11 +27,11 @@ function hs10_oracle()
2727 # Bounds: 0 ≤ g(x) ≤ +∞
2828 set = MOI. VectorNonlinearOracle (;
2929 dimension = 2 , # number of input variables (x1, x2)
30- l = [0 .0 ], # lower bound on g(x)
30+ l = [- 1 .0 ], # lower bound on g(x)
3131 u = [Inf ], # upper bound on g(x)
3232 eval_f = (ret, xv) -> begin
3333 # ret[1] = g(x)
34- ret[1 ] = - 3 * xv[1 ]^ 2 + 2 * xv[1 ] * xv[2 ] - xv[2 ]^ 2 + 1
34+ ret[1 ] = - 3 * xv[1 ]^ 2 + 2 * xv[1 ] * xv[2 ] - xv[2 ]^ 2
3535 end ,
3636 # Jacobian of g(x): ∇g = [∂g/∂x1, ∂g/∂x2]
3737 # ∂g/∂x1 = -6 x1 + 2 x2
Original file line number Diff line number Diff line change @@ -29,11 +29,11 @@ function hs14_oracle()
2929 # g(x) = -x1^2/4 - x2^2 + 1, 0 ≤ g(x) ≤ +∞
3030 set = MOI. VectorNonlinearOracle (;
3131 dimension = 2 , # 2 inputs: x1, x2
32- l = [0 .0 ], # lower bound on g(x)
32+ l = [- 1 .0 ], # lower bound on g(x)
3333 u = [Inf ], # upper bound on g(x)
3434 eval_f = (ret, xv) -> begin
3535 # ret[1] = g(x)
36- ret[1 ] = - 0.25 * xv[1 ]^ 2 - xv[2 ]^ 2 + 1
36+ ret[1 ] = - 0.25 * xv[1 ]^ 2 - xv[2 ]^ 2
3737 end ,
3838 # Jacobian of g(x): ∇g = [∂g/∂x1, ∂g/∂x2]
3939 # ∂g/∂x1 = -0.5 x1
Original file line number Diff line number Diff line change 2121include (" test_moi_nlp_model.jl" )
2222include (" test_moi_nls_model.jl" )
2323
24+ include (" test_moi_nlp_oracle.jl" )
25+
2426include (" nlp_consistency.jl" )
2527include (" nls_consistency.jl" )
2628
Original file line number Diff line number Diff line change 1616 if m > 0
1717 ncx_no_oracle = cons (nlp_no_oracle, x)
1818 ncx_with_oracle = cons (nlp_with_oracle, x)
19- @test isapprox (ncx_no_oracle, ncx_with_oracle; rtol = 1e-1 )
19+ @test isapprox (ncx_no_oracle, ncx_with_oracle; atol = 1e-8 , rtol = 1e-8 )
2020 end
2121end
You can’t perform that action at this time.
0 commit comments