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

A few bugs not fixed #73

Open
odow opened this issue Feb 24, 2021 · 0 comments
Open

A few bugs not fixed #73

odow opened this issue Feb 24, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@odow
Copy link
Member

odow commented Feb 24, 2021

julia> model = Model()
A JuMP Model
Feasibility problem with:
Variables: 0
Model mode: AUTOMATIC
CachingOptimizer state: NO_OPTIMIZER
Solver name: No optimizer attached.

julia> @variable(model, p == 1, Param())
p

julia> @variable(model, x)
x

julia> @expression(model, ex, 1 * p)
p

julia> @constraint(model, ex <= 0)
ERROR: MethodError: no method matching shift_constant(::MathOptInterface.LessThan{Float64}, ::Int64)
Closest candidates are:
  shift_constant(::Union{MathOptInterface.EqualTo{T}, MathOptInterface.GreaterThan{T}, MathOptInterface.LessThan{T}}, ::T) where T at /Users/oscar/.julia/packages/MathOptInterface/5WwpK/src/Utilities/sets.jl:13
  shift_constant(::MathOptInterface.Interval, ::Any) at /Users/oscar/.julia/packages/MathOptInterface/5WwpK/src/Utilities/sets.jl:19
  shift_constant(::MathOptInterface.Test.UnknownScalarSet, ::Any) at /Users/oscar/.julia/packages/MathOptInterface/5WwpK/src/Test/modellike.jl:8
Stacktrace:
 [1] build_constraint(::Function, ::ParameterJuMP.DoubleGenericAffExpr{Int64,VariableRef,ParameterRef}, ::MathOptInterface.LessThan{Float64}) at /Users/oscar/.julia/dev/ParameterJuMP/src/constraints.jl:162
 [2] top-level scope at /Users/oscar/.julia/packages/JuMP/y5vgk/src/macros.jl:448
 [3] top-level scope at REPL[180]:1

julia> @constraint(model, ex <= x)
ERROR: MethodError: no method matching +(::GenericAffExpr{Float64,VariableRef}, ::ParameterJuMP.DoubleGenericAffExpr{Int64,VariableRef,ParameterRef})
Closest candidates are:
  +(::Any, ::Any, ::Any, ::Any...) at operators.jl:538
  +(::ChainRulesCore.DoesNotExist, ::Any) at /Users/oscar/.julia/packages/ChainRulesCore/7d1hl/src/differential_arithmetic.jl:23
  +(::MutableArithmetics.Zero, ::Any) at /Users/oscar/.julia/packages/MutableArithmetics/bPWR4/src/rewrite.jl:52
  ...
Stacktrace:
 [1] -(::ParameterJuMP.DoubleGenericAffExpr{Int64,VariableRef,ParameterRef}, ::VariableRef) at /Users/oscar/.julia/dev/ParameterJuMP/src/operators.jl:122
 [2] sub_mul(::ParameterJuMP.DoubleGenericAffExpr{Int64,VariableRef,ParameterRef}, ::VariableRef) at /Users/oscar/.julia/packages/MutableArithmetics/bPWR4/src/MutableArithmetics.jl:31
 [3] operate(::typeof(MutableArithmetics.sub_mul), ::ParameterJuMP.DoubleGenericAffExpr{Int64,VariableRef,ParameterRef}, ::VariableRef) at /Users/oscar/.julia/packages/MutableArithmetics/bPWR4/src/interface.jl:110
 [4] operate_fallback!(::MutableArithmetics.NotMutable, ::Function, ::ParameterJuMP.DoubleGenericAffExpr{Int64,VariableRef,ParameterRef}, ::VariableRef) at /Users/oscar/.julia/packages/MutableArithmetics/bPWR4/src/interface.jl:327
 [5] operate!(::typeof(MutableArithmetics.sub_mul), ::ParameterJuMP.DoubleGenericAffExpr{Int64,VariableRef,ParameterRef}, ::VariableRef) at /Users/oscar/.julia/packages/MutableArithmetics/bPWR4/src/rewrite.jl:80
 [6] top-level scope at /Users/oscar/.julia/packages/MutableArithmetics/bPWR4/src/rewrite.jl:276
 [7] top-level scope at /Users/oscar/.julia/packages/JuMP/y5vgk/src/macros.jl:447
 [8] top-level scope at REPL[181]:1

julia> @constraint(model, x - ex <= 0)
ERROR: MethodError: no method matching shift_constant(::MathOptInterface.LessThan{Float64}, ::Int64)
Closest candidates are:
  shift_constant(::Union{MathOptInterface.EqualTo{T}, MathOptInterface.GreaterThan{T}, MathOptInterface.LessThan{T}}, ::T) where T at /Users/oscar/.julia/packages/MathOptInterface/5WwpK/src/Utilities/sets.jl:13
  shift_constant(::MathOptInterface.Interval, ::Any) at /Users/oscar/.julia/packages/MathOptInterface/5WwpK/src/Utilities/sets.jl:19
  shift_constant(::MathOptInterface.Test.UnknownScalarSet, ::Any) at /Users/oscar/.julia/packages/MathOptInterface/5WwpK/src/Test/modellike.jl:8
Stacktrace:
 [1] build_constraint(::Function, ::ParameterJuMP.DoubleGenericAffExpr{Int64,VariableRef,ParameterRef}, ::MathOptInterface.LessThan{Float64}) at /Users/oscar/.julia/dev/ParameterJuMP/src/constraints.jl:162
 [2] top-level scope at /Users/oscar/.julia/packages/JuMP/y5vgk/src/macros.jl:448
 [3] top-level scope at REPL[182]:1
@odow odow added the bug Something isn't working label Feb 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant