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
- Author:
- Mikko Tommila
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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 Details
-
multiplyInPlace
void multiplyInPlace(DataStorage sourceAndDestination, DataStorage source, int modulus) throws ApfloatRuntimeExceptionLinear 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
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
-