Interface ReduceProvider

All Superinterfaces:
AlgorithmProvider
All Known Implementing Classes:
MulticoreReduceProvider

public interface ReduceProvider extends AlgorithmProvider
Reduction operation algorithm provider.

Provides parallel reduction operations (sum, max, min, product) with CPU and GPU implementations.

Since:
1.2
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
  • Method Details

    • reduce

      float reduce(String operation, float[] input)
      Reduces an array to a single value.
      Parameters:
      operation - Reduction operation: "sum", "max", "min", "prod"
      input - Input array
      Returns:
      Reduced value
    • reduce

      double reduce(String operation, double[] input)
      Reduces an array to a single value.
      Parameters:
      operation - Reduction operation: "sum", "max", "min", "prod"
      input - Input array
      Returns:
      Reduced value
    • reduce

      Real reduce(String operation, Real[] input)
      Reduces an array to a single value.
      Parameters:
      operation - Reduction operation: "sum", "max", "min", "prod"
      input - Input array
      Returns:
      Reduced value
    • reduce

      float reduce(String operation, MemorySegment input, ValueLayout.OfFloat layout, long count)
      Reduces a MemorySegment to a single value.
    • reduce

      double reduce(String operation, MemorySegment input, ValueLayout.OfDouble layout, long count)
      Reduces a MemorySegment to a single value.
    • reduce

      @Deprecated double reduce(String operation, DoubleBuffer input, int size)
      Deprecated.
      Use primitive array versions or MemorySegment-based versions for better performance.
      Reduces an array to a single value (sum, max, min, etc.).
      Parameters:
      operation - Reduction operation: "sum", "max", "min", "prod"
      input - Input buffer
      size - Number of elements
      Returns:
      Reduced value
    • getAlgorithmType

      default String getAlgorithmType()
      Description copied from interface: AlgorithmProvider
      Returns the unique category of the algorithm.
      Specified by:
      getAlgorithmType in interface AlgorithmProvider