ACE BN BNA CG CLG COMP FM FREE HEKA IDCA NCA NCSF PART SFA SG SGA SP SYMF TAB TYP

FUNCTION: GenPerm - generate an element of the symmetric group

CALLING SEQUENCE:

GenPerm(n, typeperm)
GenPerm(perm, typeperm)
SG[GenPerm](n, typeperm)
SG[GenPerm](perm, typeperm)

PARAMETERS:

n = any positive integer
perm = any list denoting a permutation
typeperm = 'first', 'previous', 'next', 'last'

SYNOPSIS:

EXAMPLES:


> with(SG):
> GenPerm([3, 1, 4, 2], 'next');
 
                                [3, 2, 1, 4]
> GenPerm([3, 2, 1, 4], 'previous');
 
                                [3, 1, 4, 2]
 

SEE ALSO: