Skip to content

Commit a72bd65

Browse files
authored
Merge pull request #1 from mantepse/bijectionist
sort result of doctest to avoid random failures
2 parents 109f9e4 + f87c437 commit a72bd65

File tree

1 file changed

+23
-32
lines changed

1 file changed

+23
-32
lines changed

src/sage/combinat/bijectionist.py

Lines changed: 23 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1575,41 +1575,32 @@ def _forced_constant_blocks(self):
15751575
sage: bij.set_statistics((alpha1, beta1), (alpha2, beta2))
15761576
sage: from sage.combinat.cyclic_sieving_phenomenon import orbit_decomposition
15771577
sage: bij.set_constant_blocks(orbit_decomposition(A, rotate_permutation))
1578-
sage: for p in bij.constant_blocks(): print(list(p))
1579-
[[2, 1, 3, 4], [1, 2, 4, 3], [1, 3, 2, 4], [4, 2, 3, 1]]
1580-
[[3, 2, 1], [1, 3, 2], [2, 1, 3]]
1581-
[[2, 4, 3, 1], [3, 2, 4, 1], [2, 3, 1, 4], [1, 3, 4, 2]]
1582-
[[1, 4, 2, 3], [3, 1, 2, 4], [4, 2, 1, 3], [4, 1, 3, 2]]
1578+
sage: P = bij.constant_blocks()
1579+
sage: P = [sorted(p, key=lambda p: (len(p), p)) for p in P]
1580+
sage: P = sorted(P, key=lambda p: (len(next(iter(p))), len(p)))
1581+
sage: for p in P:
1582+
....: print(p)
1583+
[[1, 3, 2], [2, 1, 3], [3, 2, 1]]
15831584
[[1, 4, 3, 2], [3, 2, 1, 4]]
15841585
[[2, 1, 4, 3], [4, 3, 2, 1]]
1585-
[[2, 4, 1, 3], [3, 4, 2, 1], [4, 3, 1, 2], [3, 1, 4, 2]]
1586-
1587-
sage: for p in bij.constant_blocks(optimal=True): sorted(p, key=len)
1586+
[[1, 2, 4, 3], [1, 3, 2, 4], [2, 1, 3, 4], [4, 2, 3, 1]]
1587+
[[1, 3, 4, 2], [2, 3, 1, 4], [2, 4, 3, 1], [3, 2, 4, 1]]
1588+
[[1, 4, 2, 3], [3, 1, 2, 4], [4, 1, 3, 2], [4, 2, 1, 3]]
1589+
[[2, 4, 1, 3], [3, 1, 4, 2], [3, 4, 2, 1], [4, 3, 1, 2]]
1590+
1591+
sage: P = bij.constant_blocks(optimal=True)
1592+
sage: P = [sorted(p, key=lambda p: (len(p), p)) for p in P]
1593+
sage: P = sorted(P, key=lambda p: (len(next(iter(p))), len(p)))
1594+
sage: for p in P:
1595+
....: print(p)
15881596
[[1], [1, 2], [1, 2, 3], [1, 2, 3, 4]]
1589-
[[1, 3, 2],
1590-
[2, 1, 3],
1591-
[3, 2, 1],
1592-
[2, 3, 4, 1],
1593-
[1, 3, 4, 2],
1594-
[2, 1, 3, 4],
1595-
[1, 3, 2, 4],
1596-
[2, 3, 1, 4],
1597-
[1, 2, 4, 3],
1598-
[3, 2, 4, 1],
1599-
[2, 1, 4, 3],
1600-
[2, 4, 3, 1],
1601-
[4, 2, 3, 1],
1602-
[4, 3, 2, 1],
1603-
[1, 4, 3, 2],
1604-
[3, 2, 1, 4]]
1605-
[[1, 4, 2, 3],
1606-
[4, 2, 1, 3],
1607-
[2, 4, 1, 3],
1608-
[4, 3, 1, 2],
1609-
[4, 1, 3, 2],
1610-
[3, 4, 2, 1],
1611-
[3, 1, 2, 4],
1612-
[3, 1, 4, 2]]
1597+
[[1, 3, 2], [2, 1, 3], [3, 2, 1],
1598+
[1, 2, 4, 3], [1, 3, 2, 4], [1, 3, 4, 2], [1, 4, 3, 2],
1599+
[2, 1, 3, 4], [2, 1, 4, 3], [2, 3, 1, 4], [2, 3, 4, 1],
1600+
[2, 4, 3, 1], [3, 2, 1, 4], [3, 2, 4, 1], [4, 2, 3, 1],
1601+
[4, 3, 2, 1]]
1602+
[[1, 4, 2, 3], [2, 4, 1, 3], [3, 1, 2, 4], [3, 1, 4, 2],
1603+
[3, 4, 2, 1], [4, 1, 3, 2], [4, 2, 1, 3], [4, 3, 1, 2]]
16131604
16141605
The permutation `[2, 1]` is in none of these blocks::
16151606

0 commit comments

Comments
 (0)