-
Notifications
You must be signed in to change notification settings - Fork 33
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
Bump Polyhedra and JuMP #1668
Bump Polyhedra and JuMP #1668
Conversation
This needs to be resolved together with #1666 because the |
It seems we (= you 😉) need to do some changes in the interface. |
The problem can be traced to: julia> convex_hull([[1//1, 3//1, 5//1], [0//1, 3//1, 5//1]])
ERROR: MethodError: Cannot `convert` an object of type Symbol to an object of type GLPK.MethodEnum
Closest candidates are:
convert(::Type{T}, ::JuMP.GenericAffExpr{T,VarType} where VarType) where T at C:\Users\marce\.julia\packages\JuMP\iGamg\src\aff_expr.jl:298
convert(::Type{T}, ::JuMP.GenericQuadExpr{T,VarType} where VarType) where T at C:\Users\marce\.julia\packages\JuMP\iGamg\src\quad_expr.jl:323 and then in the julia> vQ
V-representation Polyhedra.Hull{Rational{Int64},Array{Rational{Int64},1},Int64}:
2-element iterator of Array{Rational{Int64},1}:
Rational{Int64}[1//1, 3//1, 5//1]
Rational{Int64}[0//1, 3//1, 5//1]
julia> solver
JuMP.OptimizerFactory(GLPK.Optimizer, (), Base.Iterators.Pairs(:method=>:Exact))
julia> Polyhedra.removevredundancy(vQ, solver)
ERROR: MethodError: Cannot `convert` an object of type Symbol to an object of type GLPK.MethodEnum
Closest candidates are:
convert(::Type{T}, ::JuMP.GenericAffExpr{T,VarType} where VarType) where T at C:\Users\marce\.julia\packages\JuMP\iGamg\src\aff_expr.jl:298
convert(::Type{T}, ::JuMP.GenericQuadExpr{T,VarType} where VarType) where T at C:\Users\marce\.julia\packages\JuMP\iGamg\src\quad_expr.jl:323
convert(::Type{T}, ::T) where T at essentials.jl:154 I dont know yet for sure but it seems like this should be reported in Polyhedra. cc: @blegat |
Replace |
thanks for the feedback! i get another error now, julia> convex_hull([[1//1, 3//1, 5//1], [0//1, 3//1, 5//1]])
ERROR: GLPK.GLPKError("no bf solution found (use GLPK.factorize)")
Stacktrace:
[1] _bf_exists at C:\Users\marce\.julia\packages\GLPK\nTwL7\src\GLPK_checks.jl:271 [inlined]
[2] macro expansion at C:\Users\marce\.julia\packages\GLPK\nTwL7\src\GLPK_checks.jl:53 [inlined]
[3] get_bhead(::GLPK.Prob, ::Int64) at C:\Users\marce\.julia\packages\GLPK\nTwL7\src\GLPK.jl:1619
[4] get_infeasibility_ray(::GLPK.Optimizer, ::Array{Float64,1}) at C:\Users\marce\.julia\packages\GLPK\nTwL7\src\infeasibility_certificates.jl:49
[5] optimize!(::GLPK.Optimizer) at C:\Users\marce\.julia\packages\GLPK\nTwL7\src\MOI_wrapper.jl:1328
[6] optimize!(::MathOptInterface.Bridges.LazyBridgeOptimizer{GLPK.Optimizer}) at C:\Users\marce\.julia\packages\MathOptInterface\016Ol\src\Bridges\bridge_optimizer.jl:139
[7] optimize!(::MathOptInterface.Utilities.CachingOptimizer{MathOptInterface.AbstractOptimizer,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}) at C:\Users\marce\.julia\packages\MathOptInterface\016Ol\src\Utilities\cachingoptimizer.jl:178
[8] #optimize!#78(::Bool, ::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::JuMP.Model, ::Nothing) at C:\Users\marce\.julia\packages\JuMP\iGamg\src\optimizer_interface.jl:141
[9] #optimize! at .\none:0 [inlined] (repeats 2 times)
[10] #parameter_optimizehook#2(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::JuMP.Model) at C:\Users\marce\.julia\packages\ParameterJuMP\NjgYh\src\ParameterJuMP.jl:318
[11] parameter_optimizehook(::JuMP.Model) at C:\Users\marce\.julia\packages\ParameterJuMP\NjgYh\src\ParameterJuMP.jl:311
[12] #optimize!#78(::Bool, ::Bool, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::JuMP.Model, ::Nothing) at C:\Users\marce\.julia\packages\JuMP\iGamg\src\optimizer_interface.jl:131
[13] optimize! at C:\Users\marce\.julia\packages\JuMP\iGamg\src\optimizer_interface.jl:111 [inlined] (repeats 2 times)
[14] is_feasible(::JuMP.Model, ::String) at C:\Users\marce\.julia\packages\Polyhedra\2GDrj\src\redundancy.jl:79
[15] nonredundant_elements(::Polyhedra.Hull{Rational{Int64},Array{Rational{Int64},1},Int64}, ::JuMP.Model, ::Array{JuMP.GenericAffExpr{Float64,JuMP.VariableRef},1}, ::Array{ParameterJuMP.ParameterRef,1}, ::Array{Array{Rational{Int64},1},1}, ::Array{Polyhedra.Index{Rational{Int64},Array{Rational{Int64},1}},1}, ::JuMP.Containers.DenseAxisArray{JuMP.VariableRef,1,Tuple{Array{Polyhedra.Index{Rational{Int64},Array{Rational{Int64},1}},1}},Tuple{Dict{Polyhedra.Index{Rational{Int64},Array{Rational{Int64},1}},Int64}}}) at C:\Users\marce\.julia\packages\Polyhedra\2GDrj\src\redundancy.jl:140
[16] nonredundant_points(::Polyhedra.Hull{Rational{Int64},Array{Rational{Int64},1},Int64}, ::JuMP.Model, ::Array{JuMP.GenericAffExpr{Float64,JuMP.VariableRef},1}, ::Array{ParameterJuMP.ParameterRef,1}) at C:\Users\marce\.julia\packages\Polyhedra\2GDrj\src\redundancy.jl:196
[17] removevredundancy(::Polyhedra.Hull{Rational{Int64},Array{Rational{Int64},1},Int64}, ::JuMP.OptimizerFactory) at C:\Users\marce\.julia\packages\Polyhedra\2GDrj\src\redundancy.jl:217
[18] #remove_redundant_vertices#133(::Nothing, ::Nothing, ::Function, ::VPolytope{Rational{Int64}}) at C:\Users\marce\.julia\dev\LazySets\src\Sets\VPolytope.jl:435
[19] #remove_redundant_vertices at .\none:0 [inlined]
[20] #_convex_hull_nd!#223(::Nothing, ::Nothing, ::Function, ::Array{Array{Rational{Int64},1},1}) at C:\Users\marce\.julia\dev\LazySets\src\ConcreteOperations\convex_hull.jl:374
[21] #_convex_hull_nd! at .\array.jl:0 [inlined]
[22] #convex_hull!#222(::Nothing, ::Nothing, ::Nothing, ::Function, ::Array{Array{Rational{Int64},1},1}) at C:\Users\marce\.julia\dev\LazySets\src\ConcreteOperations\convex_hull.jl:193
[23] #convex_hull#221 at .\none:0 [inlined]
[24] convex_hull(::Array{Array{Rational{Int64},1},1}) at C:\Users\marce\.julia\dev\LazySets\src\ConcreteOperations\convex_hull.jl:148
[25] top-level scope at none:0 |
5b373b5
to
473db8e
Compare
Here is a minimal example without julia> using Polyhedra, JuMP, GLPK
julia> ch = convexhull([1//1, 3//1], [0//1, 3//1])
V-representation Polyhedra.PointsHull{Rational{Int64},Array{Rational{Int64},1},Int64}:
2-element iterator of Array{Rational{Int64},1}:
Rational{Int64}[1//1, 3//1]
Rational{Int64}[0//1, 3//1]
julia> solver = JuMP.with_optimizer(GLPK.Optimizer, method=GLPK.EXACT)
OptimizerFactory(GLPK.Optimizer, (), Base.Iterators.Pairs(:method=>EXACT))
julia> Polyhedra.removevredundancy(ch, solver)
ERROR: GLPKError("no bf solution found (use GLPK.factorize)")
[...] @blegat: Should we report this in |
Seems to be an issue with GLPK, could you print the JuMP model just before this line ? |
I added a julia> Polyhedra.removevredundancy(ch, solver)
Feasibility
Subject to
noname + noname = 1.0
-noname = 0.0
-3 noname - 3 noname = 0.0
noname = 0.0
noname ≥ 0.0
ERROR: GLPKError("no bf solution found (use GLPK.factorize)")
[...] |
With the |
I cannot approve my own PR but it looks good to me. Thanks! |
Closes #1666.