public class RandomPermutationGenerator extends PermutationGenerator
| Modifier and Type | Field and Description |
|---|---|
protected int[] |
orig |
protected java.util.Random |
rand |
protected int |
seed |
nElements, nGenerated, nPermutations, permutation| Constructor and Description |
|---|
RandomPermutationGenerator(int nElements,
int nPermutations,
int seed) |
| Modifier and Type | Method and Description |
|---|---|
protected long |
computeNumberOfPermutations() |
int[] |
next()
return the next permutation or throw a NoSuchElementException if there is none.
|
void |
reset() |
getNumberOfGeneratedPermutations, getNumberOfPermutations, hasNext, initPermutations, printOn, printOnpublic RandomPermutationGenerator(int nElements,
int nPermutations,
int seed)
protected long computeNumberOfPermutations()
computeNumberOfPermutations in class PermutationGeneratorpublic void reset()
reset in class PermutationGeneratorpublic int[] next()
PermutationGeneratornext in class PermutationGenerator