|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.expasy.jpl.commons.base.math.MixedRadixNtupleFactory
public final class MixedRadixNtupleFactory
This class generates generalized n-tuples.
| Nested Class Summary | |
|---|---|
static class |
MixedRadixNtupleFactory.BadRadixException
|
| Method Summary | |
|---|---|
static long |
computeTupleNumber(int[] radices)
Compute the number of all the t-uples given the radices. |
static int[] |
convertDecimal2Tuple(int code,
int radix)
Convert decimal to t-uple of given radix. |
static int[] |
convertDecimal2Tuple(int radix,
int code,
int size)
Convert decimal to t-uple of given radix. |
static int[] |
convertString2Tuple(String tuple)
Convert string to t-uple. |
static int |
convertTuple2Decimal(int[] tuple,
int radix)
Convert a tuple from radix to radix 10 (decimal). |
static MixedRadixNtupleFactory |
newInstance()
Generate all tuples considering the given strict limits (excluded). |
static MixedRadixNtupleFactory |
newInstance(int limit)
|
static String |
toString(List<int[]> ntuples)
A simple string converter for n-tuples. |
List<int[]> |
transform(int[] radices)
This algorithm generate all n-tuples where each ai have different upper limit li. |
List<int[]> |
transform(int n,
int radix)
This algorithm generate all n-tuples with same radix for
any positions. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static MixedRadixNtupleFactory newInstance()
public static MixedRadixNtupleFactory newInstance(int limit)
public static long computeTupleNumber(int[] radices)
radices - the radices by position.
public static int convertTuple2Decimal(int[] tuple,
int radix)
throws MixedRadixNtupleFactory.BadRadixException
radix - the fixed radix (max Character.MAX_RADIX).tuple - the tuple to compute the code from.
MixedRadixNtupleFactory.BadRadixException - if radix is > Character.MAX_RADIX.
public static int[] convertDecimal2Tuple(int code,
int radix)
throws MixedRadixNtupleFactory.BadRadixException
radix - the fixed radix (max 36)code - the code to compute the tuple from
MixedRadixNtupleFactory.BadRadixException - if radix > 36
public static int[] convertDecimal2Tuple(int radix,
int code,
int size)
throws MixedRadixNtupleFactory.BadRadixException
radix - the fixed radix (max 36)code - the code to compute the tuple fromsize - the size of the returned tuple rq: if size > tuple then
add '0' else truncate.
MixedRadixNtupleFactory.BadRadixException - if radix > 36public static int[] convertString2Tuple(String tuple)
tuple - the string to convert.
public List<int[]> transform(int n,
int radix)
n-tuples with same radix for
any positions.
n - the number of digits.radix - the radix for each digit.
public List<int[]> transform(int[] radices)
transform in interface org.apache.commons.collections15.Transformer<int[],List<int[]>>radices - the limits [l0, ..., ln] such as ai in [0, li[.
public static String toString(List<int[]> ntuples)
ntuples - the n-tuples to convert.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||