Skip to content

Conversation

odow
Copy link
Member

@odow odow commented May 25, 2024

Closes #2506

This now results in the expected:

julia> using JuMP, HiGHS

julia> model = Model(HiGHS.Optimizer)
A JuMP Model
Feasibility problem with:
Variables: 0
Model mode: AUTOMATIC
CachingOptimizer state: EMPTY_OPTIMIZER
Solver name: HiGHS

julia> @variable(model, x)
x

julia> @variable(model, z, Bin)
z

julia> @constraint(model, z --> {x * z == 0})
ERROR: Constraints of type MathOptInterface.VectorQuadraticFunction{Float64}-in-MathOptInterface.Indicator{MathOptInterface.ACTIVATE_ON_ONE, MathOptInterface.EqualTo{Float64}} are not supported by the solver.

If you expected the solver to support your problem, you may have an error in your formulation. Otherwise, consider using a different solver.

The list of available solvers, along with the problem types they support, is available at https://jump.dev/JuMP.jl/stable/installation/#Supported-solvers.
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:35
 [2] _moi_add_constraint(model::MathOptInterface.Utilities.CachingOptimizer{…}, f::MathOptInterface.VectorQuadraticFunction{…}, s::MathOptInterface.Indicator{…})
   @ JuMP ~/.julia/packages/JuMP/Gwn88/src/constraints.jl:686
 [3] add_constraint(model::Model, con::VectorConstraint{QuadExpr, MathOptInterface.Indicator{…}, VectorShape}, name::String)
   @ JuMP ~/.julia/packages/JuMP/Gwn88/src/constraints.jl:713
 [4] macro expansion
   @ ~/.julia/packages/JuMP/Gwn88/src/macros/@constraint.jl:133 [inlined]
 [5] macro expansion
   @ ~/.julia/packages/JuMP/Gwn88/src/macros.jl:393 [inlined]
 [6] top-level scope
   @ REPL[6]:1
Some type information was truncated. Use `show(err)` to see complete types.

@odow odow merged commit 62b88c8 into master May 26, 2024
@odow odow deleted the od/fix-indicator-vaq branch May 26, 2024 02:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

[Bridges] Method error with quadratic indicator constraints
1 participant