In this chapter we mention a couple functions that are fairly basic but useful tools to work with.
‣ PermComplement ( perm ) | ( function ) |
Returns: The permutation that is the complement of perm
.
The complement of a permutation τ=τ_1...τ_n is the permutation
τ^C=(n+1)-τ_1 (n+1)-τ_2... (n+1)-τ_n
.
gap> PermComplement([3,2,8,6,7,1,5,4]); [ 6, 7, 1, 3, 2, 8, 4, 5 ] gap>
‣ IsRankEncoding ( perm ) | ( function ) |
Returns: true
if perm
is a valid rank encoding of a permutation.
IsRankEncoding
checkes whether the input list perm
is a valid rank encoding by checking whether it is accepted by the bounded class automaton, with the highest rank being set by the highest element in perm
.
gap> IsRankEncoding([3,2,6,4,4,1,2,1]); true gap> IsRankEncoding([3,2,6,4,5,1,2,1]); false gap>
generated by GAPDoc2HTML