Interface TraversableModule


interface TraversableModule
  • Method Summary

    Static Methods
    Modifier and Type
    Method
    Description
    static <T> double[]
    neumaierSum(Iterable<T> ts, ToDoubleFunction<T> toDouble)
    Uses Neumaier's variant of the Kahan summation algorithm in order to sum double values.
  • Method Details

    • neumaierSum

      static <T> double[] neumaierSum(Iterable<T> ts, ToDoubleFunction<T> toDouble)
      Uses Neumaier's variant of the Kahan summation algorithm in order to sum double values.

      See Kahan summation algorithm.

      Type Parameters:
      T - element type
      Parameters:
      ts - the elements
      toDouble - function which maps elements to double values
      Returns:
      A pair [sum, size], where sum is the compensated sum and size is the number of elements which were summed.