|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jgrapht.experimental.permutation.PermutationFactory
public class PermutationFactory
Factory to create Permutations of several types and use them as Enumerations. Note that callers may use them directly if they need to use special concrete methods.
These types are:
example: source=[1,2,3] result=[1,2,3][1,3,2][2,1,3][2,3,1][3,1,2][3,2,1]
example: source=[1,1,2] result=[1,1,2][1,2,1][2,1,1]
example: assume source=the groups are sizes are : 1,2,2,5 elements will be created: (1),(2,3),(4,5).
result=[1,(2,3),(4,5)] [1,(2,3),(5,4)] [1,(3,2),(5,4)] [1,(3,2),(4,5)]. In this example the number of possiblities is 1! x 2! x 2! = 4
Constructor Summary | |
---|---|
PermutationFactory()
|
Method Summary | |
---|---|
static ArrayPermutationsIter |
createByGroups(int[] groupSizesArray)
For efficiency, try putting the biggest groups at the beggining of the array. |
static ArrayPermutationsIter |
createRegular(int[] permSourceArray)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PermutationFactory()
Method Detail |
---|
public static ArrayPermutationsIter createRegular(int[] permSourceArray)
public static ArrayPermutationsIter createByGroups(int[] groupSizesArray)
groupSizesArray
- . example [3,2] will create an array (0,1,2)(3,4)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |