Package org.apfloat.internal
Class LongConvolutionBuilder
java.lang.Object
org.apfloat.internal.AbstractConvolutionBuilder
org.apfloat.internal.LongConvolutionBuilder
- All Implemented Interfaces:
ConvolutionBuilder
Creates convolutions of suitable type for the
long type.- Version:
- 1.7.0
- Author:
- Mikko Tommila
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected ConvolutionStrategycreateKaratsubaConvolutionStrategy(int radix) Create a Karatsuba convolution strategy.protected ConvolutionStrategycreateMediumConvolutionStrategy(int radix) Create a medium-length convolution strategy where the size of one of the data sets is relatively small (but more than one).protected ConvolutionStrategycreateShortConvolutionStrategy(int radix) Create a short-length convolution strategy where the size of either data set is one.protected ConvolutionStrategycreateThreeNTTConvolutionStrategy(int radix, NTTStrategy nttStrategy) Create a 3-NTT convolution strategy.protected floatGet the Karatsuba convolution cost factor.protected intGet the Karatsuba convolution cutoff point.protected floatGet the NTT convolution cost factor.Methods inherited from class org.apfloat.internal.AbstractConvolutionBuilder
createConvolution
-
Constructor Details
-
LongConvolutionBuilder
public LongConvolutionBuilder()Default constructor.
-
-
Method Details
-
getKaratsubaCutoffPoint
protected int getKaratsubaCutoffPoint()Description copied from class:AbstractConvolutionBuilderGet the Karatsuba convolution cutoff point. When either operand is shorter than this then the medium-length convolution strategy should be used instead.- Specified by:
getKaratsubaCutoffPointin classAbstractConvolutionBuilder- Returns:
- The Karatsuba convolution cutoff point.
-
getKaratsubaCostFactor
protected float getKaratsubaCostFactor()Description copied from class:AbstractConvolutionBuilderGet the Karatsuba convolution cost factor. It is used in determining the most efficient convolution strategy for the given data lengths.- Specified by:
getKaratsubaCostFactorin classAbstractConvolutionBuilder- Returns:
- The Karatsuba convolution cost factor.
-
getNTTCostFactor
protected float getNTTCostFactor()Description copied from class:AbstractConvolutionBuilderGet the NTT convolution cost factor. It is used in determining the most efficient convolution strategy for the given data lengths.- Specified by:
getNTTCostFactorin classAbstractConvolutionBuilder- Returns:
- The NTT convolution cost factor.
-
createShortConvolutionStrategy
Description copied from class:AbstractConvolutionBuilderCreate a short-length convolution strategy where the size of either data set is one.- Specified by:
createShortConvolutionStrategyin classAbstractConvolutionBuilder- Parameters:
radix- The radix that will be used.- Returns:
- A new short-length convolution strategy.
-
createMediumConvolutionStrategy
Description copied from class:AbstractConvolutionBuilderCreate a medium-length convolution strategy where the size of one of the data sets is relatively small (but more than one).- Specified by:
createMediumConvolutionStrategyin classAbstractConvolutionBuilder- Parameters:
radix- The radix that will be used.- Returns:
- A new medium-length convolution strategy.
-
createKaratsubaConvolutionStrategy
Description copied from class:AbstractConvolutionBuilderCreate a Karatsuba convolution strategy.- Specified by:
createKaratsubaConvolutionStrategyin classAbstractConvolutionBuilder- Parameters:
radix- The radix that will be used.- Returns:
- A new Karatsuba convolution strategy.
-
createThreeNTTConvolutionStrategy
Description copied from class:AbstractConvolutionBuilderCreate a 3-NTT convolution strategy.- Specified by:
createThreeNTTConvolutionStrategyin classAbstractConvolutionBuilder- Parameters:
radix- The radix that will be used.nttStrategy- The underlying NTT strategy.- Returns:
- A new 3-NTT convolution strategy.
-