#5487: Content function for tableaux
---------------------------+------------------------------------------------
Reporter: andrew.mathas | Owner: mhansen
Type: enhancement | Status: new
Priority: trivial | Milestone:
Component: combinatorics | Keywords: tableaux content
---------------------------+------------------------------------------------
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.
}}}
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/5487>
Sage <http://sagemath.org/>
Sage - Open Source Mathematical Software: Building the Car Instead of
Reinventing the Wheel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en
-~----------~----~----~----~------~----~------~--~---