Package org.apfloat

Class ParallelHelper


  • class ParallelHelper
    extends java.lang.Object
    Helper methods for parallel algorithms.
    Since:
    1.8.0
    Version:
    1.14.0
    • 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>
      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.
      static void runParallel​(java.lang.Runnable runnable)  
      private static void runParallel​(java.lang.Runnable runnable, int numberOfThreads)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ParallelHelper

        private ParallelHelper()
    • 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)