Package org.apfloat.internal
Class IntConvolutionBuilder
- java.lang.Object
-
- org.apfloat.internal.AbstractConvolutionBuilder
-
- org.apfloat.internal.IntConvolutionBuilder
-
- All Implemented Interfaces:
ConvolutionBuilder
public class IntConvolutionBuilder extends AbstractConvolutionBuilder
Creates convolutions of suitable type for theinttype.- Version:
- 1.7.0
- See Also:
IntShortConvolutionStrategy,IntMediumConvolutionStrategy,IntKaratsubaConvolutionStrategy,ThreeNTTConvolutionStrategy
-
-
Constructor Summary
Constructors Constructor Description IntConvolutionBuilder()Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected 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 floatgetKaratsubaCostFactor()Get the Karatsuba convolution cost factor.protected intgetKaratsubaCutoffPoint()Get the Karatsuba convolution cutoff point.protected floatgetNTTCostFactor()Get the NTT convolution cost factor.-
Methods inherited from class org.apfloat.internal.AbstractConvolutionBuilder
createConvolution
-
-
-
-
Method Detail
-
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
protected ConvolutionStrategy createShortConvolutionStrategy(int radix)
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
protected ConvolutionStrategy createMediumConvolutionStrategy(int radix)
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
protected ConvolutionStrategy createKaratsubaConvolutionStrategy(int radix)
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
protected ConvolutionStrategy createThreeNTTConvolutionStrategy(int radix, NTTStrategy nttStrategy)
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.
-
-