Class AtomContainerAtomPermutor
java.lang.Object
org.openscience.cdk.graph.Permutor
org.openscience.cdk.graph.AtomContainerPermutor
org.openscience.cdk.graph.AtomContainerAtomPermutor
- All Implemented Interfaces:
Iterator<IAtomContainer>
An atom container atom permutor that uses ranking and unranking to calculate
the next permutation in the series.
Typical use:
AtomContainerAtomPermutor permutor = new AtomContainerAtomPermutor(container);
while (permutor.hasNext()) {
IAtomContainer permutedContainer = permutor.next();
...
}- Author:
- maclean
- Keywords:
- permutation
- Created on:
- 2009-09-09
-
Field Summary
Fields inherited from class AtomContainerPermutor
atomContainerModifier and TypeFieldDescriptionprotected final IAtomContainerThe atom container that is permuted at each step. -
Constructor Summary
ConstructorsConstructorDescriptionAtomContainerAtomPermutor(IAtomContainer atomContainer) A permutor wraps the original atom container, and produces cloned (and permuted!) -
Method Summary
Modifier and TypeMethodDescriptioncontainerFromPermutation(int[] permutation) Generate the atom container with this permutation of the atoms.Methods inherited from class AtomContainerPermutor
next, randomNext, removeMethods inherited from class Permutor
calculateMaxRank, getCurrentPermutation, getNextPermutation, getRandomNextPermutation, getRank, hasNext, setPermutation, setRankModifier and TypeMethodDescriptionintCalculate the max possible rank for permutations of N numbers.int[]Get the permutation that is currently being used.int[]Get the next permutation in the list.int[]Randomly skip ahead in the list of permutations.intgetRank()Get the current rank.booleanhasNext()voidsetPermutation(int[] permutation) Set the currently used permutation.voidsetRank(int rank) Set the permutation to use, given its rank.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Iterator
forEachRemaining, hasNext
-
Constructor Details
-
AtomContainerAtomPermutor
A permutor wraps the original atom container, and produces cloned (and permuted!) copies on demand.- Parameters:
atomContainer- the atom container to permute
-
-
Method Details
-
containerFromPermutation
Generate the atom container with this permutation of the atoms.- Specified by:
containerFromPermutationin classAtomContainerPermutor- Parameters:
permutation- the permutation to use- Returns:
- the
-