Is there C++ template class that implements operations with permutations and permutation group? Such class has to implement finding product and inverse, multiplication, etc.
+1
A:
This is the best I've found... but is in C so you'll have to write a wrapper. CodeCogs also gives you a library on combinatorics.
yeyeyerman
2009-07-30 11:03:11
A:
Janaka
2009-07-30 11:14:50
Please, "algorithm" not "algorithm.h"!
KTC
2009-07-30 11:27:20
How does it help me to find inverse permution for instance?
Alexey Malistov
2009-07-30 11:29:29
It doesn't. This function merely enumerates the members of the permutation group. It knows nothing about the structure of the group -- it just relies on the elements of the input array having a defined order.
Steve Jessop
2009-07-30 12:18:33
A:
I don't know of one, but it should be easy enough to implement. Internally you could represent the permutation as a vector e.g. (1 3 4 2 7 5 6) being a perm of 1-7 sending 1->1, 2->3, 3->4, 4->2 etc. or as a set of cycles e.g. (1) (2 3 4) (5 7 6), and implement the operations in terms of these. Presumably the template argument would be the size of the permutation group.