-
Notifications
You must be signed in to change notification settings - Fork 9
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
Calling solve twice causes BoundsError #57
Comments
Can you reduce it to an example using the MOI wrapper directly without Convex ? julia> using MosekTools
julia> model = Mosek.Optimizer()
MosekModel
julia> const MOI = MosekTools.MOI
MathOptInterface
julia> x = MOI.SingleVariable(MOI.add_variable(model))
MathOptInterface.SingleVariable(MathOptInterface.VariableIndex(1))
julia> y = MOI.SingleVariable(MOI.add_variable(model))
MathOptInterface.SingleVariable(MathOptInterface.VariableIndex(2))
julia> cx = MOI.add_constraint(model, x, MOI.GreaterThan(0.0))
MathOptInterface.ConstraintIndex{MathOptInterface.SingleVariable,MathOptInterface.GreaterThan{Float64}}(1)
julia> cy = MOI.add_constraint(model, y, MOI.GreaterThan(0.0))
MathOptInterface.ConstraintIndex{MathOptInterface.SingleVariable,MathOptInterface.GreaterThan{Float64}}(2)
julia> c = MOI.add_constraint(model, 1.0x + 1.0y, MOI.LessThan(1.0))
MathOptInterface.ConstraintIndex{MathOptInterface.ScalarAffineFunction{Float64},MathOptInterface.LessThan{Float64}}(1)
julia> MOI.set(model, MOI.ObjectiveSense(), MOI.MIN_SENSE)
julia> MOI.set(model, MOI.ObjectiveFunction{typeof(1.0x)}(), 1.0x)
julia> MOI.optimize!(model)
Problem
Name :
Objective sense : min
Type : LO (linear optimization problem)
Constraints : 1
Cones : 0
Scalar variables : 2
Matrix variables : 0
Integer variables : 0
Optimizer started.
Presolve started.
Linear dependency checker started.
Linear dependency checker terminated.
Eliminator started.
Freed constraints in eliminator : 0
Eliminator terminated.
Eliminator started.
Freed constraints in eliminator : 0
Eliminator terminated.
Eliminator - tries : 2 time : 0.00
Lin. dep. - tries : 1 time : 0.00
Lin. dep. - number : 0
Presolve terminated. Time: 0.00
Optimizer terminated. Time: 0.00
2-element Array{MosekTools.MosekSolution,1}:
MosekTools.MosekSolution(Mosek.MSK_SOL_BAS, Mosek.MSK_SOL_STA_OPTIMAL, Mosek.MSK_PRO_STA_PRIM_AND_DUAL_FEAS, Mosek.Stakey[Mosek.MSK_SK_LOW, Mosek.MSK_SK_LOW], [0.0, 0.0], Array{Float64,1}[], [1.0, 0.0], [0.0, 0.0], Float64[], Mosek.Stakey[Mosek.MSK_SK_BAS], [0.0], [0.0], [0.0], [-0.0])
MosekTools.MosekSolution(Mosek.MSK_SOL_ITR, Mosek.MSK_SOL_STA_OPTIMAL, Mosek.MSK_PRO_STA_PRIM_AND_DUAL_FEAS, Mosek.Stakey[Mosek.MSK_SK_LOW, Mosek.MSK_SK_LOW], [0.0, 0.0], Array{Float64,1}[], [1.0, 0.0], [0.0, 0.0], [0.0, 0.0], Mosek.Stakey[Mosek.MSK_SK_SUPBAS], [0.0], [0.0], [0.0], [-0.0])
julia> MOI.optimize!(model)
Problem
Name :
Objective sense : min
Type : LO (linear optimization problem)
Constraints : 1
Cones : 0
Scalar variables : 2
Matrix variables : 0
Integer variables : 0
Optimizer started.
Optimizer terminated. Time: 0.00
2-element Array{MosekTools.MosekSolution,1}:
MosekTools.MosekSolution(Mosek.MSK_SOL_BAS, Mosek.MSK_SOL_STA_OPTIMAL, Mosek.MSK_PRO_STA_PRIM_AND_DUAL_FEAS, Mosek.Stakey[Mosek.MSK_SK_LOW, Mosek.MSK_SK_LOW], [0.0, 0.0], Array{Float64,1}[], [1.0, 0.0], [0.0, 0.0], Float64[], Mosek.Stakey[Mosek.MSK_SK_BAS], [0.0], [0.0], [0.0], [-0.0])
MosekTools.MosekSolution(Mosek.MSK_SOL_ITR, Mosek.MSK_SOL_STA_OPTIMAL, Mosek.MSK_PRO_STA_PRIM_AND_DUAL_FEAS, Mosek.Stakey[Mosek.MSK_SK_LOW, Mosek.MSK_SK_LOW], [0.0, 0.0], Array{Float64,1}[], [1.0, 0.0], [0.0, 0.0], [0.0, 0.0], Mosek.Stakey[Mosek.MSK_SK_SUPBAS], [0.0], [0.0], [0.0], [-0.0])
julia> MOI.get(model, MOI.ConstraintDual(), cx)
1.0
julia> MOI.get(model, MOI.ConstraintDual(), cy)
0.0
julia> MOI.get(model, MOI.ConstraintDual(), c)
-0.0 |
Any update ? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Here's a MWE
The text was updated successfully, but these errors were encountered: