Skip to content

Test objective#7

Open
gnowzil wants to merge 2 commits intomasterfrom
test_objective
Open

Test objective#7
gnowzil wants to merge 2 commits intomasterfrom
test_objective

Conversation

@gnowzil
Copy link
Contributor

@gnowzil gnowzil commented Feb 3, 2021

Should fix #5. I think these updates will allow the use of JuMP.@objective to represent linear, quadratic objective functions. Needs more testing.

@lassepe
Copy link

lassepe commented Feb 3, 2021

Works on a minimal example:

import JuMP
import SNOPT7

opt_model = JuMP.Model(SNOPT7.Optimizer)
x = JuMP.@variable(opt_model, [1:10])
y = JuMP.@variable(opt_model)

JuMP.@objective(opt_model, Min, (x .- 1)' * x)
JuMP.@NLconstraint(opt_model, x[1] == y)
JuMP.optimize!(opt_model)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support JuMP.@objective

2 participants