Opened 6 years ago
Closed 5 years ago
#22309 closed enhancement (fixed)
Use PPL for computing vertices of LatticePolytope
Reported by:  novoselt  Owned by:  

Priority:  major  Milestone:  sage7.6 
Component:  geometry  Keywords:  
Cc:  vbraun  Merged in:  
Authors:  Andrey Novoseltsev  Reviewers:  Travis Scrimshaw 
Report Upstream:  N/A  Work issues:  
Branch:  c820307 (Commits, GitHub, GitLab)  Commit:  c82030713adafe2b3706df63fb65652c5fe846b2 
Dependencies:  #22304  Stopgaps: 
Description (last modified by )
This gives drastic improvement for small polytopes which is the target case. Before:
sage: timeit("LatticePolytope(lattice_polytope.cross_polytope(3).vertices())") 25 loops, best of 3: 35.2 ms per loop
After:
sage: timeit("LatticePolytope(lattice_polytope.cross_polytope(3).vertices())") 625 loops, best of 3: 684 µs per loop
Next in the chain of lattice polytope improvements is #22310
Change History (9)
comment:1 Changed 6 years ago by
 Branch set to u/novoselt/PPL_for_vertices
comment:2 Changed 6 years ago by
 Cc vbraun added
 Commit set to db3b54e20e98572a34918526aa0e8c28c83dea78
 Status changed from new to needs_review
comment:3 Changed 5 years ago by
 Description modified (diff)
comment:4 Changed 5 years ago by
For multiline imports, you can use (IMO cleaner):
from sage.libs.ppl import (C_Polyhedron, Generator_System, Linear_Expression, point as PPL_point)
Otherwise LGTM.
comment:5 Changed 5 years ago by
 Reviewers set to Travis Scrimshaw
comment:6 Changed 5 years ago by
 Commit changed from db3b54e20e98572a34918526aa0e8c28c83dea78 to c82030713adafe2b3706df63fb65652c5fe846b2
Branch pushed to git repo; I updated commit sha1. New commits:
c820307  Use parentheses for multiline import

comment:7 Changed 5 years ago by
Thank you! I've checked with PEP 8 that this is also the recommended way of doing things  will try to keep in mind for the future. So  positive review?)
comment:9 Changed 5 years ago by
 Branch changed from u/novoselt/PPL_for_vertices to c82030713adafe2b3706df63fb65652c5fe846b2
 Resolution set to fixed
 Status changed from positive_review to closed
Note: See
TracTickets for help on using
tickets.
Volker, I was going to stop bugging you, but this great speed up is mostly due to what you've done for cones, I've just adjusted it to work with points rather than rays.
New commits:
Make dual nefpartitions conveniently ordered
Fix nefpartition ordering in doctests
Add NefCompleteIntersection.cohomology_class
Add Cayley polytopes/cones to dosctring of NefPartition
Add PPL representation to LatticePolytope
Use PPL for computing vertices of LatticePolytope
Fix doctests  mostly due to different order of vertices