public class MixedRadixNtupleGenerator extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
MixedRadixNtupleGenerator.Handler |
static class |
MixedRadixNtupleGenerator.NtupleContainer
A reusable container that stores generated n-tuples
|
| Constructor and Description |
|---|
MixedRadixNtupleGenerator(MixedRadixNtupleGenerator.Handler handler) |
| Modifier and Type | Method and Description |
|---|---|
static long |
countNtuples(int[] radices)
Compute the number of n-tuples given the radices.
|
void |
generate(int[] radices)
This algorithm generates all n-tuples with different radices
and give them to the Handler>
[from knuth the AOCP, section 7.1.1 : Algorithm M]
|
void |
generate(int n,
int radix)
This algorithm generate all
n-tuples with the same radix at
any positions. |
static String |
toString(List<int[]> ntuples)
A simple string converter for n-tuples.
|
public MixedRadixNtupleGenerator(MixedRadixNtupleGenerator.Handler handler)
handler - provides the callback method that have to handle n-tuplepublic void generate(int n,
int radix)
n-tuples with the same radix at
any positions.n - the tuple length.radix - the radix for each digit.public void generate(int[] radices)
radices - the number bases [b0, ..., bn] such as ai in [0, bi[.public static long countNtuples(int[] radices)
radices - the radices by position.Copyright © 2016. All Rights Reserved.