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

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

  \begin{MInfo}
    \eng{compares two permutations}
  \end{MInfo}

  \MDeclareOption{\kind}{kind}

  \begin{MCalls}
    \Mcall{perm1,perm2,\kind}
  \end{MCalls}

  \begin{MParameters}
    \param{perm1, perm2}
    \eng{any lists denoting permutations}
  \end{MParameters}
  \begin{MOptions}
    \option{\kind=lexic,cixel,bruhat}
  \end{MOptions}

\begin{MIntro}
  \eng{The {\Mthis} function compares two permutations. The ordering
    is set by the argument \Mex{kind}, and the function returns
    \Mex{TRUE} if
    \Mmath{\Mex{perm1}>=\Mex{perm2}}{\mathtt{perm1}\ge\mathtt{perm2}}
    according to the choosen ordering.

\begin{itemize}
\item
{\Mex{\kind=lexic}} for lexicographic ordering.

\item
{\Mex{\kind=cixel}} for inverse lexicographic ordering  that  is
lexicographic ordering from right to left.

\item
{\Mex{\kind=bruhat}} to compare the two permutations according to the
Bruhat order.
\end{itemize}
}
\end{MIntro}

\begin{MExample}{ex1}
\begin{Mexin}
muEC::SG::CompPerm( [3,1,2], [1,3,2], lexic );
\end{Mexin}
\begin{Mexout}
                             TRUE
\end{Mexout}
\begin{Mexin}
muEC::SG::CompPerm( [3,1,2], [1,3,2], cixel );
\end{Mexin}
\begin{Mexout}
                             FALSE
\end{Mexout}
\begin{Mexin}
muEC::SG::CompPerm( [3,1,2], [1,3,2], bruhat );
\end{Mexin}
\begin{Mexout}
                             TRUE
\end{Mexout}
\end{MExample}

\MRelatedFunctions{ListPerm}
\end{Mhelppage}
