org.apfloat.internal
Class DoubleFactor3SixStepNTTStrategy

java.lang.Object
  extended by org.apfloat.internal.DoubleElementaryModMath
      extended by org.apfloat.internal.DoubleModMath
          extended by org.apfloat.internal.DoubleTableFNTStrategy
              extended by org.apfloat.internal.DoubleParallelFNTStrategy
                  extended by org.apfloat.internal.DoubleFactor3SixStepNTTStrategy
All Implemented Interfaces:
ParallelNTTStrategy, NTTStrategy

public class DoubleFactor3SixStepNTTStrategy
extends DoubleParallelFNTStrategy

A transform that implements a 3-point transform on top of the six-step Number Theoretic Transform that does transforms of length 2n.

Version:
1.5.1
Author:
Mikko Tommila

Field Summary
 
Fields inherited from class org.apfloat.internal.DoubleParallelFNTStrategy
parallelRunner
 
Constructor Summary
DoubleFactor3SixStepNTTStrategy(DoubleSixStepFNTStrategy factor2Strategy)
          Creates a new factor-3 transform strategy on top of a six-step transform.
 
Method Summary
 long getTransformLength(long size)
          Return the supported transform length for the specified data size.
 void inverseTransform(DataStorage dataStorage, int modulus, long totalTransformLength)
          Perform an inverse transform on the data.
 void setParallelRunner(ParallelRunner parallelRunner)
          Set the parallel runner to be used when executing the transform.
 void transform(DataStorage dataStorage, int modulus)
          Perform a forward transform on the data.
 
Methods inherited from class org.apfloat.internal.DoubleParallelFNTStrategy
multiplyElements, transformRows
 
Methods inherited from class org.apfloat.internal.DoubleTableFNTStrategy
inverseTableFNT, tableFNT
 
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

DoubleFactor3SixStepNTTStrategy

public DoubleFactor3SixStepNTTStrategy(DoubleSixStepFNTStrategy factor2Strategy)
Creates a new factor-3 transform strategy on top of a six-step transform. The underlying transform needs to be capable of only doing transforms of length 2n.

Parameters:
factor2Strategy - The underlying transformation strategy, that can be capable of only doing radix-2 transforms.
Method Detail

setParallelRunner

public void setParallelRunner(ParallelRunner parallelRunner)
Description copied from interface: ParallelNTTStrategy
Set the parallel runner to be used when executing the transform.

Specified by:
setParallelRunner in interface ParallelNTTStrategy
Overrides:
setParallelRunner in class DoubleParallelFNTStrategy
Parameters:
parallelRunner - The parallel runner.

transform

public void transform(DataStorage dataStorage,
                      int modulus)
               throws ApfloatRuntimeException
Description copied from interface: NTTStrategy
Perform a forward transform on the data.

Multiple moduli can be used, if the convolution algorithm uses the Chinese Remainder Theorem to calculate the final result.

Specified by:
transform in interface NTTStrategy
Overrides:
transform in class DoubleTableFNTStrategy
Parameters:
dataStorage - The data to be transformed.
modulus - Number of modulus to use (in case the transform supports multiple moduli).
Throws:
ApfloatRuntimeException

inverseTransform

public void inverseTransform(DataStorage dataStorage,
                             int modulus,
                             long totalTransformLength)
                      throws ApfloatRuntimeException
Description copied from interface: NTTStrategy
Perform an inverse transform on the data.

Multiple moduli can be used, if the convolution algorithm uses the Chinese Remainder Theorem to calculate the final result.

Specified by:
inverseTransform in interface NTTStrategy
Overrides:
inverseTransform in class DoubleTableFNTStrategy
Parameters:
dataStorage - The data to be transformed.
modulus - Number of modulus to use (in case the transform supports multiple moduli).
totalTransformLength - Total transform length; the final result elements are divided by this value.
Throws:
ApfloatRuntimeException

getTransformLength

public long getTransformLength(long size)
Description copied from interface: NTTStrategy
Return the supported transform length for the specified data size.

Specified by:
getTransformLength in interface NTTStrategy
Overrides:
getTransformLength in class DoubleTableFNTStrategy
Parameters:
size - Length of the data to be transformed.
Returns:
Length of the transform needed by this transform.