Opened 4 months ago

Closed 4 months ago

#29323 closed enhancement (fixed)

Set up cross polytope with both Vrep and Hrep (if backend supports it)

Reported by: gh-kliem Owned by:
Priority: major Milestone: sage-9.1
Component: geometry Keywords: cross polytope, precomputed data
Cc: jipilab, gh-LaisRast Merged in:
Authors: Jonathan Kliem Reviewers: Frédéric Chapoton
Report Upstream: N/A Work issues:
Branch: a14d5a1 (Commits) Commit: a14d5a172e04c704c28333b5f56e689d16c89376
Dependencies: Stopgaps:

Description

We set up the cross polytope with precomputed double description, if the backend supports it. Otherwise, the vertices will be used as before (the shorter input is selected automatically by #28880).

Before this ticket:

sage: %time P = polytopes.cross_polytope(8, backend='field')
CPU times: user 14.3 s, sys: 4.01 ms, total: 14.3 s
Wall time: 14.3 s
sage: %timeit P = polytopes.cross_polytope(13, backend='ppl')
1 loop, best of 5: 312 ms per loop

With this ticket:

sage: %time P = polytopes.hypercube(8, backend='field')
CPU times: user 29.8 ms, sys: 11.2 ms, total: 41 ms
Wall time: 40.3 ms
sage: %timeit P = polytopes.cross_polytope(13, backend='ppl')
1 loop, best of 5: 312 ms per loop

sage: %timeit P = polytopes.hypercube(13, backend='field')
10 loops, best of 5: 69.5 ms per loop

Note: This might slow down some backends (e.g. ppl) a bit, as the inequalities are precomputed and then discarded again. However, this seems to be only minor. The speed up for backend field is significant, as nothing is being computed anymore.

Change History (4)

comment:1 Changed 4 months ago by gh-kliem

  • Branch set to public/29323
  • Commit set to dd291b59266c3578f8addfcdd1f353cc5221b3b0
  • Status changed from new to needs_review

New commits:

dd291b5set up cross polytope with precomputed data if backend supports it

comment:2 Changed 4 months ago by gh-kliem

  • Branch changed from public/29323 to public/29323-reb
  • Commit changed from dd291b59266c3578f8addfcdd1f353cc5221b3b0 to a14d5a172e04c704c28333b5f56e689d16c89376

New commits:

862d44fset up cross polytope with precomputed data if backend supports it
a14d5a1fixed failing doctests

comment:3 Changed 4 months ago by chapoton

  • Reviewers set to Frédéric Chapoton
  • Status changed from needs_review to positive_review

ok

comment:4 Changed 4 months ago by vbraun

  • Branch changed from public/29323-reb to a14d5a172e04c704c28333b5f56e689d16c89376
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.