Package org.apfloat
Class ParallelHelper
- java.lang.Object
-
- org.apfloat.ParallelHelper
-
class ParallelHelper extends java.lang.Object
Helper methods for parallel algorithms.- Since:
- 1.8.0
- Version:
- 1.14.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
ParallelHelper.ProductKernel<T extends Apcomplex>
-
Constructor Summary
Constructors Modifier Constructor Description private
ParallelHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> T
getFuture(java.util.concurrent.Future<T> future)
static <T extends Apcomplex>
voidparallelProduct(T[] x, java.util.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 void
runParallel(java.lang.Runnable runnable)
private static void
runParallel(java.lang.Runnable runnable, int numberOfThreads)
-
-
-
Method Detail
-
parallelProduct
public static <T extends Apcomplex> void parallelProduct(T[] x, java.util.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
public static <T> T getFuture(java.util.concurrent.Future<T> future)
-
runParallel
public static void runParallel(java.lang.Runnable runnable)
-
runParallel
private static void runParallel(java.lang.Runnable runnable, int numberOfThreads)
-
-