|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.uni_tuebingen.sfb.lichtenstein.combinatorics.CombinatoricOperator<T>
de.uni_tuebingen.sfb.lichtenstein.combinatorics.VariatorWithRepetition<T>
T - The type of the elements of which variations are to be returned.public final class VariatorWithRepetition<T>
A class that sequentially returns all variations with repetition of a certain number out of an array of given elements.
| Field Summary |
|---|
| Fields inherited from class de.uni_tuebingen.sfb.lichtenstein.combinatorics.CombinatoricOperator |
|---|
elements, indices |
| Constructor Summary | |
|---|---|
VariatorWithRepetition(T[] elements,
int r)
Initialize a new variator, with given elements and size of the arrays to be returned. |
|
| Method Summary | |
|---|---|
protected void |
computeNext()
Compute the next array of indices. |
protected void |
initializeIndices()
Initialize the array of indices. |
protected int |
initializeTotal(int n,
int r)
Compute the total number of elements to return. |
| Methods inherited from class de.uni_tuebingen.sfb.lichtenstein.combinatorics.CombinatoricOperator |
|---|
collectionToArray, factorial, getNumLeft, getTotal, hasNext, iterator, next, remove, reset |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public VariatorWithRepetition(T[] elements,
int r)
elements - The elements of which variations have to be computed.r - The size of the variations to compute.| 0 <= r| new.getTotal() ==
BigInteger.valueOf(elements.length).pow(r)| new.getNumLeft() == new.getTotal()| Method Detail |
|---|
protected void initializeIndices()
initializeIndices in class CombinatoricOperator<T>
protected int initializeTotal(int n,
int r)
initializeTotal in class CombinatoricOperator<T>n - The number of elements the operator works on.r - The size of the arrays to return.protected void computeNext()
computeNext in class CombinatoricOperator<T>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||