-
Notifications
You must be signed in to change notification settings - Fork 94
Closed
Labels
Description
So I'm reworking the EAGO.jl solver (simplifying the internals and hooking into more MOI functionality). I've setup a working version of the optimizer to only support MOI.ScalarAffineFunction and nonlinear objectives (using bridges to handle scalar quadratic and single variable constraints). Currently, it looks like the parser triggers an error when running MOIT.unittest
`MOI.ObjectiveSense` before `MOI.ObjectiveFunction` when using `MOI.Bridges.Objective.SlackBridge
It looks like the parser currently loads from string which includes the following segment of code (around line 268 of parser.jl)
elseif label == :maxobjective
f = parsedtoMOI(model, parsefunction(ex))
MOI.set(model, MOI.ObjectiveFunction{typeof(f)}(), f)
MOI.set(model, MOI.ObjectiveSense(), MOI.MAX_SENSE)
elseif label == :minobjective
f = parsedtoMOI(model, parsefunction(ex))
MOI.set(model, MOI.ObjectiveFunction{typeof(f)}(), f)
MOI.set(model, MOI.ObjectiveSense(), MOI.MIN_SENSE)
If I swap to the ordering around as so,
elseif label == :maxobjective
f = parsedtoMOI(model, parsefunction(ex))
MOI.set(model, MOI.ObjectiveSense(), MOI.MAX_SENSE)
MOI.set(model, MOI.ObjectiveFunction{typeof(f)}(), f)
elseif label == :minobjective
f = parsedtoMOI(model, parsefunction(ex))
MOI.set(model, MOI.ObjectiveSense(), MOI.MIN_SENSE)
MOI.set(model, MOI.ObjectiveFunction{typeof(f)}(), f)
then my solver now passes MOIT.unittest.
Mind if I put in a pull request to this effect?