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

Bug in the ppl backend of polyhedron #27840

Closed
jplab opened this issue May 16, 2019 · 16 comments
Closed

Bug in the ppl backend of polyhedron #27840

jplab opened this issue May 16, 2019 · 16 comments

Comments

@jplab
Copy link

jplab commented May 16, 2019

The following line throws a conversion error only with the (default) backend ppl:

sage: Q = Polyhedron(backend='ppl', vertices=[(1, 2, 3), (1, 3, 2), (2, 1, 3), (2, 3, 1), (3, 1, 2), (3, 2, 1)],rays=[[1,1,1]],lines=[[1,2,3]])
Traceback (most recent call last):
...
TypeError: no conversion of this rational to integer

Replacing the backend by any other goes through without problems.

CC: @mkoeppe @videlec @tscrim

Component: geometry

Keywords: polytopes, ppl

Author: Matthias Koeppe

Branch/Commit: 17895a6

Reviewer: Vincent Delecroix

Issue created by migration from https://trac.sagemath.org/ticket/27840

@jplab jplab added this to the sage-8.8 milestone May 16, 2019
@mkoeppe
Copy link
Member

mkoeppe commented May 16, 2019

comment:1

Interesting. Here the heuristic that guesses the parent and base ring goes wrong. If one passes base_ring=QQ, then one can see that PPL chooses a representation using a fractional "vertex".

@videlec
Copy link
Contributor

videlec commented May 19, 2019

comment:2

What should be done? Set base_ring=QQ when there is rays or lines?

Do you have any idea why PPL prefers a presentation with vertices with non-trivial denominators?

@mkoeppe
Copy link
Member

mkoeppe commented May 20, 2019

@mkoeppe
Copy link
Member

mkoeppe commented May 20, 2019

Author: Matthias Koeppe

@mkoeppe
Copy link
Member

mkoeppe commented May 20, 2019

Commit: 4073783

@mkoeppe
Copy link
Member

mkoeppe commented May 20, 2019

New commits:

4073783Guess base_ring of non-compact V-polyhedra with integer data as QQ, not ZZ

@videlec
Copy link
Contributor

videlec commented May 20, 2019

Reviewer: Vincent Delecroix

@videlec
Copy link
Contributor

videlec commented May 20, 2019

comment:5

Failures in

sage -t --long src/sage/geometry/cone.py  # 3 doctests failed
sage -t --long src/sage/doctest/control.py  # 4 doctests failed
sage -t --long src/sage/doctest/forker.py  # 6 doctests failed
sage -t --long src/sage/combinat/root_system/plot.py  # 1 doctest failed

(see patchbot report)

I believe that when the polytope is a cone (namely with a unique vertex at 0) then everything should be fine. No? Don't we want base_ring=ZZ in this case?

Also, the constructor should be tested when the user enforces base_ring=ZZ.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 20, 2019

Changed commit from 4073783 to a081671

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 20, 2019

Branch pushed to git repo; I updated commit sha1. New commits:

cb66a1eHowever, guess base_ring of cones with integer data as ZZ
a081671Add a doctest

@videlec
Copy link
Contributor

videlec commented May 20, 2019

comment:8

I like more this less intrusive version. Though it is a pity that the second commit cancels some edits of the first...

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 20, 2019

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

27b98b5Guess base_ring of non-compact, non-cone V-polyhedra with integer data as QQ, not ZZ
17895a6Add a doctest

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented May 20, 2019

Changed commit from a081671 to 17895a6

@mkoeppe
Copy link
Member

mkoeppe commented May 20, 2019

comment:10

Replying to @videlec:

it is a pity that the second commit cancels some edits of the first...

I've squashed the two commits.

@videlec
Copy link
Contributor

videlec commented May 20, 2019

comment:11

Nice Thx.

@vbraun
Copy link
Member

vbraun commented May 24, 2019

Changed branch from u/mkoeppe/bug_in_the_ppl_backend_of_polyhedron to 17895a6

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

No branches or pull requests

4 participants