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

polyhedron from intersection of hyperplanes #136

Open
blegat opened this issue Nov 4, 2018 · 2 comments
Open

polyhedron from intersection of hyperplanes #136

blegat opened this issue Nov 4, 2018 · 2 comments
Labels

Comments

@blegat
Copy link
Member

blegat commented Nov 4, 2018

using Polyhedra
h = HyperPlane([1, 0], 1)  HyperPlane([-1, 0], 1)
p = polyhedron(h);

throws

MethodError: no method matching Polyhedra.Intersection{Rational{BigInt},Array{Rational{BigInt},1},Int64}(::Int64, ::Polyhedra.SingleRepIterator{Rational{BigInt},HyperPlane{Rational{BigInt},Array{Rational{BigInt},1}},HyperPlanesIntersection{Rational{BigInt},Array{Rational{BigInt},1},Int64}})
Closest candidates are:
  Polyhedra.Intersection{Rational{BigInt},Array{Rational{BigInt},1},Int64}(::Union{Int64, Size}, ::Union{AbstractArray{#s18,1}, AbstractRepIterator{#s17,#s18} where #s17, AllRepIterator{#s181,#s18,LinElemT,LRT,RT} where RT<:AbstractRepIterator{#s181,#s18} where LRT<:AbstractRepIterator{#s181,LinElemT} where LinElemT where #s181} where #s18<:(HyperPlane{T,AT} where AT<:AbstractArray{T,1}), !Matched::Union{AbstractArray{#s18,1}, AbstractRepIterator{#s17,#s18} where #s17, AllRepIterator{#s181,#s18,LinElemT,LRT,RT} where RT<:AbstractRepIterator{#s181,#s18} where LRT<:AbstractRepIterator{#s181,LinElemT} where LinElemT where #s181} where #s18<:(HalfSpace{T,AT} where AT<:AbstractArray{T,1})) where {T, AT, D} at /home/blegat/.julia/dev/Polyhedra/src/vecrep.jl:62

Stacktrace:
 [1] constructpolyhedron(::Type{Polyhedra.Intersection{Rational{BigInt},Array{Rational{BigInt},1},Int64}}, ::Int64, ::Tuple{HyperPlanesIntersection{Rational{BigInt},Array{Rational{BigInt},1},Int64}}, ::Polyhedra.SingleRepIterator{Rational{BigInt},HyperPlane{Rational{BigInt},Array{Rational{BigInt},1}},HyperPlanesIntersection{Rational{BigInt},Array{Rational{BigInt},1},Int64}}) at /home/blegat/.julia/dev/Polyhedra/src/default.jl:121
 [2] hconvert(::Type{Polyhedra.Intersection{Rational{BigInt},Array{Rational{BigInt},1},Int64}}, ::HyperPlanesIntersection{Rational{BigInt},Array{Rational{BigInt},1},Int64}) at /home/blegat/.julia/dev/Polyhedra/src/iterators.jl:360
 [3] convert(::Type{Polyhedra.Intersection{Rational{BigInt},Array{Rational{BigInt},1},Int64}}, ::HyperPlanesIntersection{Rational{BigInt},Array{Rational{BigInt},1},Int64}) at /home/blegat/.julia/dev/Polyhedra/src/representation.jl:60
 [4] DefaultPolyhedron{Rational{BigInt},Polyhedra.Intersection{Rational{BigInt},Array{Rational{BigInt},1},Int64},Polyhedra.Hull{Rational{BigInt},Array{Rational{BigInt},1},Int64}}(::HyperPlanesIntersection{Rational{BigInt},Array{Rational{BigInt},1},Int64}, ::Nothing) at /home/blegat/.julia/dev/Polyhedra/src/defaultlibrary.jl:33
 [5] DefaultPolyhedron{Rational{BigInt},HRepT,VRepT} where VRepT<:VRepresentation{Rational{BigInt}} where HRepT<:HRepresentation{Rational{BigInt}}(::HyperPlanesIntersection{Rational{BigInt},Array{Rational{BigInt},1},Int64}, ::Nothing) at /home/blegat/.julia/dev/Polyhedra/src/defaultlibrary.jl:61
 [6] DefaultPolyhedron{Rational{BigInt},HRepT,VRepT} where VRepT<:VRepresentation{Rational{BigInt}} where HRepT<:HRepresentation{Rational{BigInt}}(::HyperPlanesIntersection{Int64,Array{Int64,1},Int64}, ::Nothing) at /home/blegat/.julia/dev/Polyhedra/src/defaultlibrary.jl:57
 [7] polyhedron(::HyperPlanesIntersection{Int64,Array{Int64,1},Int64}, ::DefaultLibrary{Int64}) at /home/blegat/.julia/dev/Polyhedra/src/defaultlibrary.jl:70
 [8] polyhedron(::HyperPlanesIntersection{Int64,Array{Int64,1},Int64}) at /home/blegat/.julia/dev/Polyhedra/src/polyhedron.jl:11
 [9] top-level scope at In[6]:3
@arbenede
Copy link

Try

p = polyhedron(h, CDDLib.Library())

@blegat
Copy link
Member Author

blegat commented Nov 21, 2018

Indeed, it works with CDD, I am leaving the issue opened as it should be fixed with DefaultLibrary.

@blegat blegat added the bug label Nov 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants