Skip to content

[FileFormats.CBF] bug copying unsupported variable bounds to CBF #2570

@odow

Description

@odow

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions