Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trac #27533: Improve Polyhedron.is_simple()
The method `Polyhedron.is_simple` is pretty slow for large polytopes at the moment. There is no need for that, as the information can be directly retrieved from the `Vrepresentation`. Current timings: {{{ sage: P = polytopes.hypercube(6) sage: %time P.is_simple() CPU times: user 360 ms, sys: 8 ms, total: 368 ms Wall time: 364 ms True sage: P = polytopes.hypercube(7) sage: %time P.is_simple() CPU times: user 1.78 s, sys: 48 ms, total: 1.83 s Wall time: 1.74 s True sage: P = polytopes.cross_polytope(7) sage: %time P.is_simple() CPU times: user 996 ms, sys: 0 ns, total: 996 ms Wall time: 992 ms False }}} Timings with this ticket: {{{ sage: P = polytopes.hypercube(6) sage: %time P.is_simple() CPU times: user 4 ms, sys: 4 ms, total: 8 ms Wall time: 3.53 ms True sage: P = polytopes.hypercube(7) sage: %time P.is_simple() CPU times: user 4 ms, sys: 4 ms, total: 8 ms Wall time: 5.39 ms True sage: P = polytopes.cross_polytope(7) sage: %time P.is_simple() CPU times: user 8 ms, sys: 0 ns, total: 8 ms Wall time: 5.63 ms False sage: P = polytopes.permutahedron(4) sage: %time P.is_simple() CPU times: user 0 ns, sys: 0 ns, total: 0 ns Wall time: 1.03 ms True }}} URL: https://trac.sagemath.org/27533 Reported by: gh-kliem Ticket author(s): Jonathan Kliem Reviewer(s): Laith Rastanawi
- Loading branch information