Skip to content

supports_constraint can be wrong #2867

@odow

Description

@odow

x-ref #2865 (comment)

Check this out:

julia> import Ipopt; import MathOptInterface as MOI

julia> model = MOI.instantiate(Ipopt.Optimizer; with_bridge_type=Float64)
MOIB.LazyBridgeOptimizer{IpoptMOIExt.Optimizer}
├ Variable bridges: none
├ Constraint bridges: none
├ Objective bridges: none
└ model: IpoptMOIExt.Optimizer
  ├ ObjectiveSense: FEASIBILITY_SENSE
  ├ ObjectiveFunctionType: MOI.ScalarAffineFunction{Float64}
  ├ NumberOfVariables: 0
  └ NumberOfConstraints: 0

julia> MOI.supports_constraint(
           model,
           MOI.VectorOfVariables,
           MOI.Indicator{MOI.ACTIVATE_ON_ONE,MOI.EqualTo{Float64}},
       )
true

This is wrong, because it assumes that the variable will be binary, which is not part of the constraint.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions