public class LongConvolutionBuilder extends Object implements ConvolutionBuilder
long
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 |
LongShortConvolutionStrategy
,
LongMediumConvolutionStrategy
,
LongKaratsubaConvolutionStrategy
,
Long3NTTConvolutionStrategy
Constructor and Description |
---|
LongConvolutionBuilder()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
ConvolutionStrategy |
createConvolution(int radix,
long size1,
long size2,
long resultSize)
Returns a convolution strategy of suitable
type for the specified length.
|
public ConvolutionStrategy createConvolution(int radix, long size1, long size2, long resultSize)
ConvolutionBuilder
createConvolution
in interface ConvolutionBuilder
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.