Skip to content

Conversation

blegat
Copy link
Member

@blegat blegat commented Feb 23, 2022

This is needed to make this work at the JuMP level:

julia> @constraint(model, im * x == 1)
ERROR: MethodError: no method matching shift_constant(::MathOptInterface.EqualTo{Float64}, ::ComplexF64)
Closest candidates are:
  shift_constant(::Union{MathOptInterface.EqualTo{T}, MathOptInterface.GreaterThan{T}, MathOptInterface.LessThan{T}}, ::T) where T at ~/.julia/packages/MathOptInterface/IQWV4/src/Utilities/sets.jl:38
  shift_constant(::MathOptInterface.Interval, ::Any) at ~/.julia/packages/MathOptInterface/IQWV4/src/Utilities/sets.jl:49
  shift_constant(::MathOptInterface.Test.UnknownScalarSet, ::Any) at ~/.julia/packages/MathOptInterface/IQWV4/src/Test/test_model.jl:14
Stacktrace:
 [1] build_constraint(_error::Function, expr::GenericAffExpr{ComplexF64, VariableRef}, set::MathOptInterface.EqualTo{Float64})
   @ JuMP ~/.julia/dev/JuMP/src/macros.jl:574
 [2] macro expansion
   @ ~/.julia/dev/JuMP/src/macros.jl:816 [inlined]
 [3] top-level scope
   @ REPL[15]:1

@odow odow merged commit c96f705 into master Feb 23, 2022
@odow odow deleted the bl/shift_constant_promote branch February 23, 2022 20:03
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.

2 participants