| Modifier and Type | Field and Description |
|---|---|
| public static final int | RECURSION_THRESHOLD
Threshold on the number of digits for selecting the recursive algorithm instead of the iterative algorithm. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static BigInteger | |
| pack-priv static BigInteger | parseDigitsRecursive(byte[] str, int from, int to, Map<Integer, BigInteger> powersOfTen)
Parses digits in O(N log N (log log N)) time. |
| RECURSION_THRESHOLD | back to summary |
|---|---|
| public static final int RECURSION_THRESHOLD Threshold on the number of digits for selecting the recursive algorithm instead of the iterative algorithm.
Set this to
Set this to Rationale for choosing a specific threshold value: The iterative algorithm has a smaller constant overhead than the recursive algorithm. We speculate that we break even somewhere at twice the threshold value. | |
| ParseDigitsTaskByteArray | back to summary |
|---|---|
| private ParseDigitsTaskByteArray() Don't let anyone instantiate this class. | |
| parseDigitsIterative | back to summary |
|---|---|
| pack-priv static BigInteger parseDigitsIterative(byte[] str, int from, int to) Parses digits in quadratic time O(N2). | |
| parseDigitsRecursive | back to summary |
|---|---|
| pack-priv static BigInteger parseDigitsRecursive(byte[] str, int from, int to, Map<Integer, BigInteger> powersOfTen) Parses digits in O(N log N (log log N)) time. A conventional recursive algorithm would require O(N1.5). We achieve better performance by performing multiplications of long bit sequences in the frequencey domain. | |