Returns the combinatorial class of alternating sign matrices of size n.
EXAMPLES:
sage: a2 = AlternatingSignMatrices(2); a2
Alternating sign matrices of size 2
sage: for a in a2: print a, "-\n"
[0 1]
[1 0]
-
[1 0]
[0 1]
-
Bases: sage.combinat.combinat.CombinatorialClass
TESTS:
sage: [ AlternatingSignMatrices(n).cardinality() for n in range(0, 11)]
[1, 1, 2, 7, 42, 429, 7436, 218348, 10850216, 911835460, 129534272700]
sage: asms = [ AlternatingSignMatrices(n) for n in range(6) ]
sage: all( [ asm.cardinality() == len(asm.list()) for asm in asms] )
True
Returns the combinatorial class of contre tableaux of size n.
EXAMPLES:
sage: ct4 = ContreTableaux(4); ct4
Contre tableaux of size 4
sage: ct4.cardinality()
42
sage: ct4.first()
[[1, 2, 3, 4], [1, 2, 3], [1, 2], [1]]
sage: ct4.last()
[[1, 2, 3, 4], [2, 3, 4], [3, 4], [4]]
sage: ct4.random_element()
[[1, 2, 3, 4], [1, 2, 3], [1, 3], [3]]
Bases: sage.combinat.combinat.CombinatorialClass
TESTS:
sage: [ ContreTableaux(n).cardinality() for n in range(0, 11)]
[1, 1, 2, 7, 42, 429, 7436, 218348, 10850216, 911835460, 129534272700]
Returns the combinatorial class of truncated staircases of size n with last column last_column.
EXAMPLES:
sage: t4 = TruncatedStaircases(4, [2,3]); t4
Truncated staircases of size 4 with last column [2, 3]
sage: t4.cardinality()
4
sage: t4.first()
[[4, 3, 2, 1], [3, 2, 1], [3, 2]]
sage: t4.list()
[[[4, 3, 2, 1], [3, 2, 1], [3, 2]], [[4, 3, 2, 1], [4, 2, 1], [3, 2]], [[4, 3, 2, 1], [4, 3, 1], [3, 2]], [[4, 3, 2, 1], [4, 3, 2], [3, 2]]]
Returns an alternating sign matrix from a contretableaux.
TESTS:
sage: import sage.combinat.alternating_sign_matrix as asm
sage: asm.from_contre_tableau([[1, 2, 3], [1, 2], [1]])
[0 0 1]
[0 1 0]
[1 0 0]
sage: asm.from_contre_tableau([[1, 2, 3], [2, 3], [3]])
[1 0 0]
[0 1 0]
[0 0 1]