The attached patches do two things:
1) Add a class called "Permutor" that generates arrays of ints like "[0,2,1]"
2) Re-writes the AtomContainer[Atom|Bond]Permutor classses to use this
The reason for doing this is mainly for testing, as the provided
permutation generator is more functionally rich. There are N!
permutations of N things, so a molecule with 10 atoms has 10! or
3,628,800 permutations while one with 20 atoms has
2,432,902,008,176,640,000 - clearly far too many to test. What can be
done with the Permutor class is randomly sample permutations by simply
skipping ahead in the list.
In addition, the ranking/unranking method that the class uses means it
is possible to go to a particular permutation very easily. This is
explained to some extent in the comments of the class.
The commit hash is :
if that helps.
Log in to post a comment.