-
Notifications
You must be signed in to change notification settings - Fork 98
Closed
Description
Reported as https://discourse.julialang.org/t/jump-moi-wrapper-interface-problem/121776/5
julia> import MathOptInterface as MOI
julia> model = MOI.Utilities.Model{Float64}()
MOIU.Model{Float64}
├ ObjectiveSense: FEASIBILITY_SENSE
├ ObjectiveFunctionType: MOI.ScalarAffineFunction{Float64}
├ NumberOfVariables: 0
└ NumberOfConstraints: 0
julia> x, _ = MOI.add_constrained_variable(model, MOI.GreaterThan(1.0))
(MOI.VariableIndex(1), MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.GreaterThan{Float64}}(1))
julia> dest = MOI.FileFormats.CBF.Model()
MOI.FileFormats.CBF.Model
├ ObjectiveSense: FEASIBILITY_SENSE
├ ObjectiveFunctionType: MOI.ScalarAffineFunction{Float64}
├ NumberOfVariables: 0
└ NumberOfConstraints: 0
julia> MOI.copy_to(dest, model)
MathOptInterface.Utilities.IndexMap with 2 entries:
MOI.VariableIndex(1) => MOI.VariableIndex(1)
ConstraintIndex{VariableIndex, GreaterThan{Float64}}(1) => ConstraintIndex{VariableIndex, GreaterThan{Float64}}(1)
julia> print(dest)
Feasibility
Subject to:
VariableIndex-in-GreaterThan{Float64}
Metadata
Metadata
Assignees
Labels
No labels