From 3e87cd3cbcf5b047d601d02813f622fe991c5aa4 Mon Sep 17 00:00:00 2001 From: Alexis Montoison Date: Fri, 26 Dec 2025 20:33:49 +0100 Subject: [PATCH] Replace @NLconstraint by @constraint --- src/BNST2.jl | 2 +- src/BNST3.jl | 2 +- src/LVcon501.jl | 2 +- src/LVcon502.jl | 2 +- src/LVcon503.jl | 4 ++-- src/LVcon504.jl | 2 +- src/LVcon511.jl | 4 ++-- src/LVcon512.jl | 6 +++--- src/LVcon513.jl | 4 ++-- src/LVcon514.jl | 4 ++-- src/LVcon515.jl | 6 +++--- src/LVcon516.jl | 6 +++--- src/LVcon517.jl | 6 +++--- src/LVcon518.jl | 6 +++--- src/hs06.jl | 2 +- src/hs13.jl | 2 +- src/hs14.jl | 2 +- src/hs16.jl | 4 ++-- src/hs17.jl | 4 ++-- src/hs18.jl | 4 ++-- src/hs20.jl | 6 +++--- src/hs22.jl | 2 +- src/hs23.jl | 8 ++++---- src/hs26.jl | 2 +- src/hs27.jl | 2 +- src/hs30.jl | 2 +- src/hs31.jl | 2 +- src/hs32.jl | 2 +- src/hs42.jl | 2 +- src/hs43.jl | 6 +++--- src/hs46.jl | 4 ++-- src/hs57.jl | 2 +- src/hs60.jl | 2 +- src/hs61.jl | 4 ++-- src/hs65.jl | 2 +- src/hs70.jl | 2 +- src/hs77.jl | 4 ++-- src/hs79.jl | 6 +++--- src/tp216.jl | 2 +- src/tp225.jl | 8 ++++---- src/tp227.jl | 4 ++-- src/tp233.jl | 2 +- src/tp235.jl | 2 +- src/tp249.jl | 2 +- src/tp252.jl | 2 +- src/tp264.jl | 6 +++--- src/tp316to322.jl | 2 +- src/tp323.jl | 2 +- src/tp324.jl | 4 ++-- src/tp326.jl | 4 ++-- src/tp327.jl | 2 +- src/tp337.jl | 2 +- src/tp344and345.jl | 2 +- src/tp355.jl | 2 +- src/tp372.jl | 4 ++-- src/tp373.jl | 2 +- src/tp394and395.jl | 2 +- 57 files changed, 95 insertions(+), 95 deletions(-) diff --git a/src/BNST2.jl b/src/BNST2.jl index d0fb7e9..7811295 100644 --- a/src/BNST2.jl +++ b/src/BNST2.jl @@ -23,7 +23,7 @@ function BNST2(n::Int = 200) model = Model() @variable(model, x[1:n], start = 0.1) @expression(model, F[i = 1:n], x[i]) - @NLconstraint(model, c[j = 1:(n - 1)], x[1] * (x[j + 1] - 1) - 10x[j + 1] == 0) + @constraint(model, c[j = 1:(n - 1)], x[1] * (x[j + 1] - 1) - 10x[j + 1] == 0) return MathOptNLSModel(model, F, name = "BNST2") end diff --git a/src/BNST3.jl b/src/BNST3.jl index e801cd1..083b654 100644 --- a/src/BNST3.jl +++ b/src/BNST3.jl @@ -28,7 +28,7 @@ function BNST3(n::Int = 200) model = Model() @variable(model, x[1:n], start = 0.1) @expression(model, F[i = 1:n], x[i]) - @NLconstraint(model, c[j = 1:N], x[j] * (x[N + j] - 1) - 10x[N + j] == 0) + @constraint(model, c[j = 1:N], x[j] * (x[N + j] - 1) - 10x[N + j] == 0) return MathOptNLSModel(model, F, name = "BNST3") end diff --git a/src/LVcon501.jl b/src/LVcon501.jl index b197fdb..066f1e0 100644 --- a/src/LVcon501.jl +++ b/src/LVcon501.jl @@ -24,7 +24,7 @@ function LVcon501(n::Int = 20) @variable(model, x[i = 1:n], start = (i % 2 == 1 ? -1.2 : 1.0)) @NLexpression(model, F1[i = 1:(n - 1)], 10 * (x[i]^2 - x[i + 1])) @expression(model, F2[i = 1:(n - 1)], x[i] - 1.0) - @NLconstraint( + @constraint( model, c[k = 1:(n - 2)], 3 * x[k + 1]^3 + 2 * x[k + 2] - 5 + diff --git a/src/LVcon502.jl b/src/LVcon502.jl index aad6fe6..982e9be 100644 --- a/src/LVcon502.jl +++ b/src/LVcon502.jl @@ -35,7 +35,7 @@ function LVcon502(n::Int = 20) @expression(model, F4[i = 1:N], x[2i + 1] - 1) @expression(model, F5[i = 1:N], s * (x[2i] + x[2i + 2] - 2)) @expression(model, F6[i = 1:N], (x[2i] - x[2i + 2]) / s) - @NLconstraint( + @constraint( model, c[k = 1:(n - 7)], (2 + 5 * x[k + 5]^2) * x[k + 5] + 1.0 + sum(x[i] * (1 + x[i]) for i = max(k - 5, 1):(k + 1)) == diff --git a/src/LVcon503.jl b/src/LVcon503.jl index d773d8a..eebf45d 100644 --- a/src/LVcon503.jl +++ b/src/LVcon503.jl @@ -34,8 +34,8 @@ function LVcon503(n::Int = 20) @expression(model, F2[i = 1:N], sqrt(5) * (x[2i + 1] - x[2i + 2])) @NLexpression(model, F3[i = 1:N], (x[2i] - 2 * x[2i + 1])^2) @NLexpression(model, F4[i = 1:N], sqrt(10) * (x[2i - 1] - x[2i + 2])^2) - @NLconstraint(model, 3 * x[1]^3 + 2 * x[2] + sin(x[1] - x[2]) * sin(x[1] + x[2]) == 5) - @NLconstraint(model, 4 * x[n] - x[n - 1] * exp(x[n - 1] - x[n]) == 3) + @constraint(model, 3 * x[1]^3 + 2 * x[2] + sin(x[1] - x[2]) * sin(x[1] + x[2]) == 5) + @constraint(model, 4 * x[n] - x[n - 1] * exp(x[n - 1] - x[n]) == 3) return MathOptNLSModel(model, [F1; F2; F3; F4], name = "Lukšan-Vlček 5.3") end diff --git a/src/LVcon504.jl b/src/LVcon504.jl index 6a8294f..51a8d32 100644 --- a/src/LVcon504.jl +++ b/src/LVcon504.jl @@ -32,7 +32,7 @@ function LVcon504(n::Int = 20) @NLexpression(model, F3[i = 1:N], tan(x[2i + 1] - x[2i + 2])^2) @NLexpression(model, F4[i = 1:N], x[2i - 1]^4) @expression(model, F5[i = 1:N], x[2i + 2] - 1) - @NLconstraint( + @constraint( model, c[k = 1:(n - 2)], 8 * x[k + 1] * (x[k + 1]^2 - x[k]) - 2 * (1 - x[k + 1]) + 4 * (x[k + 1] - x[k + 2]^2) == 0.0 diff --git a/src/LVcon511.jl b/src/LVcon511.jl index 25076d0..262654b 100644 --- a/src/LVcon511.jl +++ b/src/LVcon511.jl @@ -35,9 +35,9 @@ function LVcon511(n::Int = 20) for k = 1:(2N) ℓ = 3 * div(k - 1, 2) if k % 2 == 1 - @NLconstraint(model, x[ℓ + 1]^2 * x[ℓ + 4] + sin(x[ℓ + 4] - x[ℓ + 5]) == 1) + @constraint(model, x[ℓ + 1]^2 * x[ℓ + 4] + sin(x[ℓ + 4] - x[ℓ + 5]) == 1) else - @NLconstraint(model, x[ℓ + 2] + x[ℓ + 3]^4 * x[ℓ + 4]^2 == 2) + @constraint(model, x[ℓ + 2] + x[ℓ + 3]^4 * x[ℓ + 4]^2 == 2) end end diff --git a/src/LVcon512.jl b/src/LVcon512.jl index f66e01d..97febe7 100644 --- a/src/LVcon512.jl +++ b/src/LVcon512.jl @@ -36,11 +36,11 @@ function LVcon512(n::Int = 21) for k = 1:(3N) ℓ = 4 * div(k - 1, 3) if k % 3 == 1 - @NLconstraint(model, x[ℓ + 1] + x[ℓ + 2]^2 + x[ℓ + 3]^2 == 3) + @constraint(model, x[ℓ + 1] + x[ℓ + 2]^2 + x[ℓ + 3]^2 == 3) elseif k % 3 == 2 - @NLconstraint(model, x[ℓ + 2] + x[ℓ + 3]^2 + x[ℓ + 4] == 1) + @constraint(model, x[ℓ + 2] + x[ℓ + 3]^2 + x[ℓ + 4] == 1) else - @NLconstraint(model, x[ℓ + 1] * x[ℓ + 5] == 1) + @constraint(model, x[ℓ + 1] * x[ℓ + 5] == 1) end end diff --git a/src/LVcon513.jl b/src/LVcon513.jl index ebb05f4..eb35bae 100644 --- a/src/LVcon513.jl +++ b/src/LVcon513.jl @@ -35,9 +35,9 @@ function LVcon513(n::Int = 20) for k = 1:(2N) ℓ = 3 * div(k - 1, 2) if k % 2 == 1 - @NLconstraint(model, x[ℓ + 1] + x[ℓ + 2]^2 + x[ℓ + 3] + x[ℓ + 4] + x[ℓ + 5] == 5) + @constraint(model, x[ℓ + 1] + x[ℓ + 2]^2 + x[ℓ + 3] + x[ℓ + 4] + x[ℓ + 5] == 5) else - @NLconstraint(model, x[ℓ + 3]^2 - 2 * (x[ℓ + 4] + x[ℓ + 5]) == 3) + @constraint(model, x[ℓ + 3]^2 - 2 * (x[ℓ + 4] + x[ℓ + 5]) == 3) end end diff --git a/src/LVcon514.jl b/src/LVcon514.jl index 9a32dfb..2042b18 100644 --- a/src/LVcon514.jl +++ b/src/LVcon514.jl @@ -36,9 +36,9 @@ function LVcon514(n::Int = 20) for k = 1:(2N) ℓ = 3 * div(k - 1, 2) if k % 2 == 1 - @NLconstraint(model, x[ℓ + 1]^2 + x[ℓ + 2] + x[ℓ + 3] + 4 * x[ℓ + 4] == 7) + @constraint(model, x[ℓ + 1]^2 + x[ℓ + 2] + x[ℓ + 3] + 4 * x[ℓ + 4] == 7) else - @NLconstraint(model, x[ℓ + 3]^2 - 5 * x[ℓ + 5] == 6) + @constraint(model, x[ℓ + 3]^2 - 5 * x[ℓ + 5] == 6) end end diff --git a/src/LVcon515.jl b/src/LVcon515.jl index 419b0cc..4535520 100644 --- a/src/LVcon515.jl +++ b/src/LVcon515.jl @@ -36,11 +36,11 @@ function LVcon515(n::Int = 21) for k = 1:(3N) ℓ = 4 * div(k - 1, 3) if k % 3 == 1 - @NLconstraint(model, x[ℓ + 1]^2 + 2 * x[ℓ + 2] + 3 * x[ℓ + 3] == 6) + @constraint(model, x[ℓ + 1]^2 + 2 * x[ℓ + 2] + 3 * x[ℓ + 3] == 6) elseif k % 3 == 2 - @NLconstraint(model, x[ℓ + 2]^2 + 2 * x[ℓ + 3] + 3 * x[ℓ + 4] == 6) + @constraint(model, x[ℓ + 2]^2 + 2 * x[ℓ + 3] + 3 * x[ℓ + 4] == 6) else - @NLconstraint(model, x[ℓ + 3]^2 + 2 * x[ℓ + 4] + 3 * x[ℓ + 5] == 6) + @constraint(model, x[ℓ + 3]^2 + 2 * x[ℓ + 4] + 3 * x[ℓ + 5] == 6) end end diff --git a/src/LVcon516.jl b/src/LVcon516.jl index 5b27565..5afd8dd 100644 --- a/src/LVcon516.jl +++ b/src/LVcon516.jl @@ -36,11 +36,11 @@ function LVcon516(n::Int = 21) for k = 1:(3N) ℓ = 4 * div(k - 1, 3) if k % 3 == 1 - @NLconstraint(model, x[ℓ + 1]^2 + 3 * x[ℓ + 2] == 4) + @constraint(model, x[ℓ + 1]^2 + 3 * x[ℓ + 2] == 4) elseif k % 3 == 2 - @NLconstraint(model, x[ℓ + 3]^2 + x[ℓ + 4] - 2 * x[ℓ + 5] == 0) + @constraint(model, x[ℓ + 3]^2 + x[ℓ + 4] - 2 * x[ℓ + 5] == 0) else - @NLconstraint(model, x[ℓ + 2]^2 - x[ℓ + 5] == 0) + @constraint(model, x[ℓ + 2]^2 - x[ℓ + 5] == 0) end end diff --git a/src/LVcon517.jl b/src/LVcon517.jl index be6c51e..a5734b3 100644 --- a/src/LVcon517.jl +++ b/src/LVcon517.jl @@ -35,11 +35,11 @@ function LVcon517(n::Int = 21) for k = 1:(3N) ℓ = 4 * div(k - 1, 3) if k % 3 == 1 - @NLconstraint(model, x[ℓ + 1]^2 + 3 * x[ℓ + 2] == 0) + @constraint(model, x[ℓ + 1]^2 + 3 * x[ℓ + 2] == 0) elseif k % 3 == 2 - @NLconstraint(model, x[ℓ + 3]^2 + x[ℓ + 4] - 2 * x[ℓ + 5] == 0) + @constraint(model, x[ℓ + 3]^2 + x[ℓ + 4] - 2 * x[ℓ + 5] == 0) else - @NLconstraint(model, x[ℓ + 2]^2 - x[ℓ + 5] == 0) + @constraint(model, x[ℓ + 2]^2 - x[ℓ + 5] == 0) end end diff --git a/src/LVcon518.jl b/src/LVcon518.jl index 31e4369..6c3f5c9 100644 --- a/src/LVcon518.jl +++ b/src/LVcon518.jl @@ -35,11 +35,11 @@ function LVcon518(n::Int = 21) for k = 1:(3N) ℓ = 4 * div(k - 1, 3) if k % 3 == 1 - @NLconstraint(model, x[ℓ + 1]^2 + 3 * x[ℓ + 2] == 0) + @constraint(model, x[ℓ + 1]^2 + 3 * x[ℓ + 2] == 0) elseif k % 3 == 2 - @NLconstraint(model, x[ℓ + 3]^2 + x[ℓ + 4] - 2 * x[ℓ + 5] == 0) + @constraint(model, x[ℓ + 3]^2 + x[ℓ + 4] - 2 * x[ℓ + 5] == 0) else - @NLconstraint(model, x[ℓ + 2]^2 - x[ℓ + 5] == 0) + @constraint(model, x[ℓ + 2]^2 - x[ℓ + 5] == 0) end end diff --git a/src/hs06.jl b/src/hs06.jl index 4f0255d..65f1545 100644 --- a/src/hs06.jl +++ b/src/hs06.jl @@ -17,7 +17,7 @@ function hs06(args...) @variable(model, x[1:2]) set_start_value.(x, [-1.2; 1.0]) @expression(model, F, 1.0 - x[1]) - @NLconstraint(model, 10 * (x[2] - x[1]^2) == 0) + @constraint(model, 10 * (x[2] - x[1]^2) == 0) return MathOptNLSModel(model, [F], name = "hs06") end diff --git a/src/hs13.jl b/src/hs13.jl index 28b624b..6f962b6 100644 --- a/src/hs13.jl +++ b/src/hs13.jl @@ -17,7 +17,7 @@ function hs13(args...) @variable(model, x[1:2] ≥ 0.0, start = -2.0) @expression(model, F1, x[1] - 2) @expression(model, F2, x[2]) - @NLconstraint(model, (1 - x[1])^3 - x[2] ≥ 0.0) + @constraint(model, (1 - x[1])^3 - x[2] ≥ 0.0) return MathOptNLSModel(model, [F1; F2], name = "hs13") end diff --git a/src/hs14.jl b/src/hs14.jl index 61d6570..eee6349 100644 --- a/src/hs14.jl +++ b/src/hs14.jl @@ -17,7 +17,7 @@ function hs14(args...) @variable(model, x[1:2], start = 2.0) @expression(model, F1, x[1] - 2) @expression(model, F2, x[2] - 1) - @NLconstraint(model, -0.25 * x[1]^2 - x[2]^2 + 1.0 ≥ 0.0) + @constraint(model, -0.25 * x[1]^2 - x[2]^2 + 1.0 ≥ 0.0) @constraint(model, x[1] - 2 * x[2] == -1.0) return MathOptNLSModel(model, [F1; F2], name = "hs14") diff --git a/src/hs16.jl b/src/hs16.jl index b9db4be..ad9dd95 100644 --- a/src/hs16.jl +++ b/src/hs16.jl @@ -20,8 +20,8 @@ function hs16(args...) set_start_value.(x, [-2.0; 1.0]) @NLexpression(model, F1, 10 * (x[2] - x[1]^2)) @expression(model, F2, 1 - x[1]) - @NLconstraint(model, x[1] + x[2]^2 ≥ 0.0) - @NLconstraint(model, x[1]^2 + x[2] ≥ 0.0) + @constraint(model, x[1] + x[2]^2 ≥ 0.0) + @constraint(model, x[1]^2 + x[2] ≥ 0.0) return MathOptNLSModel(model, [F1; F2], name = "hs16") end diff --git a/src/hs17.jl b/src/hs17.jl index 6256348..260fbf1 100644 --- a/src/hs17.jl +++ b/src/hs17.jl @@ -20,8 +20,8 @@ function hs17(args...) set_start_value.(x, [-2.0; 1.0]) @NLexpression(model, F1, 10 * (x[2] - x[1]^2)) @expression(model, F2, 1 - x[1]) - @NLconstraint(model, x[2]^2 - x[1] ≥ 0.0) - @NLconstraint(model, x[1]^2 - x[2] ≥ 0.0) + @constraint(model, x[2]^2 - x[1] ≥ 0.0) + @constraint(model, x[1]^2 - x[2] ≥ 0.0) return MathOptNLSModel(model, [F1; F2], name = "hs17") end diff --git a/src/hs18.jl b/src/hs18.jl index 49b5f0c..6b2e1bf 100644 --- a/src/hs18.jl +++ b/src/hs18.jl @@ -19,8 +19,8 @@ function hs18(args...) @variable(model, lvar[i] ≤ x[i = 1:2] ≤ uvar[i], start = 2.0) @expression(model, F1, 0.1 * x[1]) @expression(model, F2, x[2]) - @NLconstraint(model, x[1] * x[2] ≥ 25) - @NLconstraint(model, x[1]^2 + x[2]^2 ≥ 25) + @constraint(model, x[1] * x[2] ≥ 25) + @constraint(model, x[1]^2 + x[2]^2 ≥ 25) return MathOptNLSModel(model, [F1; F2], name = "hs18") end diff --git a/src/hs20.jl b/src/hs20.jl index a67fd52..3709ac8 100644 --- a/src/hs20.jl +++ b/src/hs20.jl @@ -20,9 +20,9 @@ function hs20(args...) set_start_value.(x, [-2.0; 1.0]) @NLexpression(model, F1, 10 * (x[2] - x[1]^2)) @expression(model, F2, 1 - x[1]) - @NLconstraint(model, x[1] + x[2]^2 ≥ 0.0) - @NLconstraint(model, x[1]^2 + x[2] ≥ 0.0) - @NLconstraint(model, x[1]^2 + x[2]^2 ≥ 1) + @constraint(model, x[1] + x[2]^2 ≥ 0.0) + @constraint(model, x[1]^2 + x[2] ≥ 0.0) + @constraint(model, x[1]^2 + x[2]^2 ≥ 1) return MathOptNLSModel(model, [F1; F2], name = "hs20") end diff --git a/src/hs22.jl b/src/hs22.jl index 314e1d5..5ffb12d 100644 --- a/src/hs22.jl +++ b/src/hs22.jl @@ -18,7 +18,7 @@ function hs22(args...) @expression(model, F1, x[1] - 2.0) @expression(model, F2, x[2] - 1.0) @constraint(model, -x[1] - x[2] + 2 ≥ 0) - @NLconstraint(model, -x[1]^2 + x[2] ≥ 0) + @constraint(model, -x[1]^2 + x[2] ≥ 0) return MathOptNLSModel(model, [F1; F2], name = "hs22") end diff --git a/src/hs23.jl b/src/hs23.jl index 9ae4afc..df286d9 100644 --- a/src/hs23.jl +++ b/src/hs23.jl @@ -18,10 +18,10 @@ function hs23(args...) set_start_value.(x, [3.0; 1.0]) @expression(model, F[i = 1:2], x[i]) @constraint(model, x[1] + x[2] ≥ 0) - @NLconstraint(model, x[1]^2 + x[2]^2 ≥ 1) - @NLconstraint(model, 9 * x[1]^2 + x[2]^2 ≥ 9) - @NLconstraint(model, x[1]^2 - x[2] ≥ 0) - @NLconstraint(model, x[2]^2 - x[1] ≥ 0) + @constraint(model, x[1]^2 + x[2]^2 ≥ 1) + @constraint(model, 9 * x[1]^2 + x[2]^2 ≥ 9) + @constraint(model, x[1]^2 - x[2] ≥ 0) + @constraint(model, x[2]^2 - x[1] ≥ 0) return MathOptNLSModel(model, F, name = "hs23") end diff --git a/src/hs26.jl b/src/hs26.jl index 1dea7af..2de8d71 100644 --- a/src/hs26.jl +++ b/src/hs26.jl @@ -18,7 +18,7 @@ function hs26(args...) set_start_value.(x, [-2.6; 2.0; 2.0]) @expression(model, F1, x[1] - x[2]) @NLexpression(model, F2, (x[2] - x[3])^2) - @NLconstraint(model, (1 + x[2]^2) * x[1] + x[3]^4 == 3) + @constraint(model, (1 + x[2]^2) * x[1] + x[3]^4 == 3) return MathOptNLSModel(model, [F1; F2], name = "hs26") end diff --git a/src/hs27.jl b/src/hs27.jl index 230fafe..5627b2e 100644 --- a/src/hs27.jl +++ b/src/hs27.jl @@ -17,7 +17,7 @@ function hs27(args...) @variable(model, x[1:3], start = 2.0) @expression(model, F1, 0.1 * (x[1] - 1)) @NLexpression(model, F2, x[2] - x[1]^2) - @NLconstraint(model, x[1] + x[3]^2 == -1) + @constraint(model, x[1] + x[3]^2 == -1) return MathOptNLSModel(model, [F1; F2], name = "hs27") end diff --git a/src/hs30.jl b/src/hs30.jl index 981ffa1..e792a83 100644 --- a/src/hs30.jl +++ b/src/hs30.jl @@ -17,7 +17,7 @@ function hs30(args...) lvar = [1.0; -10.0; -10.0] @variable(model, lvar[i] ≤ x[i = 1:3] ≤ 10, start = 1.0) @expression(model, F[i = 1:3], x[i]) - @NLconstraint(model, x[1]^2 + x[2]^2 ≥ 1.0) + @constraint(model, x[1]^2 + x[2]^2 ≥ 1.0) return MathOptNLSModel(model, F, name = "hs30") end diff --git a/src/hs31.jl b/src/hs31.jl index b89e284..0560b47 100644 --- a/src/hs31.jl +++ b/src/hs31.jl @@ -20,7 +20,7 @@ function hs31(args...) @expression(model, F1, 3.0 * x[1]) @expression(model, F2, x[2]) @expression(model, F3, 3.0 * x[3]) - @NLconstraint(model, x[1] * x[2] ≥ 1) + @constraint(model, x[1] * x[2] ≥ 1) return MathOptNLSModel(model, [F1; F2; F3], name = "hs31") end diff --git a/src/hs32.jl b/src/hs32.jl index 6b1454a..bcc09c8 100644 --- a/src/hs32.jl +++ b/src/hs32.jl @@ -18,7 +18,7 @@ function hs32(args...) set_start_value.(x, [0.1; 0.7; 0.2]) @expression(model, F1, x[1] + 3 * x[2] + x[3]) @expression(model, F2, 2 * (x[1] - x[2])) - @NLconstraint(model, 6 * x[2] + 4 * x[3] - x[1]^3 ≥ 3.0) + @constraint(model, 6 * x[2] + 4 * x[3] - x[1]^3 ≥ 3.0) @constraint(model, 1.0 - x[1] - x[2] - x[3] == 0.0) return MathOptNLSModel(model, [F1; F2], name = "hs32") diff --git a/src/hs42.jl b/src/hs42.jl index e25fb71..62b3700 100644 --- a/src/hs42.jl +++ b/src/hs42.jl @@ -17,7 +17,7 @@ function hs42(args...) @variable(model, x[1:4], start = 1.0) @expression(model, F[i = 1:4], x[i] - i) @constraint(model, x[1] == 2.0) - @NLconstraint(model, x[3]^2 + x[4]^2 == 2.0) + @constraint(model, x[3]^2 + x[4]^2 == 2.0) return MathOptNLSModel(model, F, name = "hs42") end diff --git a/src/hs43.jl b/src/hs43.jl index 9e4b5ff..fa3d9eb 100644 --- a/src/hs43.jl +++ b/src/hs43.jl @@ -19,9 +19,9 @@ function hs43(args...) @expression(model, F2, x[2] - 5 / 2) @expression(model, F3, sqrt(2) * (x[3] - 21 / 4)) @expression(model, F4, x[4] + 7 / 2) - @NLconstraint(model, 8 - x[1]^2 - x[2]^2 - x[3]^2 - x[4]^2 - x[1] + x[2] - x[3] + x[4] ≥ 0.0) - @NLconstraint(model, 10 - x[1]^2 - 2 * x[2]^2 - x[3]^2 - 2 * x[4]^2 + x[1] + x[4] ≥ 0.0) - @NLconstraint(model, 5 - 2 * x[1]^2 - x[2]^2 - x[3]^2 - 2 * x[1] + x[2] + x[4] ≥ 0.0) + @constraint(model, 8 - x[1]^2 - x[2]^2 - x[3]^2 - x[4]^2 - x[1] + x[2] - x[3] + x[4] ≥ 0.0) + @constraint(model, 10 - x[1]^2 - 2 * x[2]^2 - x[3]^2 - 2 * x[4]^2 + x[1] + x[4] ≥ 0.0) + @constraint(model, 5 - 2 * x[1]^2 - x[2]^2 - x[3]^2 - 2 * x[1] + x[2] + x[4] ≥ 0.0) return MathOptNLSModel(model, [F1; F2; F3; F4], name = "hs43") end diff --git a/src/hs46.jl b/src/hs46.jl index 30c67a7..08bd015 100644 --- a/src/hs46.jl +++ b/src/hs46.jl @@ -23,8 +23,8 @@ function hs46(args...) @expression(model, F2, x[3] - 1.0) @NLexpression(model, F3, (x[4] - 1.0)^2) @NLexpression(model, F4, (x[5] - 1.0)^3) - @NLconstraint(model, x[1]^2 * x[4] + sin(x[4] - x[5]) == 1.0) - @NLconstraint(model, x[2] + x[3]^4 * x[4]^2 == 2.0) + @constraint(model, x[1]^2 * x[4] + sin(x[4] - x[5]) == 1.0) + @constraint(model, x[2] + x[3]^4 * x[4]^2 == 2.0) return MathOptNLSModel(model, [F1; F2; F3; F4], name = "hs46") end diff --git a/src/hs57.jl b/src/hs57.jl index e3fa330..7b172e7 100644 --- a/src/hs57.jl +++ b/src/hs57.jl @@ -111,7 +111,7 @@ function hs57(args...) @variable(model, lvar[i] ≤ x[i = 1:2] ≤ uvar[i]) set_start_value.(x, [0.42; 5.0]) @NLexpression(model, F[i = 1:44], b[i] - x[1] - (0.49 - x[1]) * exp(-x[2] * (a[i] - 8))) - @NLconstraint(model, 0.49 * x[2] - x[1] * x[2] ≥ 0.09) + @constraint(model, 0.49 * x[2] - x[1] * x[2] ≥ 0.09) return MathOptNLSModel(model, F, name = "hs57") end diff --git a/src/hs60.jl b/src/hs60.jl index 000c72a..25f23d4 100644 --- a/src/hs60.jl +++ b/src/hs60.jl @@ -18,7 +18,7 @@ function hs60(args...) @expression(model, F1, x[1] - 1) @expression(model, F2, x[1] - x[2]) @NLexpression(model, F3, (x[2] - x[3])^2) - @NLconstraint(model, x[1] * (1 + x[2]^2) + x[3]^4 == 4 + 3 * sqrt(2)) + @constraint(model, x[1] * (1 + x[2]^2) + x[3]^4 == 4 + 3 * sqrt(2)) return MathOptNLSModel(model, [F1; F2; F3], name = "hs60") end diff --git a/src/hs61.jl b/src/hs61.jl index d3f68ac..8fa0c97 100644 --- a/src/hs61.jl +++ b/src/hs61.jl @@ -18,8 +18,8 @@ function hs61(args...) @expression(model, F1, 2 * (x[1] - 33 / 8)) @expression(model, F2, sqrt(2) * (x[2] + 4)) @expression(model, F3, sqrt(2) * (x[3] - 6)) - @NLconstraint(model, 3 * x[1] - 2 * x[2]^2 == 7) - @NLconstraint(model, 4 * x[1] - 3 * x[3]^2 == 11) + @constraint(model, 3 * x[1] - 2 * x[2]^2 == 7) + @constraint(model, 4 * x[1] - 3 * x[3]^2 == 11) return MathOptNLSModel(model, [F1; F2; F3], name = "hs61") end diff --git a/src/hs65.jl b/src/hs65.jl index a005818..f69935b 100644 --- a/src/hs65.jl +++ b/src/hs65.jl @@ -20,7 +20,7 @@ function hs65(args...) @expression(model, F1, x[1] - x[2]) @expression(model, F2, (x[1] + x[2] - 10) / 3) @expression(model, F3, x[3] - 5) - @NLconstraint(model, 48 - x[1]^2 - x[2]^2 - x[3]^2 == 0) + @constraint(model, 48 - x[1]^2 - x[2]^2 - x[3]^2 == 0) return MathOptNLSModel(model, [F1; F2; F3], name = "hs65") end diff --git a/src/hs70.jl b/src/hs70.jl index 9b311c3..dbd1ea0 100644 --- a/src/hs70.jl +++ b/src/hs70.jl @@ -59,7 +59,7 @@ function hs70(args...) ) @NLexpression(nls, F[i = 1:19], ycal[i] - yobs[i]) - @NLconstraint(nls, b ≥ 0) + @constraint(nls, b ≥ 0) return MathOptNLSModel(nls, F, name = "hs70") end diff --git a/src/hs77.jl b/src/hs77.jl index 2eeb4df..5d75325 100644 --- a/src/hs77.jl +++ b/src/hs77.jl @@ -20,8 +20,8 @@ function hs77(args...) @expression(model, F3, x[3] - 1) @NLexpression(model, F4, (x[4] - 1)^2) @NLexpression(model, F5, (x[5] - 1)^3) - @NLconstraint(model, x[1]^2 * x[4] + sin(x[4] - x[5]) == 2 * sqrt(2)) - @NLconstraint(model, x[2] + x[3]^4 * x[4]^2 == 8 + sqrt(2)) + @constraint(model, x[1]^2 * x[4] + sin(x[4] - x[5]) == 2 * sqrt(2)) + @constraint(model, x[2] + x[3]^4 * x[4]^2 == 8 + sqrt(2)) return MathOptNLSModel(model, [F1; F2; F3; F4; F5], name = "hs77") end diff --git a/src/hs79.jl b/src/hs79.jl index da10d15..8f96a6b 100644 --- a/src/hs79.jl +++ b/src/hs79.jl @@ -20,9 +20,9 @@ function hs79(args...) @expression(model, F3, x[2] - x[3]) @NLexpression(model, F4, (x[3] - x[4])^2) @NLexpression(model, F5, (x[4] - x[5])^2) - @NLconstraint(model, x[1] + x[2]^2 + x[3]^3 == 2 + 3 * sqrt(2)) - @NLconstraint(model, x[2] - x[3]^2 + x[4] == -2 + 2 * sqrt(2)) - @NLconstraint(model, x[1] * x[5] == 2) + @constraint(model, x[1] + x[2]^2 + x[3]^3 == 2 + 3 * sqrt(2)) + @constraint(model, x[2] - x[3]^2 + x[4] == -2 + 2 * sqrt(2)) + @constraint(model, x[1] * x[5] == 2) return MathOptNLSModel(model, [F1; F2; F3; F4; F5], name = "hs79") end diff --git a/src/tp216.jl b/src/tp216.jl index 80cee10..2ffa531 100644 --- a/src/tp216.jl +++ b/src/tp216.jl @@ -20,7 +20,7 @@ function tp216(args...) @NLexpression(nls, F1, 10 * (x[1]^2 - x[2])) @expression(nls, F2, x[1] - 1) - @NLconstraint(nls, x[1] * (x[1] - 4) - 2 * x[2] + 12 == 0) + @constraint(nls, x[1] * (x[1] - 4) - 2 * x[2] + 12 == 0) return MathOptNLSModel(nls, [F1; F2], name = "tp216") end diff --git a/src/tp225.jl b/src/tp225.jl index 34bc0f1..203406d 100644 --- a/src/tp225.jl +++ b/src/tp225.jl @@ -21,10 +21,10 @@ function tp225(args...) @expression(nls, F2, 1 * x[2]) @constraint(nls, x[1] + x[2] - 1 ≥ 0) - @NLconstraint(nls, x[1]^2 + x[2]^2 - 1 ≥ 0) - @NLconstraint(nls, 9 * x[1]^2 + x[2]^2 - 9 ≥ 0) - @NLconstraint(nls, x[1]^2 - x[2] ≥ 0) - @NLconstraint(nls, x[2]^2 - x[1] ≥ 0) + @constraint(nls, x[1]^2 + x[2]^2 - 1 ≥ 0) + @constraint(nls, 9 * x[1]^2 + x[2]^2 - 9 ≥ 0) + @constraint(nls, x[1]^2 - x[2] ≥ 0) + @constraint(nls, x[2]^2 - x[1] ≥ 0) return MathOptNLSModel(nls, [F1; F2], name = "tp225") end diff --git a/src/tp227.jl b/src/tp227.jl index c559a09..e409d9d 100644 --- a/src/tp227.jl +++ b/src/tp227.jl @@ -20,8 +20,8 @@ function tp227(args...) @expression(nls, F1, x[1] - 2) @expression(nls, F2, x[2] - 1) - @NLconstraint(nls, x[2] - x[1]^2 ≥ 0) - @NLconstraint(nls, x[1] - x[2]^2 ≥ 0) + @constraint(nls, x[2] - x[1]^2 ≥ 0) + @constraint(nls, x[1] - x[2]^2 ≥ 0) return MathOptNLSModel(nls, [F1; F2], name = "tp227") end diff --git a/src/tp233.jl b/src/tp233.jl index dc74086..990e0b3 100644 --- a/src/tp233.jl +++ b/src/tp233.jl @@ -20,7 +20,7 @@ function tp233(args...) @NLexpression(nls, F1, 10 * (x[2] - x[1]^2)) @expression(nls, F2, 1 - x[1]) - @NLconstraint(nls, x[1]^2 + x[2]^2 - 0.25 ≥ 0) + @constraint(nls, x[1]^2 + x[2]^2 - 0.25 ≥ 0) return MathOptNLSModel(nls, [F1; F2], name = "tp233") end diff --git a/src/tp235.jl b/src/tp235.jl index c021bb5..cd0fba6 100644 --- a/src/tp235.jl +++ b/src/tp235.jl @@ -20,7 +20,7 @@ function tp235(args...) @expression(nls, F1, 0.1 * (x[1] - 1)) @NLexpression(nls, F2, x[2] - x[1]^2) - @NLconstraint(nls, x[1] + x[3]^2 + 1 == 0) + @constraint(nls, x[1] + x[3]^2 + 1 == 0) return MathOptNLSModel(nls, [F1; F2], name = "tp235") end diff --git a/src/tp249.jl b/src/tp249.jl index c9e3791..0812f89 100644 --- a/src/tp249.jl +++ b/src/tp249.jl @@ -19,7 +19,7 @@ function tp249(args...) @expression(nls, F[i = 1:3], x[i]) - @NLconstraint(nls, x[1]^2 + x[2]^2 - 1 ≥ 0) + @constraint(nls, x[1]^2 + x[2]^2 - 1 ≥ 0) return MathOptNLSModel(nls, F, name = "tp249") end diff --git a/src/tp252.jl b/src/tp252.jl index d2bcb3d..a1be9bf 100644 --- a/src/tp252.jl +++ b/src/tp252.jl @@ -21,7 +21,7 @@ function tp252(args...) @expression(nls, F1, 0.1 * (x[1] - 1)) @NLexpression(nls, F2, x[2] - x[1]^2) - @NLconstraint(nls, x[1] + x[3]^2 + 1 == 0) + @constraint(nls, x[1] + x[3]^2 + 1 == 0) return MathOptNLSModel(nls, [F1; F2], name = "tp252") end diff --git a/src/tp264.jl b/src/tp264.jl index 633c517..0aae0d6 100644 --- a/src/tp264.jl +++ b/src/tp264.jl @@ -21,8 +21,8 @@ function tp264(args...) @expression(nls, F3, 2 * (x[3] - 21 / 4)) @expression(nls, F4, x[4] + 7 / 2) - @NLconstraint(nls, -x[1]^2 - x[2]^2 - x[3]^2 - x[4]^2 - x[1] + x[2] + x[3] + x[4] + 8 ≥ 0) - @NLconstraint(nls, -x[1]^2 - 2 * x[2]^2 - x[3]^2 - 2 * x[4]^2 + x[1] + x[4] + 9 ≥ 0) - @NLconstraint(nls, -2 * x[1]^2 - x[2]^2 - x[3]^2 - 2 * x[1] + x[2] + x[4] + 5 ≥ 0) + @constraint(nls, -x[1]^2 - x[2]^2 - x[3]^2 - x[4]^2 - x[1] + x[2] + x[3] + x[4] + 8 ≥ 0) + @constraint(nls, -x[1]^2 - 2 * x[2]^2 - x[3]^2 - 2 * x[4]^2 + x[1] + x[4] + 9 ≥ 0) + @constraint(nls, -2 * x[1]^2 - x[2]^2 - x[3]^2 - 2 * x[1] + x[2] + x[4] + 5 ≥ 0) return MathOptNLSModel(nls, [F1; F2; F3; F4], name = "tp264") end diff --git a/src/tp316to322.jl b/src/tp316to322.jl index 5d08092..6780615 100644 --- a/src/tp316to322.jl +++ b/src/tp316to322.jl @@ -19,7 +19,7 @@ function tp316(args...; d::Real = 100, version::String = "tp316") @expression(nls, F1, x[1] - 20) @expression(nls, F2, x[2] + 20) - @NLconstraint(nls, x[1]^2 / 100 + x[2]^2 / d - 1 == 0) + @constraint(nls, x[1]^2 / 100 + x[2]^2 / d - 1 == 0) return MathOptNLSModel(nls, [F1; F2], name = version) end diff --git a/src/tp323.jl b/src/tp323.jl index 468594f..692ddab 100644 --- a/src/tp323.jl +++ b/src/tp323.jl @@ -21,7 +21,7 @@ function tp323(args...) @expression(nls, F2, x[2]) @constraint(nls, x[1] - x[2] + 2 ≥ 0) - @NLconstraint(nls, -x[1]^2 + x[2] - 1 ≥ 0) + @constraint(nls, -x[1]^2 + x[2] - 1 ≥ 0) return MathOptNLSModel(nls, [F1; F2], name = "tp323") end diff --git a/src/tp324.jl b/src/tp324.jl index e2f0e3b..cc0df59 100644 --- a/src/tp324.jl +++ b/src/tp324.jl @@ -20,8 +20,8 @@ function tp324(args...) @expression(nls, F1, 0.1 * x[1]) @expression(nls, F2, x[2]) - @NLconstraint(nls, x[1] * x[2] - 25 ≥ 0) - @NLconstraint(nls, x[1]^2 + x[2]^2 - 25 ≥ 0) + @constraint(nls, x[1] * x[2] - 25 ≥ 0) + @constraint(nls, x[1]^2 + x[2]^2 - 25 ≥ 0) return MathOptNLSModel(nls, [F1; F2], name = "tp324") end diff --git a/src/tp326.jl b/src/tp326.jl index 8dc0955..555d537 100644 --- a/src/tp326.jl +++ b/src/tp326.jl @@ -20,8 +20,8 @@ function tp326(args...) @expression(nls, F1, x[1] - 8) @expression(nls, F2, x[2] - 5) - @NLconstraint(nls, 11 - x[1]^2 + 6 * x[1] - 4 * x[2] ≥ 0) - @NLconstraint(nls, x[1] * x[2] - 3 * x[2] - exp(x[1] - 3) + 1 ≥ 0) + @constraint(nls, 11 - x[1]^2 + 6 * x[1] - 4 * x[2] ≥ 0) + @constraint(nls, x[1] * x[2] - 3 * x[2] - exp(x[1] - 3) + 1 ≥ 0) return MathOptNLSModel(nls, [F1; F2], name = "tp326") end diff --git a/src/tp327.jl b/src/tp327.jl index f15a7c5..003a559 100644 --- a/src/tp327.jl +++ b/src/tp327.jl @@ -113,7 +113,7 @@ function tp327(args...) @NLexpression(nls, F[i = 1:44], y[i] - x[1] - (0.49 - x[1]) * exp(-x[2] * (z[i] - 8))) - @NLconstraint(nls, -0.09 - x[1] * x[2] + 0.49 * x[2] ≥ 0) + @constraint(nls, -0.09 - x[1] * x[2] + 0.49 * x[2] ≥ 0) return MathOptNLSModel(nls, F, name = "tp327") end diff --git a/src/tp337.jl b/src/tp337.jl index 6bf9c60..762ba30 100644 --- a/src/tp337.jl +++ b/src/tp337.jl @@ -22,7 +22,7 @@ function tp337(args...) @expression(nls, F2, x[2]) @expression(nls, F3, 3 * x[3]) - @NLconstraint(nls, x[1] * x[2] - 1 ≥ 0) + @constraint(nls, x[1] * x[2] - 1 ≥ 0) return MathOptNLSModel(nls, [F1; F2; F3], name = "tp337") end diff --git a/src/tp344and345.jl b/src/tp344and345.jl index 30a1c34..bf55bcc 100644 --- a/src/tp344and345.jl +++ b/src/tp344and345.jl @@ -20,7 +20,7 @@ function tp344(args...; x0::Real = 2, version::String = "tp344") @expression(nls, F2, x[1] - x[2]) @NLexpression(nls, F3, (x[2] - x[3])^2) - @NLconstraint(nls, x[1] * (1 + x[2]^2) + x[3]^4 - 4 - 3 * sqrt(2) == 0) + @constraint(nls, x[1] * (1 + x[2]^2) + x[3]^4 - 4 - 3 * sqrt(2) == 0) return MathOptNLSModel(nls, [F1; F2; F3], name = version) end diff --git a/src/tp355.jl b/src/tp355.jl index 27ace90..d6f02ba 100644 --- a/src/tp355.jl +++ b/src/tp355.jl @@ -26,7 +26,7 @@ function tp355(args...) 2 * x[1] + 20 * x[2] - 0.5 * x[3] + 2 * x[4] + 2 * x[2] * x[4] * (x[3] - 4 * x[1]) ) - @NLconstraint(nls, r1^2 + r2^2 - r3^2 - r4^2 == 0) + @constraint(nls, r1^2 + r2^2 - r3^2 - r4^2 == 0) return MathOptNLSModel(nls, [r1; r2], name = "tp355") end diff --git a/src/tp372.jl b/src/tp372.jl index 177499d..1b284f9 100644 --- a/src/tp372.jl +++ b/src/tp372.jl @@ -22,8 +22,8 @@ function tp372(args...) y = [127; 151; 379; 421; 460; 426] for i = 1:6 - @NLconstraint(nls, x[1] + x[2] * exp((2i - 7) * x[3]) + x[i + 3] - y[i] ≥ 0) - @NLconstraint(nls, -x[1] - x[2] * exp((2i - 7) * x[3]) + x[i + 3] + y[i] ≥ 0) + @constraint(nls, x[1] + x[2] * exp((2i - 7) * x[3]) + x[i + 3] - y[i] ≥ 0) + @constraint(nls, -x[1] - x[2] * exp((2i - 7) * x[3]) + x[i + 3] + y[i] ≥ 0) end return MathOptNLSModel(nls, F, name = "tp372") diff --git a/src/tp373.jl b/src/tp373.jl index 2f2e20a..c15781c 100644 --- a/src/tp373.jl +++ b/src/tp373.jl @@ -21,7 +21,7 @@ function tp373(args...) y = [127; 151; 379; 421; 460; 426] for i = 1:6 - @NLconstraint(nls, x[1] + x[2] * exp((2i - 7) * x[3]) + x[i + 3] - y[i] == 0) + @constraint(nls, x[1] + x[2] * exp((2i - 7) * x[3]) + x[i + 3] - y[i] == 0) end return MathOptNLSModel(nls, F, name = "tp373") diff --git a/src/tp394and395.jl b/src/tp394and395.jl index 6fc5a53..0f691e8 100644 --- a/src/tp394and395.jl +++ b/src/tp394and395.jl @@ -19,7 +19,7 @@ function tp394(n::Int = 20; version::String = "tp394") @NLexpression(nls, FA[i = 1:n], sqrt(i) * x[i]) @NLexpression(nls, FB[i = 1:n], sqrt(i) * x[i]^2) - @NLconstraint(nls, sum(x[i]^2 for i = 1:n) == 1) + @constraint(nls, sum(x[i]^2 for i = 1:n) == 1) return MathOptNLSModel(nls, [FA; FB], name = version) end