Skip to content

Commit

Permalink
Merge pull request #1 from mantepse/bijectionist
Browse files Browse the repository at this point in the history
sort result of doctest to avoid random failures
  • Loading branch information
mantepse committed Mar 11, 2023
2 parents 109f9e4 + f87c437 commit a72bd65
Showing 1 changed file with 23 additions and 32 deletions.
55 changes: 23 additions & 32 deletions src/sage/combinat/bijectionist.py
Expand Up @@ -1575,41 +1575,32 @@ def _forced_constant_blocks(self):
sage: bij.set_statistics((alpha1, beta1), (alpha2, beta2))
sage: from sage.combinat.cyclic_sieving_phenomenon import orbit_decomposition
sage: bij.set_constant_blocks(orbit_decomposition(A, rotate_permutation))
sage: for p in bij.constant_blocks(): print(list(p))
[[2, 1, 3, 4], [1, 2, 4, 3], [1, 3, 2, 4], [4, 2, 3, 1]]
[[3, 2, 1], [1, 3, 2], [2, 1, 3]]
[[2, 4, 3, 1], [3, 2, 4, 1], [2, 3, 1, 4], [1, 3, 4, 2]]
[[1, 4, 2, 3], [3, 1, 2, 4], [4, 2, 1, 3], [4, 1, 3, 2]]
sage: P = bij.constant_blocks()
sage: P = [sorted(p, key=lambda p: (len(p), p)) for p in P]
sage: P = sorted(P, key=lambda p: (len(next(iter(p))), len(p)))
sage: for p in P:
....: print(p)
[[1, 3, 2], [2, 1, 3], [3, 2, 1]]
[[1, 4, 3, 2], [3, 2, 1, 4]]
[[2, 1, 4, 3], [4, 3, 2, 1]]
[[2, 4, 1, 3], [3, 4, 2, 1], [4, 3, 1, 2], [3, 1, 4, 2]]
sage: for p in bij.constant_blocks(optimal=True): sorted(p, key=len)
[[1, 2, 4, 3], [1, 3, 2, 4], [2, 1, 3, 4], [4, 2, 3, 1]]
[[1, 3, 4, 2], [2, 3, 1, 4], [2, 4, 3, 1], [3, 2, 4, 1]]
[[1, 4, 2, 3], [3, 1, 2, 4], [4, 1, 3, 2], [4, 2, 1, 3]]
[[2, 4, 1, 3], [3, 1, 4, 2], [3, 4, 2, 1], [4, 3, 1, 2]]
sage: P = bij.constant_blocks(optimal=True)
sage: P = [sorted(p, key=lambda p: (len(p), p)) for p in P]
sage: P = sorted(P, key=lambda p: (len(next(iter(p))), len(p)))
sage: for p in P:
....: print(p)
[[1], [1, 2], [1, 2, 3], [1, 2, 3, 4]]
[[1, 3, 2],
[2, 1, 3],
[3, 2, 1],
[2, 3, 4, 1],
[1, 3, 4, 2],
[2, 1, 3, 4],
[1, 3, 2, 4],
[2, 3, 1, 4],
[1, 2, 4, 3],
[3, 2, 4, 1],
[2, 1, 4, 3],
[2, 4, 3, 1],
[4, 2, 3, 1],
[4, 3, 2, 1],
[1, 4, 3, 2],
[3, 2, 1, 4]]
[[1, 4, 2, 3],
[4, 2, 1, 3],
[2, 4, 1, 3],
[4, 3, 1, 2],
[4, 1, 3, 2],
[3, 4, 2, 1],
[3, 1, 2, 4],
[3, 1, 4, 2]]
[[1, 3, 2], [2, 1, 3], [3, 2, 1],
[1, 2, 4, 3], [1, 3, 2, 4], [1, 3, 4, 2], [1, 4, 3, 2],
[2, 1, 3, 4], [2, 1, 4, 3], [2, 3, 1, 4], [2, 3, 4, 1],
[2, 4, 3, 1], [3, 2, 1, 4], [3, 2, 4, 1], [4, 2, 3, 1],
[4, 3, 2, 1]]
[[1, 4, 2, 3], [2, 4, 1, 3], [3, 1, 2, 4], [3, 1, 4, 2],
[3, 4, 2, 1], [4, 1, 3, 2], [4, 2, 1, 3], [4, 3, 1, 2]]
The permutation `[2, 1]` is in none of these blocks::
Expand Down

0 comments on commit a72bd65

Please sign in to comment.