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 pyramid with both Vrep and Hrep #32152

Closed
kliem opened this issue Jul 7, 2021 · 6 comments
Closed

Set up pyramid with both Vrep and Hrep #32152

kliem opened this issue Jul 7, 2021 · 6 comments

Comments

@kliem
Copy link
Contributor

kliem commented Jul 7, 2021

We set up the pyramid over a polyhedron with the double description.

Before:

sage: P = polytopes.permutahedron(6)                                                                                                                                                
sage: %time Q = P.pyramid()                                                                                                                                                         
CPU times: user 99.4 ms, sys: 0 ns, total: 99.4 ms
Wall time: 98 ms
sage: P = polytopes.hypercube(8)                                                                                                                                                    
sage: %time Q = P.pyramid()                                                                                                                                                         
CPU times: user 34.2 ms, sys: 24 µs, total: 34.2 ms
Wall time: 33.3 ms
sage: P = polytopes.cross_polytope(8)                                                                                                                                               
sage: %time Q = P.pyramid()                                                                                                                                                         
CPU times: user 40.5 ms, sys: 3.96 ms, total: 44.5 ms
Wall time: 43.3 ms
sage: P = polytopes.hypercube(6, backend='field')                                                                                                                                   
sage: %time Q = P.pyramid()                                                                                                                                                         
CPU times: user 974 ms, sys: 0 ns, total: 974 ms
Wall time: 973 ms

After:

sage: P = polytopes.permutahedron(6)                                                                                                                                                                                                                                           
sage: %time Q = P.pyramid()                                                                                                                                                                                                                                                    
CPU times: user 119 ms, sys: 197 µs, total: 120 ms
Wall time: 118 ms
sage: P = polytopes.hypercube(8)                                                                                                                                                                                                                                               
sage: %time Q = P.pyramid()                                                                                                                                                                                                                                                    
CPU times: user 30.5 ms, sys: 3.92 ms, total: 34.4 ms
Wall time: 33.4 ms
sage: P = polytopes.cross_polytope(8)                                                                                                                                                                                                                                          
sage: %time Q = P.pyramid()                                                                                                                                                                                                                                                    
CPU times: user 40.4 ms, sys: 0 ns, total: 40.4 ms
Wall time: 39.7 ms
sage: P = polytopes.hypercube(6, backend='field')                                                                                                                                                                                                                              
sage: %time Q = P.pyramid()                                                                                                                                                                                                                                                    
CPU times: user 8.04 ms, sys: 0 ns, total: 8.04 ms
Wall time: 7.99 ms
sage: P = polytopes.hypercube(10, backend='field')                                                                                                                                                                                                                             
sage: %time Q = P.pyramid()                                                                                                                                                                                                                                                    
CPU times: user 46.4 ms, sys: 98 µs, total: 46.5 ms
Wall time: 45.6 ms

Component: geometry

Keywords: polyhedron, double description, precomputed, pyramid

Author: Jonathan Kliem

Branch/Commit: 2b1c64b

Reviewer: Travis Scrimshaw

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

@kliem kliem added this to the sage-9.4 milestone Jul 7, 2021
@tscrim
Copy link
Collaborator

tscrim commented Jul 8, 2021

comment:2

Could there be a slowdown if we need to compute the number of inequalities, say if a polytope was given in terms of its vertices? Do we even want to bother checking if one or both of the representations have been done (and then choose accordingly)?

I will have the same comment on #32150 and #32151.

@kliem
Copy link
Contributor Author

kliem commented Jul 9, 2021

comment:3

Yes, there could be a slowdown and especially for something as simple as the pyramid, but not at the moment.

Currently, all polyhedra are immutable and non-interactive and the Vrepresentation and Hrepresentation is always already computed.

With mutable polyhedra (theoretically makes sense with ppl, normaliz and polymake) things will be a bit different. But then just embedding in higher dimension and adding a vertex would be the better approach anyway. So I would propose overwriting the pyramid method in the mutable case anyway.

@tscrim
Copy link
Collaborator

tscrim commented Jul 9, 2021

Reviewer: Travis Scrimshaw

@tscrim
Copy link
Collaborator

tscrim commented Jul 9, 2021

comment:4

Okay, I understand. Thank you for the explanation. LGTM.

@kliem
Copy link
Contributor Author

kliem commented Jul 9, 2021

comment:5

Thank you.

@vbraun
Copy link
Member

vbraun commented Jul 24, 2021

Changed branch from u/gh-kliem/double_description_pyramid to 2b1c64b

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

3 participants