Package io.vavr.collection
Interface TraversableModule
-
interface TraversableModule
-
-
Method Summary
Static Methods Modifier and Type Method Description static <T> double[]neumaierSum(java.lang.Iterable<T> ts, java.util.function.ToDoubleFunction<T> toDouble)Uses Neumaier's variant of the Kahan summation algorithm in order to sum double values.
-
-
-
Method Detail
-
neumaierSum
static <T> double[] neumaierSum(java.lang.Iterable<T> ts, java.util.function.ToDoubleFunction<T> toDouble)Uses Neumaier's variant of the Kahan summation algorithm in order to sum double values.- Type Parameters:
T- element type- Parameters:
ts- the elementstoDouble- function which maps elements todoublevalues- Returns:
- A pair
[sum, size], wheresumis the compensated sum andsizeis the number of elements which were summed.
-
-