-
Notifications
You must be signed in to change notification settings - Fork 84
Closed
Labels
Description
julia> using Gurobi
julia> const MOI = Gurobi.MOI
MathOptInterface
julia> model = Gurobi.Optimizer();
julia> x = MOI.add_variable(model)
MathOptInterface.VariableIndex(1)
julia> MOI.set(model, MOI.ObjectiveSense(), MOI.MAX_SENSE)
julia> attr = MOI.ObjectiveFunction{MOI.ScalarAffineFunction{Float64}}()
MathOptInterface.ObjectiveFunction{MathOptInterface.ScalarAffineFunction{Float64}}()
julia> MOI.set(model, attr, 1.0 * x - 1.0)
julia> MOI.set(model, attr, 1.0 * x + 1.0)
julia> MOI.get(model, attr)
MathOptInterface.ScalarAffineFunction{Float64}(MathOptInterface.ScalarAffineTerm{Float64}[MathOptInterface.ScalarAffineTerm{Float64}(1.0, MathOptInterface.VariableIndex(1))], -1.0)
Final constant should be +1.0
, not -1.0
.