reduce
inline fun ShortBuffer.reduce(operation: (acc: Short, Short) -> Short): Short
Content copied to clipboard
inline fun FloatBuffer.reduce(operation: (acc: Float, Float) -> Float): Float
Content copied to clipboard
Accumulates value starting with the first element and applying operation from left to right to current accumulator value and each element.
Throws an exception if this array is empty. If the array can be empty in an expected way, please use reduceOrNull instead. It returns null
when its receiver is empty.
Samples
kool.buffers.Collections.Aggregates.reduce
Parameters
operation
function that takes current accumulator value and an element, and calculates the next accumulator value.