Opened 5 years ago
Last modified 5 years ago
#24451 closed enhancement
Polyhedron.get_integral_point — at Version 2
Reported by: | Mark Bell | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | sage-8.2 |
Component: | geometry | Keywords: | Polyhedron, integral_points |
Cc: | Vincent Delecroix, Thierry Monteil, Matthias Köppe | Merged in: | |
Authors: | Mark Bell | Reviewers: | |
Report Upstream: | N/A | Work issues: | |
Branch: | u/mcbell/polyhedron_get_integral_point (Commits, GitHub, GitLab) | Commit: | d3b9b396c1dc9d6ca8c9478b01035454ebbe1f74 |
Dependencies: | Stopgaps: |
Description (last modified by )
This patch adds a method Polyhedron.get_integral_point(index) which returns the nth integral point in the polyhedron. It is equivalent to Polyhedron.integral_points()[index]. However when Polyhedron.integral_points_count() does not need to enumerate all of the integral points, for example in rational Polyhedra, neither does this method. Hence it can be significantly faster.
This method is useful for performing random sampling of integral points since it allows points to be chosen uniformly at random via:
index = randint(0, P.integral_points_count()) point = P.get_integral_point(index)
Change History (2)
comment:1 Changed 5 years ago by
Branch: | → u/mcbell/polyhedron_get_integral_point |
---|
comment:2 Changed 5 years ago by
Authors: | → Mark Bell |
---|---|
Cc: | Vincent Delecroix Thierry Monteil Matthias Köppe added |
Commit: | → d3b9b396c1dc9d6ca8c9478b01035454ebbe1f74 |
Component: | PLEASE CHANGE → geometry |
Description: | modified (diff) |
Keywords: | Polyhedron integral_points added |
Status: | new → needs_review |
Type: | PLEASE CHANGE → enhancement |
Note: See
TracTickets for help on using
tickets.