Ticket #5487 (closed enhancement: fixed)
[with patch, positive review] Content function for tableaux
| Reported by: | andrew.mathas | Owned by: | andrew.mathas |
|---|---|---|---|
| Priority: | trivial | Milestone: | sage-3.4.1 |
| Component: | combinatorics | Keywords: | tableaux content |
| Cc: | sage-combinat | Author(s): | |
| Report Upstream: | Reviewer(s): | ||
| Merged in: | Work issues: |
Description
Simple patch adding a content function for tableaux to tableau.py.
[Mostly just a test to see if I can push a patch to the combinat server.]
diff -r c6382e76a5e5 sage/combinat/tableau.py
--- a/sage/combinat/tableau.py Thu Mar 12 01:07:21 2009 +1100
+++ b/sage/combinat/tableau.py Thu Mar 12 01:07:52 2009 +1100
@@ -480,6 +480,21 @@
s += [ (i,j) for j in range(len(self[i])) ]
return s
+ def content(self, k):
+ """
+ Returns the content of <k> in <self>. That is, if <k> appears in
+ row r and column c of the tableau <self> then we return c-r.
+
+ EXAMPLES:
+ sage: Tableau([[1,2],[3,4]]).content(3)
+ -1
+
+ """
+ for r in range(len(self)):
+ for c in range(len(self[r])):
+ if self[r][c]==k: return c-r
+ return False
+
def k_weight(self, k):
"""
Returns the k-weight of self.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

