Ticket #1071 (closed enhancement: fixed)
[with patch] IntegerVectors_nk
| Reported by: | malb | Owned by: | mhansen |
|---|---|---|---|
| Priority: | major | Milestone: | sage-2.8.12 |
| Component: | combinatorics | Keywords: | |
| Cc: | sage-combinat | Work issues: | |
| Report Upstream: | Reviewers: | ||
| Authors: | Merged in: | ||
| Dependencies: | Stopgaps: |
Description
calling IntegerVectors?.list after applying the attached patch is much faster now.
old:
sage: time l1 = map(tuple, IntegerVectors(2, 60).list()) CPU time: 5.01 s, Wall time: 5.11 s
new:
sage: time l1 = map(tuple, IntegerVectors(2, 60).list()) CPU time: 0.20 s, Wall time: 0.20 s
Attachments
Change History
comment:3 Changed 6 years ago by malb
Please note that the cleaner version by mhansen is by a factor of three than the original submission:
the untouched implementation sage: time l1 = map(tuple, IntegerVectors(2, 60).list()) CPU times: user 5.06 s, sys: 0.11 s, total: 5.18 s Wall time: 5.18
mhansen's implementation
sage: time l1 = map(tuple, IntegerVectors(2, 60, min_part=0).list()) CPU time: 0.56 s, Wall time: 0.57 s
malb's original submission
sage: time l1 = map(tuple, IntegerVectors(2, 60).list()) CPU time: 0.20 s, Wall time: 0.20 s
I don't mean to push my original patch (which's problems were fixed by mhansen) but propose to optimise mhansen's patch eventually.
Note: See
TracTickets for help on using
tickets.

