|
|||||||||
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
org.apfloat.internal.DoubleParallelFNTStrategy
org.apfloat.internal.DoubleSixStepFNTStrategy
public class DoubleSixStepFNTStrategy
Fast Number Theoretic Transform that uses a "six-step" algorithm to calculate a long transform more efficiently on cache-based memory architectures.
When the data to be transformed is considered to be an n1 x n2 matrix of data, instead of a linear array, the six steps are as follows:
This algorithm is parallelized so that the row transforms are done in parallel
using multiple threads, if the number of processors is greater than one
in ApfloatContext.getNumberOfProcessors()
.
If the data block to be transformed is larger than the shared memory treshold setting
in the current ApfloatContext, this class will synchronize all data access on
the shared memory lock retrieved from ApfloatContext.getSharedMemoryLock()
.
All access to this class must be externally synchronized.
Field Summary |
---|
Fields inherited from class org.apfloat.internal.DoubleParallelFNTStrategy |
---|
parallelRunner |
Constructor Summary | |
---|---|
DoubleSixStepFNTStrategy()
Default constructor. |
Method Summary | |
---|---|
void |
inverseTransform(DataStorage dataStorage,
int modulus,
long totalTransformLength)
Perform an inverse transform on the data. |
void |
transform(DataStorage dataStorage,
int modulus)
Perform a forward transform on the data. |
Methods inherited from class org.apfloat.internal.DoubleParallelFNTStrategy |
---|
multiplyElements, setParallelRunner, transformRows |
Methods inherited from class org.apfloat.internal.DoubleTableFNTStrategy |
---|
getTransformLength, 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 |
Methods inherited from interface org.apfloat.spi.NTTStrategy |
---|
getTransformLength |
Constructor Detail |
---|
public DoubleSixStepFNTStrategy()
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
transform
in class DoubleTableFNTStrategy
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
inverseTransform
in class DoubleTableFNTStrategy
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
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |