 Rank - Maple Help

 Rank
 compute the rank of an ordinary mixed radix tuple Calling Sequence Rank(a,m) Parameters

 a - {list,rtable}; tuple m - {list,rtable}; radices Description

 • Rank computes the rank of an ordinary mixed radix tuple.
 • The a parameter is the tuple. It is a list or one-dimensional rtable of nonnegative integers. The first element is the low-order element.
 • The m parameter is the radices. It is a list or one-dimensional rtable of positive integers. Examples

 > $\mathrm{with}\left(\mathrm{Iterator}:-\mathrm{MixedRadix}\right):$

Print the ranks of mixed radix tuples.

 > $\mathrm{radices}≔\left[3,1,4,1\right]:$
 > $M≔\mathrm{Iterator}:-\mathrm{MixedRadixTuples}\left(\mathrm{radices}\right)$
 ${M}{≔}{\mathrm{MixedRadixTuples}}{}\left(\left[{3}{,}{1}{,}{4}{,}{1}\right]\right)$ (1)
 > $\mathbf{for}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}a\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{in}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}M\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{do}\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\phantom{\rule[-0.0ex]{2.0em}{0.0ex}}\mathrm{printf}\left("%2d : %d\n",\mathrm{Rank}\left(a,\mathrm{radices}\right),a\right)\phantom{\rule[-0.0ex]{0.0em}{0.0ex}}\mathbf{end}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}\mathbf{do}:$
 1 : 0 0 0 0  2 : 1 0 0 0  3 : 2 0 0 0  4 : 0 0 1 0  5 : 1 0 1 0  6 : 2 0 1 0  7 : 0 0 2 0  8 : 1 0 2 0  9 : 2 0 2 0 10 : 0 0 3 0 11 : 1 0 3 0 12 : 2 0 3 0 Compatibility

 • The Iterator[MixedRadix][Rank] command was introduced in Maple 2016.