CM::Group::Sym - An implementation of the symmetric group S_n
CM::Group::Sym is an implementation of the Symmetric Group
use CM::Group::Sym; my $G = CM::Group::Sym->new({$n=>3});
This way you will generate S_3 with all it's 6 elements which are permutations. Say you want to print the operation table(Cayley table).
print $G 6 5 4 3 2 1 3 4 5 6 1 2 2 1 6 5 4 3 5 6 1 2 3 4 4 3 2 1 6 5 1 2 3 4 5 6
Note that those are only labels for the elements as printing the whole permutations would render the table useless since they wouldn't fit.
So if you want to see the meaning of the numbers(the permutations behind them) you can use str_perm()
print $G->str_perm; 1 -> 3 2 1 2 -> 2 3 1 3 -> 2 1 3 4 -> 3 1 2 5 -> 1 3 2 6 -> 1 2 3
This method will draw the cayley digraph of the group to png to the given $path.
Internally the permutations are stored in arrayref of arrayrefs and each cell contains a CM::Permutation object.
Stefan Petrea, <stefan.petrea at gmail.com>
<stefan.petrea at gmail.com>
To install CM::Permutation, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CM::Permutation
CPAN shell
perl -MCPAN -e shell install CM::Permutation
For more information on module installation, please visit the detailed CPAN module installation guide.