Package org.apfloat.spi
Interface NTTConvolutionStepStrategy
-
- All Known Implementing Classes:
DoubleNTTConvolutionStepStrategy
,FloatNTTConvolutionStepStrategy
,IntNTTConvolutionStepStrategy
,LongNTTConvolutionStepStrategy
public interface NTTConvolutionStepStrategy
Steps for a three-NTT convolution. This includes element-by-element multiplication and squaring of the transformed data.- Since:
- 1.7.0
- Version:
- 1.7.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
multiplyInPlace(DataStorage sourceAndDestination, DataStorage source, int modulus)
Linear multiplication in the number theoretic domain.void
squareInPlace(DataStorage sourceAndDestination, int modulus)
Linear squaring in the number theoretic domain.
-
-
-
Method Detail
-
multiplyInPlace
void multiplyInPlace(DataStorage sourceAndDestination, DataStorage source, int modulus) throws ApfloatRuntimeException
Linear multiplication in the number theoretic domain. The operation issourceAndDestination[i] *= source[i] (mod m)
.For maximum performance,
sourceAndDestination
should be in memory if possible.- Parameters:
sourceAndDestination
- The first source data storage, which is also the destination.source
- The second source data storage.modulus
- Which modulus to use (0, 1, 2)- Throws:
ApfloatRuntimeException
-
squareInPlace
void squareInPlace(DataStorage sourceAndDestination, int modulus) throws ApfloatRuntimeException
Linear squaring in the number theoretic domain. The operation issourceAndDestination[i] *= sourceAndDestination[i] (mod m)
.For maximum performance,
sourceAndDestination
should be in memory if possible.- Parameters:
sourceAndDestination
- The source data storage, which is also the destination.modulus
- Which modulus to use (0, 1, 2)- Throws:
ApfloatRuntimeException
-
-