public class Float3NTTConvolutionStrategy extends FloatModMath implements ConvolutionStrategy
float
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 |
---|
Float3NTTConvolutionStrategy(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, negate
getModulus, modAdd, modMultiply, modSubtract, setModulus
public Float3NTTConvolutionStrategy(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
ConvolutionStrategy
convolute
in interface ConvolutionStrategy
x
- First data set.y
- Second data set.resultSize
- Number of elements needed in the result data.ApfloatRuntimeException