Class DivideAndConquer

java.lang.Object
org.ojalgo.concurrent.DivideAndConquer

public abstract class DivideAndConquer extends Object
Divide an index (int) range into smaller parts, and conquer each part in parallel. There are two ways to use this class:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static interface 
    A conquerer is a function that will be called with a range of indices to conquer.
    static final class 
    A configurable divider that can be used to divide a range of indices and conquer each part in parallel.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    (package private) static void
    call(ExecutorService executor, int first, int limit, int threshold, int workers, DivideAndConquer.Conquerer conquerer)
     
    protected abstract void
    conquer(int first, int limit)
     
    final void
    invoke(int first, int limit, int threshold)
    Synchronous execution - wait until it's finished.

    Methods inherited from class Object

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

    • DivideAndConquer

      public DivideAndConquer()
  • Method Details

    • call

      static void call(ExecutorService executor, int first, int limit, int threshold, int workers, DivideAndConquer.Conquerer conquerer)
    • invoke

      public final void invoke(int first, int limit, int threshold)
      Synchronous execution - wait until it's finished.
      Parameters:
      first - The first index, in a range, to include.
      limit - The first index NOT to include - last (excl.) index in a range.
    • conquer

      protected abstract void conquer(int first, int limit)