Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trac #33645: Another improvement for face iterator of simple/simplici…
…al polytopes Follow up on #30040: If we are in a lattice, such that all intervals `[F, G]` are boolean, if `F` is not the lower bound, then any face except the lower bound, has a unique representation as meet of coatoms. This means that we do not need to mark a face as visited, when removing it from the coatoms. Before (benchmarks without parallelization): {{{ sage: P = polytopes.cyclic_polytope(10, 22) sage: %timeit C = CombinatorialPolyhedron(P); C.f_vector(1, 0) 43.2 ms ± 40 µs per loop (mean ± std. dev. of 7 runs, 10 loops each) sage: P = polytopes.associahedron(['A', 8]) sage: %timeit C = CombinatorialPolyhedron(P); C.f_vector(1, 0) 20.1 ms ± 69.3 µs per loop (mean ± std. dev. of 7 runs, 10 loops each) sage: P = polytopes.hypercube(12, backend='field') sage: %timeit C = CombinatorialPolyhedron(P); C.f_vector(1, 0) 38.6 ms ± 464 µs per loop (mean ± std. dev. of 7 runs, 10 loops each) sage: P = polytopes.Birkhoff_polytope(5) # neither simple nor simplicial sage: %timeit C = CombinatorialPolyhedron(P); C.f_vector(1, 0) 275 ms ± 531 µs per loop (mean ± std. dev. of 7 runs, 1 loop each) }}} After (benchmarks without parallelization): {{{ sage: P = polytopes.cyclic_polytope(10, 22) sage: %timeit C = CombinatorialPolyhedron(P); C.f_vector(1, 0) 38.6 ms ± 1.07 ms per loop (mean ± std. dev. of 7 runs, 10 loops each) sage: P = polytopes.associahedron(['A', 8]) sage: %timeit C = CombinatorialPolyhedron(P); C.f_vector(1, 0) 18.3 ms ± 23.7 µs per loop (mean ± std. dev. of 7 runs, 100 loops each) sage: P = polytopes.hypercube(12, backend='field') sage: %timeit C = CombinatorialPolyhedron(P); C.f_vector(1, 0) 30.9 ms ± 40 µs per loop (mean ± std. dev. of 7 runs, 10 loops each) sage: P = polytopes.Birkhoff_polytope(5) # neither simple nor simplicial sage: %timeit C = CombinatorialPolyhedron(P); C.f_vector(1, 0) 274 ms ± 410 µs per loop (mean ± std. dev. of 7 runs, 1 loop each) }}} URL: https://trac.sagemath.org/33645 Reported by: gh-kliem Ticket author(s): Jonathan Kliem Reviewer(s): Travis Scrimshaw
- Loading branch information