org.apfloat.internal
Class Double3NTTConvolutionStrategy

java.lang.Object
  |
  +--org.apfloat.internal.DoubleElementaryModMath
        |
        +--org.apfloat.internal.DoubleModMath
              |
              +--org.apfloat.internal.Double3NTTConvolutionStrategy
All Implemented Interfaces:
ConvolutionStrategy, DoubleModConstants

public class Double3NTTConvolutionStrategy
extends DoubleModMath
implements ConvolutionStrategy, DoubleModConstants

Convolution methods in the transform domain for the double 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.


Field Summary
 
Fields inherited from interface org.apfloat.internal.DoubleModConstants
MAX_POWER_OF_TWO_BASE, MAX_POWER_OF_TWO_BITS, MAX_TRANSFORM_LENGTH, MODULUS, PRIMITIVE_ROOT
 
Constructor Summary
Double3NTTConvolutionStrategy(int radix, NTTStrategy transform)
          Creates a new convoluter that uses the specified transform for transforming the data.
 
Method Summary
 DataStorage convolute(DataStorage x, DataStorage y, long resultSize)
          Convolutes the two sets of data.
 
Methods inherited from class org.apfloat.internal.DoubleModMath
createWTable, getForwardNthRoot, getInverseNthRoot, modDivide, modInverse, modPow, negate
 
Methods inherited from class org.apfloat.internal.DoubleElementaryModMath
getModulus, modAdd, modMultiply, modSubtract, setModulus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Double3NTTConvolutionStrategy

public Double3NTTConvolutionStrategy(int radix,
                                     NTTStrategy transform)
Creates a new convoluter that uses the specified transform for transforming the data.

Parameters:
radix - The radix that will be used.
transform - The transform that will be used.
Method Detail

convolute

public DataStorage convolute(DataStorage x,
                             DataStorage y,
                             long resultSize)
                      throws ApfloatRuntimeException
Description copied from interface: ConvolutionStrategy
Convolutes the two sets of data.

Specified by:
convolute in interface ConvolutionStrategy
Parameters:
x - First data set.
y - Second data set.
resultSize - Number of elements needed in the result data.
Returns:
The convolved data.
ApfloatRuntimeException