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 todouble
values- Returns:
- A pair
[sum, size]
, wheresum
is the compensated sum andsize
is the number of elements which were summed.
-
-