Package org.apfloat.internal
Class ParallelThreeNTTConvolutionStrategy
java.lang.Object
org.apfloat.internal.ThreeNTTConvolutionStrategy
org.apfloat.internal.ParallelThreeNTTConvolutionStrategy
- All Implemented Interfaces:
ConvolutionStrategy
Convolution using three Number Theoretic Transforms
and the CRT to get the final result, using multiple threads in parallel.
This algorithm is parallelized so that all operations are done in parallel
using multiple threads, if the number of processors is greater than one
in ApfloatContext.getNumberOfProcessors()
.
If the data block to be transformed is larger than the shared memory threshold setting
in the current ApfloatContext, this class will synchronize all data access on
the shared memory lock retrieved from ApfloatContext.getSharedMemoryLock()
.
All access to this class must be externally synchronized.
- Since:
- 1.7.0
- Version:
- 1.9.0
- Author:
- Mikko Tommila
-
Field Summary
Fields inherited from class org.apfloat.internal.ThreeNTTConvolutionStrategy
carryCRTStrategy, nttStrategy, stepStrategy
-
Constructor Summary
ConstructorsConstructorDescriptionParallelThreeNTTConvolutionStrategy
(int radix, NTTStrategy nttStrategy) Creates a new convoluter that uses the specified transform for transforming the data. -
Method Summary
Methods inherited from class org.apfloat.internal.ThreeNTTConvolutionStrategy
autoConvolute, autoConvoluteOne, convolute, convoluteOne, createCachedDataStorage, createDataStorage
-
Constructor Details
-
Method Details
-
lock
protected void lock(long length) Description copied from class:ThreeNTTConvolutionStrategy
Lock the execution against a synchronization lock.- Overrides:
lock
in classThreeNTTConvolutionStrategy
- Parameters:
length
- The length of the data being processed for determining the type of lock to use.
-
unlock
protected void unlock()Description copied from class:ThreeNTTConvolutionStrategy
Remove the synchronization lock.- Overrides:
unlock
in classThreeNTTConvolutionStrategy
-