From 8df647454982f5799a4267712551a78989f08992 Mon Sep 17 00:00:00 2001 From: Anne Schilling Date: Sat, 23 Nov 2013 23:24:03 -0800 Subject: [PATCH] Fixed bug in k-charge implementation for J-algorithm --- src/sage/combinat/k_tableau.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/sage/combinat/k_tableau.py b/src/sage/combinat/k_tableau.py index 9448286fbb9..e46bc0b4623 100644 --- a/src/sage/combinat/k_tableau.py +++ b/src/sage/combinat/k_tableau.py @@ -1128,6 +1128,10 @@ def k_charge_J(self): Traceback (most recent call last): ... ValueError: k-charge is not defined for skew weak tableaux + + sage: t = WeakTableau([[1, 1, 2, 3], [2, 4, 4], [3, 6], [5]], 4, representation='bounded') + sage: t.k_charge() == t.k_charge(algorithm = 'J') + True """ if self.parent()._skew: raise ValueError("k-charge is not defined for skew weak tableaux") @@ -1182,8 +1186,9 @@ def _height_of_restricted_subword(self, sw, r): sage: t._height_of_restricted_subword(s,6) 4 """ + R = filter(lambda v : self[v[0]][v[1]] < r, self.shape().to_partition().cells()) L = filter(lambda v: self[v[0]][v[1]] <= r, sw) - return max([v[0] for v in L]) + return max([v[0] for v in L+R]) class WeakTableaux_core(WeakTableaux_abstract): r"""