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

Padding variable with LRSLib.generatorproducer #33

Open
matbesancon opened this issue Oct 1, 2019 · 1 comment
Open

Padding variable with LRSLib.generatorproducer #33

matbesancon opened this issue Oct 1, 2019 · 1 comment

Comments

@matbesancon
Copy link
Contributor

How to reproduce:

0 <= x1, x2 <= 1
x1 + x2 <= 1.5
x1 == x2

This yields the following polyhedron:

julia> poly = Polyhedra.polyhedron(m, LRSLib.Library())
Polyhedron LRSLib.Polyhedron:
1-element iterator of Polyhedra.HyperPlane{Rational{BigInt},Array{Rational{BigInt},1}}:
 HyperPlane(Rational{BigInt}[1//1, -1//1], 0//1),
5-element iterator of Polyhedra.HalfSpace{Rational{BigInt},Array{Rational{BigInt},1}}:
 HalfSpace(Rational{BigInt}[-1//1, 0//1], 0//1)
 HalfSpace(Rational{BigInt}[0//1, -1//1], 0//1)
 HalfSpace(Rational{BigInt}[1//1, 0//1], 1//1)
 HalfSpace(Rational{BigInt}[0//1, 1//1], 1//1)
 HalfSpace(Rational{BigInt}[1//1, 1//1], 3//2)

The vrep is all good:

julia> Polyhedra.vrep(poly)
V-representation Polyhedra.LiftedVRepresentation{Rational{BigInt},Array{Rational{BigInt},2}}:
2-element iterator of Array{Rational{BigInt},1}:
 Rational{BigInt}[3//4, 3//4]
 Rational{BigInt}[0//1, 0//1]

But the generator produces the following:

julia> chan = LRSLib.generatorproducer(hrep);

julia> collect(chan)
2-element Array{Any,1}:
 Rational{BigInt}[1//1, 3//4, 3//4]
 Rational{BigInt}[1//1, 0//1, 0//1]

It always adds an additional coordinate to the vertices, at the first position. Should this be documented?

@blegat
Copy link
Member

blegat commented Oct 1, 2019

Yes, this should be documented. Currently generatorproducer is only used internally.
LRSLib and CDDLib only support cones hence they lift polyhedra by adding an homogenizing variable. So for V-rep, 1 means it's a point and 0 means it's a ray.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants