%%
%% This is file `permute.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% permute.dtx  (with options: `package')
%% 
%% (w)(c) 1997,1998,1999 by Carsten Heinz
%% 
%% All files of the permute package are distributed freely.
%% You are not allowed to take money for the distribution or use of these
%% files, except for a nominal charge for copying etc..
%% 
%% The files are distributed without any warranty, express or implied, as to
%% merchantability or fitness for any particular purpose.
%% 
%% You are not allowed to distribute any changed version of the package,
%% neither under the same name nor under a different one.
%% You are not allowed to change one of the files, except using a clearly
%% different file name.
%% 
\ProvidesPackage{permute}[1999/11/10 v0.12 (aeio)(cdt)(knm)]
\def\pmt@firsttrue{\let\pmt@iffirst\iftrue}
\def\pmt@firstfalse{\let\pmt@iffirst\iffalse}
\def\pmt@foundtrue{\let\pmt@iffound\iftrue}
\def\pmt@foundfalse{\let\pmt@iffound\iffalse}
\def\pmt@septrue{\let\pmt@ifsep\iftrue}
\def\pmt@sepfalse{\let\pmt@ifsep\iffalse}
\def\pmt@GetPreimageOf#1#2{%
    \def\pmt@image{#1}\pmt@firsttrue
    \expandafter\pmt@GIO@#2\relax\relax}
\def\pmt@GetImageOf#1#2{%
    \def\pmt@preimage{#1}\let\pmt@gio\@empty \pmt@firstfalse
    \expandafter\pmt@GIO@#2\relax\relax
    \let#2\pmt@gio}
\def\pmt@GIO@#1#2{%
    \pmt@iffirst \def\pmt@preimage{#2}\else
                 \def\pmt@image{#1}\fi
    \ifx\pmt@image\pmt@preimage
        \def\pmt@preimage{#1}\def\pmt@image{#2}\pmt@foundtrue
        \expandafter\pmt@GIO@@
    \else
        \ifx\relax#2%
            \pmt@foundfalse
            \pmt@iffirst \let\pmt@preimage\pmt@image
                   \else \let\pmt@image\pmt@preimage \fi
            \expandafter\@gobbletwo
        \else
            \pmt@iffirst\else \pmt@AddTo\pmt@gio{{#1}{#2}}\fi
        \fi
        \expandafter\pmt@GIO@
    \fi}
\def\pmt@GIO@@#1\relax\relax{%
    \pmt@iffirst\else \pmt@AddTo\pmt@gio{#1}\fi}
\def\pmt@AddTo#1#2{\expandafter\def\expandafter#1\expandafter{#1#2}}
\def\pmt@Extend#1#2{%
    \expandafter\pmt@AddTo\expandafter#1\expandafter{#2}}
\def\pmt@Whirl#1#2#3{%
    \let\pmt@b#2\let\pmt@c#3\let\pmt@a\@empty
    \pmt@Whirl@
    \let#1\pmt@a}
\def\pmt@Whirl@{%
    \ifx\pmt@c\@empty
        \pmt@Extend\pmt@a\pmt@b
    \else
        \expandafter\pmt@Whirl@@\pmt@c\relax
        \expandafter\pmt@Whirl@
    \fi}
\def\pmt@Whirl@@#1#2#3\relax{%
    \def\pmt@first{#1}\def\pmt@c{#3}%
    \pmt@GetImageOf{#2}\pmt@b
    \ifx\pmt@first\pmt@image\else
        \def\pmt@first{{#1}}%
        \pmt@Extend\pmt@first{\expandafter{\pmt@image}}%
        \pmt@Extend\pmt@a\pmt@first
    \fi}
\def\pmt@InputError#1{\PackageError{Permute}{#1}\@ehd}
\def\pmt@GetPmt#1#2{%
    \def\pmt@a{#2}%
    \pmt@foundtrue \pmt@firstfalse
    \@ifnextchar({\let\pmt@a\@empty \pmt@GetCPmt}%
                 \pmt@GetVPmt
    #2\relax\relax
    \let#1\pmt@a}
\def\pmt@GetVPmt#1#2{%
    \ifx\relax#2%
        \ifx\relax#1\else
            \pmt@InputError{Odd number of tokens}%
            \let\pmt@a\@empty
        \fi
    \else
        \expandafter\pmt@GetVPmt
    \fi}
\def\pmt@GetCPmt#1{%
    \ifx#1\relax
        \pmt@iffound\else \pmt@InputError{Missing `)'}\fi
        \expandafter\@gobble
    \else
        \ifx#1)%
            \pmt@iffound
                \pmt@InputError{Extra `)'}%
            \else
                \pmt@iffirst\else
                    \pmt@Extend\pmt@c\pmt@first
                    \pmt@Whirl\pmt@a\pmt@a\pmt@c
                \fi
                \pmt@foundtrue
            \fi
        \else
        \ifx#1(%
            \pmt@iffound\else
                \pmt@InputError{Extra `(' or missing `)'}%
            \fi
            \pmt@firsttrue \pmt@foundfalse
        \else
        \pmt@iffound
            \pmt@InputError{Missing `('}%
        \else
            \pmt@iffirst
                \pmt@firstfalse \def\pmt@first{{#1}}\def\pmt@c{{#1}}%
            \else
                \pmt@AddTo\pmt@c{{#1}{#1}}%
            \fi
        \fi\fi\fi
    \fi
    \pmt@GetCPmt}
\def\pmt@PrintVPmt#1{%
    \let\pmt@a#1\pmt@sepfalse
    \ensuremath{\pmtldelim
                \expandafter\pmt@PrintVPmt@\pmt@order\relax
                \pmtrdelim}}
\def\pmt@PrintVPmt@#1{%
    \ifx\relax#1\@empty \else
        \pmt@GetImageOf{#1}\pmt@a
        \pmt@ifsep \pmt@separator \else \pmt@septrue \fi
        \mkern1mu%
        \pmt@ifshort \pmt@image
               \else{\pmt@preimage\atop\pmt@image}\fi
        \mkern1mu%
        \expandafter\pmt@PrintVPmt@
    \fi}
\def\pmtshorttrue{\let\pmt@ifshort\iftrue}
\def\pmtshortfalse{\let\pmt@ifshort\iffalse}
\pmtshortfalse
\def\pmt@GetFirst#1#2\relax{\def\pmt@first{#1}}
\def\pmt@PrintPmt#1{%
    \let\pmt@a#1%
    \ifx\pmt@a\@empty \pmtidname \else
        \expandafter\pmt@PrintPmt@\pmt@order\relax
    \fi}
\def\pmt@PrintPmt@#1{%
    \ifx\relax#1\@empty
        \expandafter\pmt@PrintPmt@@
    \else
        \def\pmt@first{#1}\pmt@PrintCycle
        \expandafter\pmt@PrintPmt@
    \fi}
\def\pmt@PrintPmt@@{%
    \ifx\pmt@a\@empty\else
        \expandafter\pmt@GetFirst\pmt@a\relax
        \pmt@PrintCycle
        \expandafter\pmt@PrintPmt@@
    \fi}
\def\pmt@PrintCycle{%
    \expandafter\pmt@GetImageOf\expandafter{\pmt@first}\pmt@a
    \pmt@iffound
        (\pmt@preimage\pmt@separator\pmt@image
         \ifx\pmt@a\@empty\else \pmt@PrintCycle@\pmt@image \fi
        )%
    \fi}
\def\pmt@PrintCycle@#1{%
    \expandafter\pmt@GetImageOf\expandafter{#1}\pmt@a
    \ifx\pmt@image\pmt@first\else
        \pmt@separator\pmt@image
        \ifx\pmt@a\@empty \expandafter\@gobblefour \fi
        \expandafter\pmt@PrintCycle@\expandafter\pmt@image
    \fi}
\newcommand*\pmtidname{id}
\newcommand*\pmtprintorder{123456789abcdefghi}
\newcommand*\pmtseparator{ }
\newcommand*\pmtldelim{\left(}
\newcommand*\pmtrdelim{\right)}
\newcommand*\pmttableborders{lt}
\newcommand*\pmtarraystretch{2}
\def\pmt@GetPrintArgs#1{%
    \let\pmt@order\pmtprintorder \def\pmt@next{#1}%
    \@ifstar{\let\pmt@separator\pmtseparator \pmt@GPA@}%
            {\let\pmt@separator\@empty \pmt@GPA@}}
\def\pmt@GPA@{\@ifnextchar[\pmt@GPA@@\pmt@next}
\def\pmt@GPA@@[#1]{\def\pmt@order{#1}\pmt@next}
\newcommand*\pmt {\pmt@GetPrintArgs{\pmt@\pmt@PrintPmt}}
\newcommand*\pmtv{\pmt@GetPrintArgs{\pmt@\pmt@PrintVPmt}}
\def\pmt@#1#2{\pmt@GetPmt\pmt@a{#2}#1\pmt@a}
\newcommand*\pmtprint {\pmt@GetPrintArgs{\pmt@PrintPmt\pmt@curr}}
\newcommand*\pmtvprint{\pmt@GetPrintArgs{\pmt@PrintVPmt\pmt@curr}}
\def\pmt@OptName#1{\def\pmt@next##1{#1}%
    \@ifnextchar[\pmt@OptName@{\pmt@next\pmt@curr}}
\def\pmt@OptName@[#1]{%
    \pmt@LoadPmt{#1}\pmt@a
    \expandafter\pmt@next\csname pmt@s@#1\endcsname}
\def\pmt@LoadPmt#1#2{%
    \@ifundefined{pmt@s@#1}%
        {\expandafter\let\csname pmt@s@#1\endcsname\@empty}
    \expandafter\let\expandafter#2\csname pmt@s@#1\endcsname}
\def\pmtsave#1{\expandafter\let\csname pmt@s@#1\endcsname\pmt@curr}
\def\pmtload#1{\pmt@LoadPmt{#1}\pmt@curr}
\newcommand*\pmtid{\pmt@OptName{\let##1\@empty \ignorespaces}}
\pmtid
\newcommand*\pmtdo{\pmt@OptName{\pmtdo@##1\pmt@a##1}}
\newcommand*\pmtcirc{\pmt@OptName{\pmtdo@##1##1\pmt@a}}
\def\pmtdo@#1#2#3#4{\pmt@GetPmt\pmt@a{#4}\pmt@Whirl#1#2#3\ignorespaces}
\newcommand*\pmtimageof{\pmtimageof@\pmt@GetImageOf\pmt@image}
\newcommand*\pmtpreimageof{\pmtimageof@\pmt@GetPreimageOf\pmt@preimage}
\def\pmtimageof@#1#2{%
    \@ifnextchar[{\pmtimageof@@#1#2}{\pmtimageof@@#1#2[]}}
\def\pmtimageof@#1#2[#3]#4{%
     \ifx\@empty#3\@empty
         \let\pmt@a\pmt@curr
     \else
         \pmt@LoadPmt{#3}\pmt@a
     \fi
     #1{#4}\pmt@a
     #2}
\newcommand*\pmttable
    {\begingroup
     \def\pmtprint{\let\pmt@order\pmt@porder\pmt@PrintPmt\pmt@curr}%
     \pmt@GetPrintArgs\pmt@PrintTable}
\newcommand*\pmtvtable
    {\begingroup
     \def\pmtprint{\let\pmt@order\pmt@porder\pmt@PrintVPmt\pmt@curr}%
     \pmt@GetPrintArgs\pmt@PrintTable}
\def\pmt@PrintTable#1#2{%
    \let\pmt@ifleft\iffalse
    \pmt@topfalse
    \expandafter\pmt@SetBorders\pmttableborders\relax
    \let\pmt@porder\pmt@order
    \let\arraystretch\pmtarraystretch
    \@tempcnta\z@ \pmt@for{\advance\@tempcnta\@ne}{#2}%
    \edef\pmt@next{%
        \noexpand\begin{tabular}{\pmt@ifleft c|\else p{\z@}@{}\fi
            *{\the\@tempcnta}{@{\ }c@{\ }}}}%
    \pmt@next
    \pmt@iftop
        \pmt@ifleft \ensuremath{\circ}\fi
        \pmt@for{&\pmtid\pmtdo{##1}\pmtprint}{#1}%
        \\ \hline
    \fi
    \gdef\pmt@topperms{#2}\pmt@toptrue
    \pmt@for{%
        \pmt@iftop \pmt@topfalse \else \expandafter\\\fi
        \pmt@ifleft \pmtid\pmtdo{##1}\pmtprint \fi
        \pmt@PrintTableLine{##1}}%
    {#1}%
    \end{tabular}\endgroup}
\def\pmt@PrintTableLine#1{%
    \def\pmt@next{\pmt@PrintTableLine@{#1}}%
    \expandafter\pmt@next\pmt@topperms,\relax,}
\def\pmt@PrintTableLine@#1#2,{%
    \ifx\relax#2\else
        \def\pmt@next{&\pmtid\pmtdo{#2}\pmtdo{#1}\pmtprint
                      \pmt@PrintTableLine@{#1}}%
        \expandafter\pmt@next
    \fi}
\def\pmt@for#1#2{%
    \gdef\pmt@for@##1,{%
        \ifx\relax##1\else
            \def\pmt@next{#1\expandafter\pmt@for@}%
            \expandafter\pmt@next
        \fi}%
    \pmt@for@#2,\relax,}
\def\pmt@SetBorders#1{%
    \ifx\relax#1\else
        \if l#1\pmt@lefttrue \fi
        \if t#1\pmt@toptrue \fi
        \expandafter\pmt@SetBorders
    \fi}
\def\pmt@topfalse{\global\let\pmt@iftop\iffalse}
\def\pmt@toptrue{\global\let\pmt@iftop\iftrue}
\def\pmt@lefttrue{\let\pmt@ifleft\iftrue}
\endinput
%%
%% End of file `permute.sty'.
