Package org.apfloat.internal
Class DoubleConvolutionBuilder
- java.lang.Object
-
- org.apfloat.internal.AbstractConvolutionBuilder
-
- org.apfloat.internal.DoubleConvolutionBuilder
-
- All Implemented Interfaces:
ConvolutionBuilder
public class DoubleConvolutionBuilder extends AbstractConvolutionBuilder
Creates convolutions of suitable type for thedouble
type.- Version:
- 1.7.0
- See Also:
DoubleShortConvolutionStrategy
,DoubleMediumConvolutionStrategy
,DoubleKaratsubaConvolutionStrategy
,ThreeNTTConvolutionStrategy
-
-
Constructor Summary
Constructors Constructor Description DoubleConvolutionBuilder()
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected 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
getKaratsubaCostFactor()
Get the Karatsuba convolution cost factor.protected int
getKaratsubaCutoffPoint()
Get the Karatsuba convolution cutoff point.protected float
getNTTCostFactor()
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: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
protected ConvolutionStrategy createShortConvolutionStrategy(int radix)
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
protected ConvolutionStrategy createMediumConvolutionStrategy(int radix)
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
protected ConvolutionStrategy createKaratsubaConvolutionStrategy(int radix)
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
protected ConvolutionStrategy createThreeNTTConvolutionStrategy(int radix, NTTStrategy nttStrategy)
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.
-
-