Opened 2 years ago

Last modified 23 months ago

#29198 closed enhancement

Set up hypercube with both Vrep and Hrep (if backend supports it) — at Initial Version

Reported by: gh-kliem Owned by:
Priority: major Milestone: sage-9.1
Component: geometry Keywords: hypercube, polyhedron, double description
Cc: jipilab, gh-LaisRast Merged in:
Authors: Jonathan Kliem Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description

Currently, the hypercube is set up with the vertices. This is slow, as the vertices grow exponentially with dimension:

sage: %time _ = polytopes.hypercube(8)
CPU times: user 58.6 ms, sys: 0 ns, total: 58.6 ms
Wall time: 58.2 ms
sage: %time _ = polytopes.hypercube(14)
CPU times: user 2.74 s, sys: 19.1 ms, total: 2.76 s
Wall time: 2.76 s

With #28880 at hand, we can set up the hypercube with both Vrep and Hrep. If the backend supports it (as in backend='field'), then the double description does not need to be computed. If the backend does not support it (as in backend='ppl'), then the hypercube is set up from the inequalities, which is much faster:

sage: %time _ = polytopes.hypercube(8)
CPU times: user 47.8 ms, sys: 3.19 ms, total: 51 ms
Wall time: 50 ms
sage: %time _ = polytopes.hypercube(14)
CPU times: user 421 ms, sys: 4.7 ms, total: 426 ms
Wall time: 425 ms
sage: %time _ = polytopes.hypercube(14, backend='field')
CPU times: user 168 ms, sys: 124 µs, total: 169 ms
Wall time: 168 ms

Change History (0)

Note: See TracTickets for help on using tickets.