Top Methods
io.vavr.collection

pack-priv Interface TraversableModule

Located in compilation unit of io.vavr.collection.Traversable.


Method Summary

Modifier and TypeMethod and Description
public static <
element type
T
>
double[]

Returns:

A pair [sum, size], where sum is the compensated sum and size is the number of elements which were summed.
neumaierSum
(Iterable<T>
the elements
ts
,
ToDoubleFunction<T>
function which maps elements to double values
toDouble
)

Uses Neumaier's variant of the Kahan summation algorithm in order to sum double values.

Method Detail

neumaierSumback to summary
public 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.

Parameters
<T>
element type
ts:Iterable<T>

the elements

toDouble:ToDoubleFunction<T>

function which maps elements to double values

Returns:double[]

A pair [sum, size], where sum is the compensated sum and size is the number of elements which were summed.