muEC::SG::GenPerm – generates an element of the symmetric group
The muEC::SG::GenPerm function generates one element of a symmetric group in lexicographic order, according to the parameter typeperm.
muEC::SG::GenPerm(n, First) returns the first permutation of .
muEC::SG::GenPerm(n, Last) returns the last permutation of .
muEC::SG::GenPerm(perm, Previous) gives the previous permutation according to the lexicographic order. It returns the null() value when perm is already the first permutation.
muEC::SG::GenPerm(perm, Next) gives the next permutation according to the lexicographic order. It returns the null() value when perm is already the last permutation.
Calls:
muEC::SG::GenPerm(n, typeperm)
muEC::SG::GenPerm(perm, typeperm)
Parameters:
n: |
any positive integer |
perm: |
any list denoting a permutation |
typeperm: |
First, Previous, Next, Last |
Related Functions:
muEC::SG::GenPerm( [3, 1, 4, 2], Next );
muEC::SG::GenPerm(%, Previous);