public final class IntTuples extends Object implements IntCombinatorialPort
N arrays of integers of
the form arrayi = [0, 1, 2, ..., Ki].
arr lastUpdateDepth
[0, 0, 0] 0
[0, 0, 1] 2
[0, 1, 0] 1
[0, 1, 1] 2
[0, 2, 0] 1
[0, 2, 1] 2
[1, 0, 0] 0
[1, 0, 1] 2
[1, 1, 0] 1
[1, 1, 1] 2
[1, 2, 0] 1
[1, 2, 1] 2
Calculation of the next tuple occurs only on the invocation of take().
Note: method take() returns the same reference on each invocation.
IntCombinatorialPort.Iterator| Constructor and Description |
|---|
IntTuples(int... upperBounds) |
| Modifier and Type | Method and Description |
|---|---|
int |
getLastUpdateDepth() |
int[] |
getReference()
Returns the reference to the current iteration element
|
void |
reset()
Resets the iteration
|
int[] |
take()
Calculates and returns the next combination or null, if no more combinations exist.
|
public int[] take()
IntCombinatorialPorttake in interface IntCombinatorialPortpublic int getLastUpdateDepth()
public void reset()
reset in interface IntCombinatorialPortpublic int[] getReference()
IntCombinatorialPortgetReference in interface IntCombinatorialPortCopyright © 2017. All rights reserved.