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

\begin{Mhelppage}{Perm2Rise}%
  {V. Prosper}%
  \begin{MInfo}
    \eng{computes the list of rises of a permutation}
  \end{MInfo}
  

  \begin{MCalls}
    \Mcall{perm\Mopt{,nb,rin,corin}}
  \end{MCalls}

\begin{MParameters}
  \param{perm}
  \eng{any list denoting a permutation} 
  \param{nb}
  \eng{only counts objects} 
  \param{rin}
  \eng{sum of rise positions} 
  \param{corin}
  \eng{sum of values} 
\end{MParameters}

\begin{MIntro}
  \eng{
The {\Mthis} function computes the list of rises  of  the   permutation
\Mex{perm}, i.e. the  list  of  positions  \Mmath{i}{i}, such   that
\Mmath{\Mex{perm}[i] < \Mex{perm}[i+1]}{\mathtt{perm}_i<\mathtt{perm}_{i+1}}.

When called  with the second  argument \Mex{rin}, it returns the sum  of the
rise positions (rise index).

When called  with the second argument \Mex{corin}, it returns the sum of the
values (\Mex{n} - rise position), where \Mex{n} is equal to \Mex{nops(perm)}.
}
\end{MIntro}

\begin{MExample}{ex1}
\begin{Mexin}
muEC::SG::Perm2Rise( [3,1,4,2,6,5,7,8] );
\end{Mexin}
\begin{Mexout}
                         [2, 4, 6, 7]
\end{Mexout}
\begin{Mexin}
muEC::SG::Perm2Rise( [3,1,4,2,6,5,7,8], nb );
\end{Mexin}
\begin{Mexout}
                               4
\end{Mexout}
\begin{Mexin}
muEC::SG::Perm2Rise( [3,1,4,2,6,5,7,8], rin );
\end{Mexin}
\begin{Mexout}
                               9
\end{Mexout}
\begin{Mexin}
muEC::SG::Perm2Rise( [3,1,4,2,6,5,7,8], corin );
\end{Mexin}
\begin{Mexout}
                              13
\end{Mexout}
\end{MExample}

\MRelatedFunctions{Perm2Desc}
\end{Mhelppage}
