-
Notifications
You must be signed in to change notification settings - Fork 63
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
Binary Variables with Bounds #242
Labels
Wrapper: MathOptInterface
Relates to the MathOptInterface API
Comments
Tested right after a julia> using JuMP; using CPLEX
julia> m = Model()
A JuMP Model
Feasibility problem with:
Variables: 0
Model mode: AUTOMATIC
CachingOptimizer state: NO_OPTIMIZER
Solver name: No optimizer attached.
julia> @variable(m, x, binary=true, lower_bound=0, upper_bound=1)
x
julia> optimize!(m, with_optimizer(CPLEX.Optimizer))
ERROR: Cannot set bounds because variable is of type: BINARY.
Stacktrace:
[1] error(::String) at ./error.jl:33
[2] add_constraints(::CPLEX.Optimizer, ::Array{MathOptInterface.SingleVariable,1}, ::Array{MathOptInterface.GreaterThan{Float64},1}) at /home/remi/.julia/packages/LinQuadOptInterface/ZMx9f/src/constraints/singlevariable.jl:128
[3] add_constraints(::MathOptInterface.Bridges.LazyBridgeOptimizer{CPLEX.Optimizer,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Bridges.AllBridgedConstraints{Float64}}}, ::Array{MathOptInterface.SingleVariable,1}, ::Array{MathOptInterface.GreaterThan{Float64},1}) at /home/remi/.julia/packages/MathOptInterface/C3lip/src/Bridges/bridgeoptimizer.jl:342
[4] copyconstraints!(::MathOptInterface.Bridges.LazyBridgeOptimizer{CPLEX.Optimizer,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Bridges.AllBridgedConstraints{Float64}}}, ::MathOptInterface.Utilities.UniversalFallback{JuMP._MOIModel{Float64}}, ::Bool, ::MathOptInterface.Utilities.IndexMap, ::Type{MathOptInterface.SingleVariable}, ::Type{MathOptInterface.GreaterThan{Float64}}) at /home/remi/.julia/packages/MathOptInterface/C3lip/src/Utilities/copy.jl:157
[5] default_copy_to(::MathOptInterface.Bridges.LazyBridgeOptimizer{CPLEX.Optimizer,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Bridges.AllBridgedConstraints{Float64}}}, ::MathOptInterface.Utilities.UniversalFallback{JuMP._MOIModel{Float64}}, ::Bool) at /home/remi/.julia/packages/MathOptInterface/C3lip/src/Utilities/copy.jl:200
[6] #automatic_copy_to#61 at /home/remi/.julia/packages/MathOptInterface/C3lip/src/Utilities/copy.jl:15 [inlined]
[7] #automatic_copy_to at ./none:0 [inlined]
[8] #copy_to#1 at /home/remi/.julia/packages/MathOptInterface/C3lip/src/Bridges/bridgeoptimizer.jl:91 [inlined]
[9] (::getfield(MathOptInterface, Symbol("#kw##copy_to")))(::NamedTuple{(:copy_names,),Tuple{Bool}}, ::typeof(MathOptInterface.copy_to), ::MathOptInterface.Bridges.LazyBridgeOptimizer{CPLEX.Optimizer,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Bridges.AllBridgedConstraints{Float64}}}, ::MathOptInterface.Utilities.UniversalFallback{JuMP._MOIModel{Float64}}) at ./none:0
[10] attach_optimizer(::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.AbstractOptimizer,MathOptInterface.Utilities.UniversalFallback{JuMP._MOIModel{Float64}}}) at /home/remi/.julia/packages/MathOptInterface/C3lip/src/Utilities/cachingoptimizer.jl:130
[11] attach_optimizer(::Model) at /home/remi/.julia/packages/JuMP/tyMag/src/optimizer_interface.jl:32
[12] #optimize!#79(::Bool, ::Bool, ::Function, ::Model, ::OptimizerFactory) at /home/remi/.julia/packages/JuMP/tyMag/src/optimizer_interface.jl:119
[13] optimize!(::Model, ::OptimizerFactory) at /home/remi/.julia/packages/JuMP/tyMag/src/optimizer_interface.jl:105
[14] top-level scope at none:0``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As discussed in this related issue, lanl-ansi/PowerModels.jl#535
A code like the following (untested) appears to result in an error,
The text was updated successfully, but these errors were encountered: