Package org.apfloat.internal
Class AbstractStepFNTStrategy
java.lang.Object
org.apfloat.internal.AbstractStepFNTStrategy
- All Implemented Interfaces:
Parallelizable
,NTTStrategy
- Direct Known Subclasses:
SixStepFNTStrategy
,TwoPassFNTStrategy
Abstract superclass for step-based FNT strategies.
All access to this class must be externally synchronized.
- Since:
- 1.7.0
- Version:
- 1.8.0
- Author:
- Mikko Tommila
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlong
getTransformLength
(long size) Return the supported transform length for the specified data size.protected abstract void
inverseTransform
(DataStorage dataStorage, int n1, int n2, long length, long totalTransformLength, int modulus) Inverse transform the data in steps.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.protected abstract void
transform
(DataStorage dataStorage, int n1, int n2, long length, int modulus) Transform the data in steps.
-
Field Details
-
stepStrategy
The NTT steps.
-
-
Constructor Details
-
AbstractStepFNTStrategy
protected AbstractStepFNTStrategy()Subclass constructor.
-
-
Method Details
-
transform
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 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: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 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:NTTStrategy
Return the supported transform length for the specified data size.- Specified by:
getTransformLength
in interfaceNTTStrategy
- Parameters:
size
- Length of the data to be transformed.- Returns:
- Length of the transform needed by this transform.
-
transform
protected abstract void transform(DataStorage dataStorage, int n1, int n2, long length, int modulus) throws ApfloatRuntimeException Transform the data in steps.- Parameters:
dataStorage
- The data.n1
- Height of the data matrix.n2
- Width of the data matrix.length
- Length of the data.modulus
- Which modulus to use.- Throws:
ApfloatRuntimeException
-
inverseTransform
protected abstract void inverseTransform(DataStorage dataStorage, int n1, int n2, long length, long totalTransformLength, int modulus) throws ApfloatRuntimeException Inverse transform the data in steps.- Parameters:
dataStorage
- The data.n1
- Height of the data matrix.n2
- Width of the data matrix.length
- Length of the data.totalTransformLength
- Total transform length.modulus
- Which modulus to use.- Throws:
ApfloatRuntimeException
-