diff --git a/src/nlp-expr/009_010.jl b/src/nlp-expr/009_010.jl new file mode 100644 index 0000000..63c984d --- /dev/null +++ b/src/nlp-expr/009_010.jl @@ -0,0 +1,29 @@ +# Copyright (c) 2021 MINLPTests.jl contributors +# +# Use of this source code is governed by an MIT-style license that can be found +# in the LICENSE.md file or at https://opensource.org/licenses/MIT. + +function nlp_expr_009_010( + optimizer, + objective_tol, + primal_tol, + dual_tol, + termination_target = TERMINATION_TARGET_LOCAL, + primal_target = PRIMAL_TARGET_LOCAL, +) + # Test Goals: + # - min support + + model = Model(optimizer) + + @variable(model, x) + + @objective(model, Max, min(0.75 + (x - 0.5)^3, 0.75 - (x - 0.5)^2)) + + optimize!(model) + + check_status(model, FEASIBLE_PROBLEM, termination_target, primal_target) + check_objective(model, 0.75, tol = objective_tol) + check_solution([x], [0.5], tol = primal_tol) + return +end diff --git a/src/nlp-expr/009_011.jl b/src/nlp-expr/009_011.jl new file mode 100644 index 0000000..06c1ac5 --- /dev/null +++ b/src/nlp-expr/009_011.jl @@ -0,0 +1,29 @@ +# Copyright (c) 2021 MINLPTests.jl contributors +# +# Use of this source code is governed by an MIT-style license that can be found +# in the LICENSE.md file or at https://opensource.org/licenses/MIT. + +function nlp_expr_009_011( + optimizer, + objective_tol, + primal_tol, + dual_tol, + termination_target = TERMINATION_TARGET_LOCAL, + primal_target = PRIMAL_TARGET_LOCAL, +) + # Test Goals: + # - max support + + model = Model(optimizer) + + @variable(model, x) + + @objective(model, Min, max(0.75 + (x - 0.5)^3, 0.75 + (x - 0.5)^2)) + + optimize!(model) + + check_status(model, FEASIBLE_PROBLEM, termination_target, primal_target) + check_objective(model, 0.75, tol = objective_tol) + check_solution([x], [0.5], tol = primal_tol) + return +end diff --git a/src/nlp/009_010.jl b/src/nlp/009_010.jl new file mode 100644 index 0000000..37e652f --- /dev/null +++ b/src/nlp/009_010.jl @@ -0,0 +1,29 @@ +# Copyright (c) 2021 MINLPTests.jl contributors +# +# Use of this source code is governed by an MIT-style license that can be found +# in the LICENSE.md file or at https://opensource.org/licenses/MIT. + +function nlp_009_010( + optimizer, + objective_tol, + primal_tol, + dual_tol, + termination_target = TERMINATION_TARGET_LOCAL, + primal_target = PRIMAL_TARGET_LOCAL, +) + # Test Goals: + # - min support + + model = Model(optimizer) + + @variable(model, x) + + @NLobjective(model, Max, min(0.75 + (x - 0.5)^3, 0.75 - (x - 0.5)^2)) + + optimize!(model) + + check_status(model, FEASIBLE_PROBLEM, termination_target, primal_target) + check_objective(model, 0.75, tol = objective_tol) + check_solution([x], [0.5], tol = primal_tol) + return +end diff --git a/src/nlp/009_011.jl b/src/nlp/009_011.jl new file mode 100644 index 0000000..6276b9a --- /dev/null +++ b/src/nlp/009_011.jl @@ -0,0 +1,29 @@ +# Copyright (c) 2021 MINLPTests.jl contributors +# +# Use of this source code is governed by an MIT-style license that can be found +# in the LICENSE.md file or at https://opensource.org/licenses/MIT. + +function nlp_009_011( + optimizer, + objective_tol, + primal_tol, + dual_tol, + termination_target = TERMINATION_TARGET_LOCAL, + primal_target = PRIMAL_TARGET_LOCAL, +) + # Test Goals: + # - max support + + model = Model(optimizer) + + @variable(model, x) + + @NLobjective(model, Min, max(0.75 + (x - 0.5)^3, 0.75 + (x - 0.5)^2)) + + optimize!(model) + + check_status(model, FEASIBLE_PROBLEM, termination_target, primal_target) + check_objective(model, 0.75, tol = objective_tol) + check_solution([x], [0.5], tol = primal_tol) + return +end