id summary reporter owner description type status priority milestone component resolution keywords cc merged author reviewer upstream work_issues branch commit dependencies stopgaps
29324 Translation with both Vrep and Hrep gh-kliem "We set up translation of polyhedra with both Vrepresentation and Hrepresentation, if the backend supports it.
This might be faster, when the Hrepresentation is shorter (previously translation was computed from Vrepresentation). Also this is much faster, when the backend supports precomputed data (currently `field`).
Before this ticket:
{{{
sage: P = polytopes.hypercube(14, 'zero_one')
sage: %time Q = P - P.center()
CPU times: user 3.42 s, sys: 2 µs, total: 3.42 s
Wall time: 3.42 s
sage: P = polytopes.hypercube(8, 'zero_one', backend='field')
sage: %time Q = P - P.center()
CPU times: user 13.8 s, sys: 8 µs, total: 13.8 s
Wall time: 13.8 s
sage: P = polytopes.cross_polytope(12)
sage: %timeit Q = P - P.vertices()[0].vector()
10 loops, best of 5: 149 ms per loop
sage: P = polytopes.cross_polytope(6, backend='field')
sage: %time Q = P - P.vertices()[0].vector()
CPU times: user 744 ms, sys: 4 µs, total: 744 ms
Wall time: 744 ms
}}}
With this ticket:
{{{
# Hrep is shorter.
sage: P = polytopes.hypercube(14)
sage: %time Q = P - P.center()
CPU times: user 1.01 s, sys: 16 ms, total: 1.02 s
Wall time: 1.02 s
# Completely precomputed.
sage: P = polytopes.hypercube(8, 'zero_one', backend='field')
sage: %time Q = P - P.center()
CPU times: user 16.9 ms, sys: 0 ns, total: 16.9 ms
Wall time: 16.8 ms
# A bit slower (precomputed data is discarded).
sage: P = polytopes.cross_polytope(12)
sage: %timeit Q = P - P.vertices()[0].vector()
10 loops, best of 5: 172 ms per loop
# Completely precomputed.
sage: P = polytopes.cross_polytope(6, backend='field')
sage: %time Q = P - P.vertices()[0].vector()
CPU times: user 2.12 ms, sys: 30 µs, total: 2.15 ms
Wall time: 2.15 ms
# With precomputed data translations are what they should be -- trivial.
sage: P = polytopes.hypercube(14, 'zero_one', backend='field')
sage: %time Q = P - P.center()
CPU times: user 404 ms, sys: 3.97 ms, total: 408 ms
Wall time: 408 ms
}}}" enhancement closed major sage-9.1 geometry fixed polyhedra, translation jipilab gh-LaisRast Jonathan Kliem Laith Rastanawi N/A ffda483f08c0ddf129b8f5a02fe3f0c83b3a0113