The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

CM::Permutation - Module for manipulating permutations

VERSION

version 0.06

DESCRIPTION

The module was written for carrying out permutation operations. The module is not written for generating permutations or counting them(to that end you can use Algorithm::Permute or Math::Counting)

At the moment the following are implemented(any feature that is currently listed as implemented has tests proving it):

  • permutation composition and conjugate permutations

  • inverse of a permutation

  • cycle decomposition

  • power of a permutation

  • '==' operator implemented (eq is the same)

TODO

  • breaking cycles into transpositions( maybe making a transposition class)

  • write a routine to count inversions and then even() and odd() methods for CM::Permutation

  • writing as much tests as possible

  • writing routine is_cycle() to check if a permutation is a cycle

  • get Cycle_Algorithm to use ArrayRef[CM::Permutation::Cycle] instead of what it's using now for storing the cycles and re-write tests

  • add order() method for ::Permutation (will be different for ::Permutation::Cycle , where just the length is the order) and will be computed as gcd of lenghts of cycles.::Permutation (will be different for ::Permutation::Cycle , where just the length is the order) and will be computed as gcd of lenghts of cycles.

AUTHOR

Stefan Petrea, <stefan.petrea at gmail.com>

SEE ALSO

Algorithm::Permute or Math::Counting

http://en.wikipedia.org/wiki/Cycle_(mathematics)