public abstract class AbstractStepFNTStrategy extends Object implements NTTStrategy, Parallelizable
All access to this class must be externally synchronized.
NTTStepStrategy
Modifier and Type | Field and Description |
---|---|
protected NTTStepStrategy |
stepStrategy
The NTT steps.
|
Modifier | Constructor and Description |
---|---|
protected |
AbstractStepFNTStrategy()
Subclass constructor.
|
Modifier and Type | Method and Description |
---|---|
long |
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.
|
protected NTTStepStrategy stepStrategy
protected AbstractStepFNTStrategy()
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 abstract void transform(DataStorage dataStorage, int n1, int n2, long length, int modulus) throws ApfloatRuntimeException
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.ApfloatRuntimeException
protected abstract void inverseTransform(DataStorage dataStorage, int n1, int n2, long length, long totalTransformLength, int modulus) throws ApfloatRuntimeException
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.ApfloatRuntimeException
Copyright © 2019. All rights reserved.