|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apfloat.internal.DoubleBaseMath
org.apfloat.internal.DoubleCRTMath
org.apfloat.internal.DoubleCarryCRT
public class DoubleCarryCRT
Class for performing the final step of a three-modulus
Number Theoretic Transform based convolution. Works for the
double
type.
The algorithm is parallelized for multiprocessor computers, if the data fits in memory.
The parallelization works so that the carry-CRT is done in blocks in parallel. As a final step, a second pass is done through the data set to propagate the carries from one block to the next.
Constructor Summary | |
---|---|
DoubleCarryCRT(int radix)
Creates a carry-CRT object using the specified radix. |
Method Summary | |
---|---|
DataStorage |
carryCRT(DataStorage resultMod0,
DataStorage resultMod1,
DataStorage resultMod2,
long resultSize)
Calculate the final result of a three-NTT convolution. |
void |
setParallelRunner(ParallelRunner parallelRunner)
Set the parallel runner to be used when executing the CRT. |
Methods inherited from class org.apfloat.internal.DoubleCRTMath |
---|
add, compare, divide, multiply, subtract |
Methods inherited from class org.apfloat.internal.DoubleBaseMath |
---|
baseAdd, baseDivide, baseMultiplyAdd, baseSubtract |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DoubleCarryCRT(int radix)
radix
- The radix that will be used.Method Detail |
---|
public DataStorage carryCRT(DataStorage resultMod0, DataStorage resultMod1, DataStorage resultMod2, long resultSize) throws ApfloatRuntimeException
Performs a Chinese Remainder Theorem (CRT) on each element of the three result data sets to get the result of each element modulo the product of the three moduli. Then it calculates the carries to get the final result.
Note that the return value's initial word may be zero or non-zero, depending on how large the result is.
Assumes that MODULUS[0] > MODULUS[1] > MODULUS[2]
.
resultMod0
- The result modulo MODULUS[0]
.resultMod1
- The result modulo MODULUS[1]
.resultMod2
- The result modulo MODULUS[2]
.resultSize
- The number of elements needed in the final result.
ApfloatRuntimeException
public void setParallelRunner(ParallelRunner parallelRunner)
parallelRunner
- The parallel runner.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |