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