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

Set up hypercube with both Vrep and Hrep (if backend supports it) #29198

Closed
kliem opened this issue Feb 14, 2020 · 20 comments
Closed

Set up hypercube with both Vrep and Hrep (if backend supports it) #29198

kliem opened this issue Feb 14, 2020 · 20 comments

Comments

@kliem
Copy link
Contributor

kliem commented Feb 14, 2020

Currently, the hypercube is set up with the vertices. This is slow, as the vertices grow exponentially with dimension:

sage: %time _ = polytopes.hypercube(8)
CPU times: user 58.6 ms, sys: 0 ns, total: 58.6 ms
Wall time: 58.2 ms
sage: %time _ = polytopes.hypercube(14)
CPU times: user 2.74 s, sys: 19.1 ms, total: 2.76 s
Wall time: 2.76 s

With #28880 at hand, we can set up the hypercube with both Vrep and Hrep. If the backend supports it (as in backend='field'), then the double description does not need to be computed. If the backend does not support it (as in backend='ppl'), then the hypercube is set up from the inequalities, which is much faster:

sage: %time _ = polytopes.hypercube(8)   # uses ppl
CPU times: user 47.8 ms, sys: 3.19 ms, total: 51 ms
Wall time: 50 ms
sage: %time _ = polytopes.hypercube(14)  # uses ppl
CPU times: user 421 ms, sys: 4.7 ms, total: 426 ms
Wall time: 425 ms
sage: %time _ = polytopes.hypercube(14, backend='field')  # uses both descriptions
CPU times: user 168 ms, sys: 124 µs, total: 169 ms
Wall time: 168 ms

CC: @jplab @LaisRast

Component: geometry

Keywords: hypercube, polyhedron, double description

Author: Jonathan Kliem

Branch/Commit: 91ae9ba

Reviewer: Jean-Philippe Labbé, Sébastien Labbé

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

@kliem kliem added this to the sage-9.1 milestone Feb 14, 2020
@kliem
Copy link
Contributor Author

kliem commented Feb 14, 2020

Branch: public/29198

@kliem
Copy link
Contributor Author

kliem commented Feb 14, 2020

Commit: 3942824

@kliem
Copy link
Contributor Author

kliem commented Feb 14, 2020

New commits:

af221cbset up the hypercube with both Vrep and Hrep
486b0e1fixed doctests
3942824fixed more doctests involving order

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Feb 15, 2020

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

8b8abb2more doctests

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Feb 15, 2020

Changed commit from 3942824 to 8b8abb2

@kliem
Copy link
Contributor Author

kliem commented Feb 24, 2020

Changed commit from 8b8abb2 to ac0390b

@kliem
Copy link
Contributor Author

kliem commented Feb 24, 2020

Changed branch from public/29198 to public/29198-reb

@kliem
Copy link
Contributor Author

kliem commented Feb 24, 2020

New commits:

f9958f3set up the hypercube with both Vrep and Hrep
b2b544efixed doctests
6ca4267fixed more doctests involving order
86cca93more doctests
ac0390bfixed one more test

@jplab

This comment has been minimized.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Feb 28, 2020

Changed commit from ac0390b to 53b54e2

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Feb 28, 2020

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

53b54e2a new failing doctest

@jplab
Copy link

jplab commented Feb 28, 2020

comment:6

Ok, that's the doctest from the bots. I also only got that one on my machine.

Let's see what the bots say. It looks good apart from that.

@jplab
Copy link

jplab commented Feb 28, 2020

Reviewer: Jean-Philippe Labbé

@vbraun
Copy link
Member

vbraun commented Feb 29, 2020

comment:8

Merge conflict

@kliem
Copy link
Contributor Author

kliem commented Mar 2, 2020

Changed commit from 53b54e2 to 91ae9ba

@kliem
Copy link
Contributor Author

kliem commented Mar 2, 2020

New commits:

357fcd1set up the hypercube with both Vrep and Hrep
91ae9bafixed doctests

@kliem
Copy link
Contributor Author

kliem commented Mar 2, 2020

Changed branch from public/29198-reb to public/29198-reb2

@seblabbe
Copy link
Contributor

seblabbe commented Mar 5, 2020

Changed reviewer from Jean-Philippe Labbé to Jean-Philippe Labbé, Sébastien Labbé

@seblabbe
Copy link
Contributor

seblabbe commented Mar 5, 2020

comment:10

I confirm the timing improvements. I get all tests passed in src/sage/geometry and src/sage/plot except src/sage/geometry/polyhedron/base.py which still has a "killed due to abort" issue which is independent of this ticket.

@vbraun
Copy link
Member

vbraun commented Mar 8, 2020

Changed branch from public/29198-reb2 to 91ae9ba

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