runningReduce

inline fun ByteBuffer.runningReduce(operation: (acc: Byte, Byte) -> Byte): List<Byte>
inline fun ShortBuffer.runningReduce(operation: (acc: Short, Short) -> Short): List<Short>
inline fun IntBuffer.runningReduce(operation: (acc: Int, Int) -> Int): List<Int>
inline fun LongBuffer.runningReduce(operation: (acc: Long, Long) -> Long): List<Long>
inline fun FloatBuffer.runningReduce(operation: (acc: Float, Float) -> Float): List<Float>
inline fun DoubleBuffer.runningReduce(operation: (acc: Double, Double) -> Double): List<Double>
inline fun CharBuffer.runningReduce(operation: (acc: Char, Char) -> Char): List<Char>

Returns a list containing successive accumulation values generated by applying operation from left to right to each element and current accumulator value that starts with the first element of this array.

Samples

kool.buffers.Collections.Aggregates.runningReduce

Parameters

operation

function that takes current accumulator value and an element, and calculates the next accumulator value.