|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apfloat.internal.DoubleElementaryModMath
org.apfloat.internal.DoubleModMath
org.apfloat.internal.DoubleTableFNTStrategy
public class DoubleTableFNTStrategy
Fast Number Theoretic Transform that uses lookup tables for powers of n:th root of unity and permutation indexes.
All access to this class must be externally synchronized.
Constructor Summary | |
---|---|
DoubleTableFNTStrategy()
Default constructor. |
Method Summary | |
---|---|
long |
getTransformLength(long size)
Return the supported transform length for the specified data size. |
protected void |
inverseTableFNT(ArrayAccess arrayAccess,
double[] wTable,
int[] permutationTable)
Inverse (Cooley-Tukey) fast Number Theoretic Transform. |
void |
inverseTransform(DataStorage dataStorage,
int modulus,
long totalTransformLength)
Perform an inverse transform on the data. |
protected void |
tableFNT(ArrayAccess arrayAccess,
double[] wTable,
int[] permutationTable)
Forward (Sande-Tukey) fast Number Theoretic Transform. |
void |
transform(DataStorage dataStorage,
int modulus)
Perform a forward transform on the 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 |
---|
public DoubleTableFNTStrategy()
Method Detail |
---|
public void transform(DataStorage dataStorage, int modulus) throws ApfloatRuntimeException
NTTStrategy
Multiple moduli can be used, if the convolution algorithm uses the Chinese Remainder Theorem to calculate the final result.
transform
in interface NTTStrategy
dataStorage
- The data to be transformed.modulus
- Number of modulus to use (in case the transform supports multiple moduli).
ApfloatRuntimeException
public void inverseTransform(DataStorage dataStorage, int modulus, long totalTransformLength) throws ApfloatRuntimeException
NTTStrategy
Multiple moduli can be used, if the convolution algorithm uses the Chinese Remainder Theorem to calculate the final result.
inverseTransform
in interface NTTStrategy
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.
ApfloatRuntimeException
public long getTransformLength(long size)
NTTStrategy
getTransformLength
in interface NTTStrategy
size
- Length of the data to be transformed.
protected void tableFNT(ArrayAccess arrayAccess, double[] wTable, int[] permutationTable) throws ApfloatRuntimeException
arrayAccess
- The data array to transform.wTable
- Table of powers of n:th root of unity w
modulo the current modulus.permutationTable
- Table of permutation indexes, or null
if the data should not be permuted.
ApfloatRuntimeException
protected void inverseTableFNT(ArrayAccess arrayAccess, double[] wTable, int[] permutationTable) throws ApfloatRuntimeException
arrayAccess
- The data array to transform.wTable
- Table of powers of n:th root of unity w
modulo the current modulus.permutationTable
- Table of permutation indexes, or null
if the data should not be permuted.
ApfloatRuntimeException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |