Opened 8 years ago

Last modified 8 years ago

#15269 closed enhancement

Speeding up tableau's cells_containing and weight methods — at Initial Version

Reported by: darij Owned by:
Priority: minor Milestone: sage-5.13
Component: combinatorics Keywords: tableau, combinat
Cc: tscrim, sage-combinat, aschilling Merged in:
Authors: Darij Grinberg Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges


I know that the current implementation of tableaux in Sage is not long for this world (mutability WTF), but here are two small pieces of simple code that can be improved: Before:

sage: %timeit Tableau([[1,1,2,8,9],[2,5,6,11],[3,7,7,13],[4,8,9],[5],[13],[14]]).cells_containing(4)
1000 loops, best of 3: 449 us per loop


sage: %timeit Tableau([[1,1,2,8,9],[2,5,6,11],[3,7,7,13],[4,8,9],[5],[13],[14]]).cells_containing(4)
10000 loops, best of 3: 81.5 us per loop


sage: %timeit Tableau([[1,1,2,8,9],[2,5,6,11],[3,7,7,13],[4,8,9],[5],[13],[14]]).weight()
10000 loops, best of 3: 190 us per loop


sage: %timeit Tableau([[1,1,2,8,9],[2,5,6,11],[3,7,7,13],[4,8,9],[5],[13],[14]]).weight2()
10000 loops, best of 3: 87.4 us per loop

Change History (0)

Note: See TracTickets for help on using tickets.