Package org.apfloat.internal
Class DoubleTableFNTStrategy
- java.lang.Object
-
- org.apfloat.internal.DoubleElementaryModMath
-
- org.apfloat.internal.DoubleModMath
-
- org.apfloat.internal.DoubleTableFNT
-
- org.apfloat.internal.DoubleTableFNTStrategy
-
- All Implemented Interfaces:
NTTStrategy
public class DoubleTableFNTStrategy extends DoubleTableFNT implements NTTStrategy
Fast Number Theoretic Transform strategy that uses lookup tables for powers of n:th root of unity and permutation indexes.All access to this class must be externally synchronized.
- Version:
- 1.9.0
-
-
Constructor Summary
Constructors Constructor Description DoubleTableFNTStrategy()Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voiddivideElements(ArrayAccess arrayAccess, double divisor)longgetTransformLength(long size)Return the supported transform length for the specified data size.voidinverseTransform(DataStorage dataStorage, int modulus, long totalTransformLength)Perform an inverse transform on the data.voidtransform(DataStorage dataStorage, int modulus)Perform a forward transform on the data.-
Methods inherited from class org.apfloat.internal.DoubleTableFNT
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
-
-
-
-
Method Detail
-
transform
public void transform(DataStorage dataStorage, int modulus) throws ApfloatRuntimeException
Description copied from interface:NTTStrategyPerform 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:
transformin interfaceNTTStrategy- 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:NTTStrategyPerform 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:
inverseTransformin interfaceNTTStrategy- 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:NTTStrategyReturn the supported transform length for the specified data size.- Specified by:
getTransformLengthin interfaceNTTStrategy- Parameters:
size- Length of the data to be transformed.- Returns:
- Length of the transform needed by this transform.
-
divideElements
private void divideElements(ArrayAccess arrayAccess, double divisor) throws ApfloatRuntimeException
- Throws:
ApfloatRuntimeException
-
-