# HG changeset patch
# User Travis Scrimshaw <tscrim@ucdavis.edu>
# Date 1371636365 25200
# Node ID a7266e3c0ff1eae1cbd5a02217072ab113d3aa17
# Parent 1f5a7e92ac2cd5c27d130835375c501fbfcd236b
#14765: Fix empty top row for GelfandTsetlin patterns
diff git a/sage/combinat/gelfand_tsetlin_patterns.py b/sage/combinat/gelfand_tsetlin_patterns.py
a

b

class GelfandTsetlinPatternsTopRow(Gelfa 
925  925  
926  926  sage: G = GelfandTsetlinPatterns(top_row=[4,4,3,1]) 
927  927  sage: TestSuite(G).run() 
 928  
 929  TESTS: 
 930  
 931  Check a border case in :trac:`14765`:: 
 932  
 933  sage: G = GelfandTsetlinPatterns(top_row=[]) 
 934  sage: list(G) 
 935  [[]] 
928  936  """ 
929  937  self._row = top_row 
930  938  n = len(top_row) 
931   k = top_row[0] 
 939  if n == 0: 
 940  k = 0 
 941  else: 
 942  k = top_row[0] 
932  943  GelfandTsetlinPatterns.__init__(self, n, k, strict) 
933  944  
934  945  def _repr_(self): 
… 
… 
class GelfandTsetlinPatternsTopRow(Gelfa 
989  1000  [[4, 2, 1], [4, 2], [4]]] 
990  1001  """ 
991  1002  # If we enforce strictness, check to see if a specified top row is strict 
992   if self._strict and self._row is not None and \ 
993   any(self._row[i] == self._row[i+1] for i in range(self._n1)): 
 1003  if self._strict and any(self._row[i] == self._row[i+1] for i in range(self._n1)): 
 1004  return 
 1005  if self._n == 0: 
 1006  yield self.element_class(self, []) 
994  1007  return 
995  1008  if self._n == 1: 
996  1009  yield self.element_class(self, [list(self._row)]) 