org.apfloat.internal
Class DoubleConvolutionBuilder

java.lang.Object
  extended by org.apfloat.internal.DoubleConvolutionBuilder
All Implemented Interfaces:
ConvolutionBuilder

public class DoubleConvolutionBuilder
extends Object
implements ConvolutionBuilder

Creates convolutions of suitable type for the specified length for the double 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:

size1size2Algorithm
1616Long
16256Long
3232Long
32256Long
6464Karatsuba
64256NTT
6465536Karatsuba
128128NTT
12865536NTT
1284294967296Karatsuba
256256NTT
2564294967296Karatsuba
512512NTT
5124294967296NTT

Version:
1.4
Author:
Mikko Tommila
See Also:
DoubleShortConvolutionStrategy, DoubleMediumConvolutionStrategy, DoubleKaratsubaConvolutionStrategy, Double3NTTConvolutionStrategy

Constructor Summary
DoubleConvolutionBuilder()
          Default constructor.
 
Method Summary
 ConvolutionStrategy createConvolution(int radix, long size1, long size2, long resultSize)
          Returns a convolution strategy of suitable type for the specified length.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DoubleConvolutionBuilder

public DoubleConvolutionBuilder()
Default constructor.

Method Detail

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.