Skip to content

Commit 6f26c06

Browse files
committed
Add a unit test for the support of VectorNonlinearFunction
1 parent 4c9bdb3 commit 6f26c06

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

test/nlp_problems/nf.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
function nf()
2+
f(x::Vector{VariableRef}) = sqrt.(x)
3+
g(x::Vector{VariableRef}) = x.^3
4+
h(x::Vector{VariableRef}) = sum(x.^4)
5+
nlp = Model()
6+
@variable(nlp, x[1:2])
7+
@constraint(nlp, f(x) .- g(x) in MOI.Nonnegatives(2))
8+
@objective(nlp, Max, h(x))
9+
return nlp
10+
end

test/runtests.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ using Test, Printf
55
nlp_problems = setdiff(NLPModelsTest.nlp_problems, ["MGH01Feas"])
66
nls_problems = NLPModelsTest.nls_problems
77

8-
extra_nlp_problems = ["nohesspb", "hs61", "hs100", "hs219", "quadcon", "operatorspb"]
8+
extra_nlp_problems = ["nohesspb", "hs61", "hs100", "hs219", "quadcon", "operatorspb", "nf"]
99
extra_nls_problems = ["nlsnohesspb", "HS30", "HS43", "MGH07", "nlsqc"]
1010

1111
for problem in lowercase.(nlp_problems extra_nlp_problems)

0 commit comments

Comments
 (0)