@@ -539,7 +539,7 @@ def _repr_lattice(self, type=None, labelling=None, underpath=True) -> str:
539
539
final_fall = " "
540
540
else :
541
541
final_fall = " _" + "__" * (length_of_final_fall - 1 )
542
- row = " " * (n - alst [- 1 ] - 1 ) + final_fall + "\n "
542
+ row = " " * (n - alst [- 1 ] - 1 ) + final_fall + "\n "
543
543
for i in range (n - 1 ):
544
544
c = 0
545
545
row = row + " " * (n - i - 2 - alst [- i - 2 ])
@@ -1982,23 +1982,30 @@ def number_of_parking_functions(self) -> int:
1982
1982
from sage .arith .misc import multinomial
1983
1983
return multinomial (self .rise_composition ())
1984
1984
1985
- def list_parking_functions (self ):
1985
+ def list_parking_functions (self ) -> list :
1986
1986
r"""
1987
1987
Return all parking functions whose supporting Dyck path is ``self``.
1988
1988
1989
1989
EXAMPLES::
1990
1990
1991
1991
sage: DyckWord([1,1,0,0,1,0]).list_parking_functions()
1992
- Permutations of the multi-set [1, 1, 3]
1993
- sage: DyckWord([1,1,1,0,0,0]).list_parking_functions()
1994
- Permutations of the multi-set [1, 1, 1]
1995
- sage: DyckWord([1,0,1,0,1,0]).list_parking_functions()
1996
- Standard permutations of 3
1992
+ [[1, 1, 3], [1, 3, 1], [3, 1, 1]]
1997
1993
"""
1994
+ return list (self .parking_functions ())
1995
+
1996
+ def parking_functions (self ):
1997
+ r"""
1998
+ Iterate over parking functions whose supporting Dyck path is ``self``.
1999
+
2000
+ EXAMPLES::
2001
+
2002
+ sage: list(DyckWord([1,1,0,1,0,0]).parking_functions())
2003
+ [[1, 1, 2], [1, 2, 1], [2, 1, 1]]
2004
+ """
2005
+ from sage .combinat .parking_functions import ParkingFunction
1998
2006
alist = self ._area_sequence_iter ()
1999
- return Permutations ([i - ai + 1 for i , ai in enumerate (alist )])
2000
- # TODO: upon implementation of ParkingFunction class
2001
- # map(ParkingFunction, Permutations([i - alist[i]+1 for i in range(len(alist))]))
2007
+ for pi in Permutations ([i - ai + 1 for i , ai in enumerate (alist )]):
2008
+ yield ParkingFunction (pi )
2002
2009
2003
2010
def reading_permutation (self ) -> Permutation :
2004
2011
r"""
0 commit comments