% $Date: 2003/09/15 16:37:45 $ $Author: nthiery $ $Revision: 1.1.1.1 $

\begin{Mhelppage}{Mat2Perm}{V. Prosper}

  \begin{MInfo}
    \eng{calculates a permutation from its matrix}
  \end{MInfo}

  \begin{MCalls}
    \Mcall{sqm}
  \end{MCalls}

  \begin{MParameters}
    \param{sqm}
    \eng{any square permutation matrix} 
  \end{MParameters}

  \begin{MIntro}
    \eng{The {\Mthis} function calculates a permutation from a matrix.
      Given a permutation \Mex{perm}, the corresponding matrix has
      entries 1 in position
      \Mmath{(i,\Mex{perm}[i])}{(i,\mathtt{perm}_i)} and 0 otherwise.
      }
  \end{MIntro}

\begin{MExample}{ex1}
\begin{Mexin}
muEC::SG::Perm2Mat( [2,4,3,1] );
\end{Mexin}
\begin{Mexout}
                       +-            -+
                       |  0, 1, 0, 0  |
                       |              |
                       |  0, 0, 0, 1  |
                       |              |
                       |  0, 0, 1, 0  |
                       |              |
                       |  1, 0, 0, 0  |
                       +-            -+
\end{Mexout}
% \begin{Mexout}[hide]
% array(1..4, 1..4, (1,1) = 0, (1,2) = 1, (1,3) = 0, (1,4) = 0,
%                   (2,1) = 0, (2,2) = 0, (2,3) = 0, (2,4) = 1,
%                   (3,1) = 0, (3,2) = 0, (3,3) = 1, (3,4) = 0,
%                   (4,1) = 1, (4,2) = 0, (4,3) = 0, (4,4) = 0 )
% \end{Mexout}
\begin{Mexin}
muEC::SG::Mat2Perm(%);
\end{Mexin}
\begin{Mexout}
                         [2, 4, 3, 1]
\end{Mexout}
\end{MExample}

\MRelatedFunctions{Perm2Mat,Perm2RRep,RRep2Perm}
\end{Mhelppage}
