Skip to content

Commit 76af585

Browse files
authored
Add MOI.ScalarNonlinearFunction to PrecompileTools block (#487)
1 parent 0acb50a commit 76af585

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

ext/IpoptMathOptInterfaceExt/IpoptMathOptInterfaceExt.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ PrecompileTools.@setup_workload begin
5151
MOI.add_constraint(model, f, MOI.EqualTo(0.0))
5252
y, _ = MOI.add_constrained_variables(model, MOI.Nonnegatives(2))
5353
MOI.set(model, MOI.ObjectiveSense(), MOI.MAX_SENSE)
54+
f = MOI.ScalarNonlinearFunction(
55+
:+,
56+
Any[MOI.ScalarNonlinearFunction(:sin, Any[x[i]]) for i in 1:3],
57+
)
5458
MOI.supports(model, MOI.ObjectiveFunction{typeof(f)}())
5559
MOI.set(model, MOI.ObjectiveFunction{typeof(f)}(), f)
56-
MOI.set(
57-
model,
58-
MOI.NLPBlock(),
59-
MOI.NLPBlockData([], _EmptyNLPEvaluator(), false),
60-
)
60+
MOI.add_constraint(model, f, MOI.EqualTo(0.0))
6161
MOI.optimize!(model)
6262
MOI.get(model, MOI.TerminationStatus())
6363
MOI.get(model, MOI.PrimalStatus())

0 commit comments

Comments
 (0)