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

\begin{Mhelppage}{Compo2Mat}{V. Prosper}%
  \begin{MInfo}
    \eng{a planar representation of a composition}
  \end{MInfo}
  
  \MDeclareOption{\alphabet}{alphabet}
  
  \begin{MCalls}
    \Mcall{compo\Mopt{,\alphabet=l}}
  \end{MCalls}

  \begin{MParameters}
    \param{compo}
    \eng{any list denoting a composition}
  \end{MParameters}
  \begin{MOptions}
    \option{\alphabet=l}
    \eng{specifying an alphabet}
  \end{MOptions}
  
  \begin{MIntro}
    \eng{The {\Mthis} function gives the diagram of a composition
      (i.e. a skew diagram of width 1, also called a ribbon), in the
      cartesian plane.
 
      A composition is a list of strictly positive integers.
 
      The following option is allowed: \Mex{\alphabet = l} where
      \Mpar{l} is a list of 1 to 3 components, \Mmath{l[1]}{l_1}
      filling the skew diagram, \Mmath{l[2]}{l_2} the inner diagram
      and \Mmath{l[3]}{l_3} the outside.
      }
  \end{MIntro}

\begin{MExample}{ex1}
\begin{Mexin}
muEC::COMP::Compo2Mat( [4,2,1,5] );
\end{Mexin}
\begin{Mexout}
                +-                           -+
                |  1, 1, 1, 1, 1, 0, 0, 0, 0  |
                |                             |
                |  0, 0, 0, 0, 1, 0, 0, 0, 0  |
                |                             |
                |  0, 0, 0, 0, 1, 1, 0, 0, 0  |
                |                             |
                |  0, 0, 0, 0, 0, 1, 1, 1, 1  |
                +-                           -+
\end{Mexout}
% \begin{Mexout}[hide]
   % array(1..4, 1..9,
   % (1,1) = 1, (1,2) = 1, (1,3) = 1, (1,4) = 1, (1,5) = 1,
   % (1,6) = 0, (1,7) = 0, (1,8) = 0, (1,9) = 0,
   % (2,1) = 0, (2,2) = 0, (2,3) = 0, (2,4) = 0, (2,5) = 1,
   % (2,6) = 0, (2,7) = 0, (2,8) = 0, (2,9) = 0,
   % (3,1) = 0, (3,2) = 0, (3,3) = 0, (3,4) = 0, (3,5) = 1,
   % (3,6) = 1, (3,7) = 0, (3,8) = 0, (3,9) = 0,
   % (4,1) = 0, (4,2) = 0, (4,3) = 0, (4,4) = 0, (4,5) = 0,
   % (4,6) = 1, (4,7) = 1, (4,8) = 1, (4,9) = 1)
% \end{Mexout}
\begin{Mexin}
print(Unquoted,
      muEC::COMP::Compo2Mat( [4,2,1,5], alphabet=["#",".",""] ) ):
\end{Mexin}
\begin{Mexout}
                +-                           -+
                |  #, #, #, #, #,  ,  ,  ,    |
                |                             |
                |  ., ., ., ., #,  ,  ,  ,    |
                |                             |
                |  ., ., ., ., #, #,  ,  ,    |
                |                             |
                |  ., ., ., ., ., #, #, #, #  |
                +-                           -+
\end{Mexout}
\end{MExample}

\MRelatedFunctions{ListCompo,TYP::IsCompo}
\end{Mhelppage}
