Package org.apfloat

Class ParallelHelper

java.lang.Object
org.apfloat.ParallelHelper

class ParallelHelper extends Object
Helper methods for parallel algorithms.
Since:
1.8.0
Version:
1.14.0
  • 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

      public static <T> T getFuture(Future<T> future)
    • runParallel

      public static void runParallel(Runnable runnable)
    • runParallel

      private static void runParallel(Runnable runnable, int numberOfThreads)