Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MethodError: no method matching _build_indicator_constraint(<...>) #3580

Closed
LebedevRI opened this issue Nov 22, 2023 · 1 comment
Closed

Comments

@LebedevRI
Copy link
Contributor

using JuMP, SCIP

model = Model(SCIP.Optimizer)

@variable(model, a, Bin)
@variable(model, b, Bin)

@expression(model, c, a && b)

@variable(model, d)
@variable(model, e)

@constraint(model, c => {d == e})

print(model)
MethodError: no method matching _build_indicator_constraint(::JuMP.var"#_error#90"{Tuple{Symbol, Expr}, Symbol, LineNumberNode}, ::NonlinearExpr, ::ScalarConstraint{AffExpr, MathOptInterface.EqualTo{Float64}}, ::Type{MathOptInterface.Indicator{MathOptInterface.ACTIVATE_ON_ONE}})

Closest candidates are:
  _build_indicator_constraint(::Function, ::AbstractVariableRef, ::ScalarConstraint, ::Type{MathOptInterface.Indicator{A}}) where A
   @ JuMP ~/.julia/packages/JuMP/D44Aq/src/indicator.jl:9


Stacktrace:
 [1] macro expansion
   @ ~/.julia/packages/JuMP/D44Aq/src/macros.jl:1345 [inlined]
 [2] top-level scope
   @ In[15]:13

Works if i launder c through a variable, but then scipopt/SCIP.jl#282 is hit.

@LebedevRI LebedevRI changed the title MethodError: no method matching _build_indicator_constraint(::JuMP.var"#_error#90"{Tuple{Symbol, Expr}, Symbol, LineNumberNode}, ::NonlinearExpr, ::ScalarConstraint{AffExpr, MathOptInterface.EqualTo{Float64}}, ::Type{MathOptInterface.Indicator{MathOptInterface.ACTIVATE_ON_ONE}}) MethodError: no method matching _build_indicator_constraint(<...>) Nov 22, 2023
@odow
Copy link
Member

odow commented Nov 22, 2023

Closing in favor of #3581. They're the same underlying problem.

@odow odow closed this as completed Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants