public class Long3NTTConvolutionStrategy extends LongModMath implements ConvolutionStrategy
long type.
Multiplication can be done in linear time in the transform domain, where
the multiplication is simply an element-by-element multiplication.This implementation uses three Number Theoretic Transforms to do the convolution and the Chinese Remainder Theorem to get the final result.
After transforming the data, the in-place multiplication (or squaring) of the data elements is done using a parallel algorithm, if the data fits in memory.
All access to this class must be externally synchronized.
| Constructor and Description |
|---|
Long3NTTConvolutionStrategy(int radix,
NTTStrategy transform)
Creates a new convoluter that uses the specified
transform for transforming the data.
|
| Modifier and Type | Method and Description |
|---|---|
DataStorage |
convolute(DataStorage x,
DataStorage y,
long resultSize)
Convolutes the two sets of data.
|
createWTable, getForwardNthRoot, getInverseNthRoot, modDivide, modInverse, modPow, negategetModulus, modAdd, modMultiply, modSubtract, setModuluspublic Long3NTTConvolutionStrategy(int radix,
NTTStrategy transform)
radix - The radix that will be used.transform - The transform that will be used.public DataStorage convolute(DataStorage x, DataStorage y, long resultSize) throws ApfloatRuntimeException
ConvolutionStrategyconvolute in interface ConvolutionStrategyx - First data set.y - Second data set.resultSize - Number of elements needed in the result data.ApfloatRuntimeException