def test_rims():
    assert set(Partition.rims((), 0)) == {()}
    assert set(Partition.rims((), 1)) == {(), ((1, 1), )}
    assert set(Partition.rims((), 2)) == {(), ((1, 1), ), ((1, 1), (1, 2))}
    assert set(Partition.rims((1, ), 1)) == {(), ((1, 2), ), ((1, 2), (2, 2))}
    assert set(Partition.rims(
        (3, 2))) == {(), ((1, 4), ), ((1, 4), (2, 4)), ((3, 3), ),
                     ((1, 4), (3, 3)), ((1, 4), (2, 4), (3, 3)),
                     ((1, 4), (2, 4), (3, 3), (3, 4))}  # noqa
Beispiel #2
0
 def KLG_counts_by_shape(cls, content_max, mu):  # noqa
     ans = {}
     for rim in Partition.rims(mu, content_max + 1):
         count = cls._KLG_count_helper(content_max, rim)
         if count:
             nu = cls._add_rim(mu, rim)
             ans[nu] = count
     return ans
Beispiel #3
0
 def KLG(cls, content_max, mu):  # noqa
     for shape in Partition.rims(mu, content_max + 1):
         for tab in cls._KLG_helper(content_max, (), shape):
             yield Tableau({(i, j): a for (i, j, a) in tab})