org.apfloat.internal
Class IntConvolutionBuilder
java.lang.Object
org.apfloat.internal.IntConvolutionBuilder
- All Implemented Interfaces:
- ConvolutionBuilder
public class IntConvolutionBuilder
- extends Object
- implements ConvolutionBuilder
Creates convolutions of suitable type for the specified length for the int type.
Based on a work estimate, depending on the operand sizes, the O(n2)
long multiplication, Karatsuba multiplication and the NTT algorithms are chosen e.g. as follows:
| size1 | size2 | Algorithm |
| 16 | 16 | Long |
| 16 | 256 | Long |
| 32 | 32 | Long |
| 32 | 256 | Long |
| 64 | 64 | Karatsuba |
| 64 | 256 | NTT |
| 64 | 65536 | Karatsuba |
| 128 | 128 | NTT |
| 128 | 65536 | NTT |
| 128 | 4294967296 | Karatsuba |
| 256 | 256 | NTT |
| 256 | 4294967296 | Karatsuba |
| 512 | 512 | NTT |
| 512 | 4294967296 | NTT |
- Version:
- 1.4
- Author:
- Mikko Tommila
- See Also:
IntShortConvolutionStrategy,
IntMediumConvolutionStrategy,
IntKaratsubaConvolutionStrategy,
Int3NTTConvolutionStrategy
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
IntConvolutionBuilder
public IntConvolutionBuilder()
- Default constructor.
createConvolution
public ConvolutionStrategy createConvolution(int radix,
long size1,
long size2,
long resultSize)
- Description copied from interface:
ConvolutionBuilder
- Returns a convolution strategy of suitable
type for the specified length.
- Specified by:
createConvolution in interface ConvolutionBuilder
- Parameters:
radix - The radix that will be used.size1 - Length of first data set.size2 - Length of second data set.resultSize - Minimum number of elements needed in the result data.
- Returns:
- A suitable object for performing the convolution.