Class ParallelHelper
java.lang.Object
org.apfloat.ParallelHelper
Helper methods for parallel algorithms.
- Since:
- 1.8.0
- Version:
- 1.14.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceParallelHelper.ProductKernel<T extends Apcomplex> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Tstatic <T extends Apcomplex>
voidparallelProduct(T[] x, Queue<T> heap, ParallelHelper.ProductKernel<T> kernel) Multiply two smallest elements in the heap and put the product back to the heap, until only one element remains.static voidrunParallel(Runnable runnable) private static voidrunParallel(Runnable runnable, int numberOfThreads)
-
Constructor Details
-
ParallelHelper
private ParallelHelper()
-
-
Method Details
-
parallelProduct
public static <T extends Apcomplex> void parallelProduct(T[] x, Queue<T> heap, ParallelHelper.ProductKernel<T> kernel) Multiply two smallest elements in the heap and put the product back to the heap, until only one element remains.- Parameters:
x- The elements to be multiplied.heap- The priority queue to use. Must be initially empty.kernel- The multiplication kernel callback.
-
getFuture
-
runParallel
-
runParallel
-