Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
add is_standard() method
Browse files Browse the repository at this point in the history
  • Loading branch information
ChamanAgrawal committed Aug 20, 2019
1 parent b1912ca commit 7a30231
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/sage/combinat/shifted_primed_tableau.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,36 @@ def check(self):
if not self.parent()._contains_tableau(self):
raise ValueError("{} is not an element of Shifted Primed Tableaux".format(self))

def is_standard(self):
"""
Return ``True`` if the entries of ``self`` are in bijection with
positive primed integers `1', 1, 2' \ldots n`.
EXAMPLES::
sage: ShiftedPrimedTableau([["1'", 1, "2'"], [2, "3'"]],
....: primed_diagonal=True).is_standard()
True
sage: ShiftedPrimedTableau([["1'", 1, 2], ["2'", "3'"]],
....: primed_diagonal=True).is_standard()
True
sage: ShiftedPrimedTableau([["1'", 1, 1], ["2'", 2]],
....: primed_diagonal=True).is_standard()
False
sage: ShiftedPrimedTableau([[1, "2'"], [2]]).is_standard()
False
"""
flattened_list = [i for row in self for i in row]
a = PrimedEntry('1p')
primed_list = []
for i in range(len(flattened_list)):
primed_list.append(a)
a = a.increase_half()

if sorted(flattened_list) != primed_list:
return False
return True

def __eq__(self, other):
"""
Check whether ``self`` is equal to ``other``.
Expand Down

0 comments on commit 7a30231

Please sign in to comment.