From 997bb1d44455ba20cc1589b400fe0dfcaa416de3 Mon Sep 17 00:00:00 2001 From: odow Date: Mon, 4 Dec 2023 11:17:06 +1300 Subject: [PATCH] Remove tests for unsupported function \ --- README.md | 14 ++++++-------- src/nlp-expr/005_011.jl | 36 ------------------------------------ src/nlp-mi-expr/005_011.jl | 32 -------------------------------- src/nlp-mi/005_011.jl | 32 -------------------------------- src/nlp/005_011.jl | 36 ------------------------------------ test/runtests.jl | 16 ++++------------ 6 files changed, 10 insertions(+), 156 deletions(-) delete mode 100644 src/nlp-expr/005_011.jl delete mode 100644 src/nlp-mi-expr/005_011.jl delete mode 100644 src/nlp-mi/005_011.jl delete mode 100644 src/nlp/005_011.jl diff --git a/README.md b/README.md index b4469c0..5906f87 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,20 @@ # MINLPTests.jl -This is a collection of JuMP models for testing nonlinear/polynomial solvers +This is a collection of JuMP models for testing nonlinear/polynomial solvers with and without discrete variables in JuMP. -This version is compatible with the current release of JuMP (using +This version is compatible with the current release of JuMP (using MathOptInterface). [![Build Status](https://github.com/jump-dev/MINLPTests.jl/workflows/CI/badge.svg?branch=master)](https://github.com/jump-dev/MINLPTests.jl/actions?query=workflow%3ACI) ## Test Design Guidelines -* The tests are organized into broad categories based on the scope of typical +* The tests are organized into broad categories based on the scope of typical (e.g. continuous, convex functions, polynomial, ...) -* Unit tests for JuMP integration testing should be "easy" models. For example, - it should be possible for a non-global solver to find the global solution in +* Unit tests for JuMP integration testing should be "easy" models. For example, + it should be possible for a non-global solver to find the global solution in these tests -* Mathematical property tests can be more difficult but should strive to be as +* Mathematical property tests can be more difficult but should strive to be as simple as possible ## Test Naming Conventions @@ -71,7 +71,6 @@ z indicates a variant of a base problem * non-linear functions * \* (nlp/004_010) * / (nlp/005_010) - * \ (nlp/005_011) * ^ (nlp/001_010) * sqrt (nlp/003_010) * abs (nlp/004_010) @@ -115,7 +114,6 @@ z indicates a variant of a base problem * non-linear functions * \* (nlp-mi/004_010) * / (nlp-mi/005_010) - * \ (nlp-mi/005_011) * ^ (nlp-mi/001_010) * sqrt (nlp-mi/003_010) * abs (nlp-mi/004_010) diff --git a/src/nlp-expr/005_011.jl b/src/nlp-expr/005_011.jl deleted file mode 100644 index f81a197..0000000 --- a/src/nlp-expr/005_011.jl +++ /dev/null @@ -1,36 +0,0 @@ -# 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_005_011( - optimizer, - objective_tol, - primal_tol, - dual_tol, - termination_target = TERMINATION_TARGET_LOCAL, - primal_target = PRIMAL_TARGET_LOCAL, -) - # Test Goals: - # - function \ - - model = Model(optimizer) - - @variable(model, x >= 0) - @variable(model, y >= 0) - - @objective(model, Min, x + y) - @constraint(model, y >= (x + 0.1) \ 1 - 0.5) - @constraint(model, x >= y^(-2) - 0.5) - @constraint(model, (x + y + 0.1) \ 4 >= 1) - - optimize!(model) - - check_status(model, FEASIBLE_PROBLEM, termination_target, primal_target) - check_objective(model, 1.5449760741521967, tol = objective_tol) - return check_solution( - [x, y], - [0.5848970571378771, 0.9600790170143196], - tol = primal_tol, - ) -end diff --git a/src/nlp-mi-expr/005_011.jl b/src/nlp-mi-expr/005_011.jl deleted file mode 100644 index 0daa261..0000000 --- a/src/nlp-mi-expr/005_011.jl +++ /dev/null @@ -1,32 +0,0 @@ -# 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_mi_expr_005_011( - optimizer, - objective_tol, - primal_tol, - dual_tol, - termination_target = TERMINATION_TARGET_LOCAL, - primal_target = PRIMAL_TARGET_LOCAL, -) - # Test Goals: - # - function \ - - model = Model(optimizer) - - @variable(model, x >= 0, Int) - @variable(model, y >= 0) - - @objective(model, Min, x + y) - @constraint(model, y >= (x + 0.1) \ 1 - 0.5) - @constraint(model, x >= y^(-2) - 0.5) - @constraint(model, (x + y + 0.1) \ 4 >= 1) - - optimize!(model) - - check_status(model, FEASIBLE_PROBLEM, termination_target, primal_target) - check_objective(model, 1.8164965727459055, tol = objective_tol) - return check_solution([x, y], [1, 0.816496581496872], tol = primal_tol) -end diff --git a/src/nlp-mi/005_011.jl b/src/nlp-mi/005_011.jl deleted file mode 100644 index 1a46292..0000000 --- a/src/nlp-mi/005_011.jl +++ /dev/null @@ -1,32 +0,0 @@ -# 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_mi_005_011( - optimizer, - objective_tol, - primal_tol, - dual_tol, - termination_target = TERMINATION_TARGET_LOCAL, - primal_target = PRIMAL_TARGET_LOCAL, -) - # Test Goals: - # - function \ - - model = Model(optimizer) - - @variable(model, x >= 0, Int) - @variable(model, y >= 0) - - @objective(model, Min, x + y) - @NLconstraint(model, y >= (x + 0.1) \ 1 - 0.5) - @NLconstraint(model, x >= y^(-2) - 0.5) - @NLconstraint(model, (x + y + 0.1) \ 4 >= 1) - - optimize!(model) - - check_status(model, FEASIBLE_PROBLEM, termination_target, primal_target) - check_objective(model, 1.8164965727459055, tol = objective_tol) - return check_solution([x, y], [1, 0.816496581496872], tol = primal_tol) -end diff --git a/src/nlp/005_011.jl b/src/nlp/005_011.jl deleted file mode 100644 index 7fd3a0e..0000000 --- a/src/nlp/005_011.jl +++ /dev/null @@ -1,36 +0,0 @@ -# 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_005_011( - optimizer, - objective_tol, - primal_tol, - dual_tol, - termination_target = TERMINATION_TARGET_LOCAL, - primal_target = PRIMAL_TARGET_LOCAL, -) - # Test Goals: - # - function \ - - model = Model(optimizer) - - @variable(model, x >= 0) - @variable(model, y >= 0) - - @objective(model, Min, x + y) - @NLconstraint(model, y >= (x + 0.1) \ 1 - 0.5) - @NLconstraint(model, x >= y^(-2) - 0.5) - @NLconstraint(model, (x + y + 0.1) \ 4 >= 1) - - optimize!(model) - - check_status(model, FEASIBLE_PROBLEM, termination_target, primal_target) - check_objective(model, 1.5449760741521967, tol = objective_tol) - return check_solution( - [x, y], - [0.5848970571378771, 0.9600790170143196], - tol = primal_tol, - ) -end diff --git a/test/runtests.jl b/test/runtests.jl index a5276fd..6761fa3 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -24,23 +24,15 @@ const MIPOLY_SOLVERS = [JUNIPER] @testset "JuMP Model Tests" begin @testset "$(solver): nlp" for solver in NLP_SOLVERS - MINLPTests.test_nlp( - solver, - exclude = ["005_011"], # Uses the function `\` - debug = true, - ) + MINLPTests.test_nlp(solver; debug = true, exclude = ["001_010"]) MINLPTests.test_directory("nlp", solver, include = ["001_010"]) MINLPTests.test_nlp_cvx(solver) - MINLPTests.test_nlp_expr(solver; exclude = ["005_011"]) + MINLPTests.test_nlp_expr(solver) MINLPTests.test_nlp_cvx_expr(solver) end @testset "$(solver): nlp_mi" for solver in MINLP_SOLVERS - MINLPTests.test_nlp_mi(solver, exclude = [ - "005_011", # Uses the function `\` - ]) - MINLPTests.test_nlp_mi_expr(solver, exclude = [ - "005_011", # Uses the function `\` - ]) + MINLPTests.test_nlp_mi(solver) + MINLPTests.test_nlp_mi_expr(solver) MINLPTests.test_nlp_mi_cvx(solver) end @testset "$(solver): poly" for solver in POLY_SOLVERS