FUNCTION: Perm2Mat - calculate the permutation matrix
CALLING SEQUENCE:
- Perm2Mat(perm)
- SG[Perm2Mat](perm)
-
PARAMETERS:
- perm = any list denoting a permutation
SYNOPSIS:
- The Perm2Mat function calculates the permutation matrix corresponding to
perm. This matrix has entries 1 in position (i, perm[i]) and 0 otherwise.
- Whenever there is a conflict between the function name Perm2Mat
and another name used in the same session, use the long form
SG['Perm2Mat'].
EXAMPLES:
> with(SG):
> Perm2Mat([2,4,3,1]);
[ 0 1 0 0 ]
[ ]
[ 0 0 0 1 ]
[ ]
[ 0 0 1 0 ]
[ ]
[ 1 0 0 0 ]
SEE ALSO: Mat2Perm Perm2RRep RRep2Perm