running Reduce Indexed
inline fun ByteBuffer.runningReduceIndexed(operation: (index: Int, acc: Byte, Byte) -> Byte): List<Byte>
Content copied to clipboard
inline fun ShortBuffer.runningReduceIndexed(operation: (index: Int, acc: Short, Short) -> Short): List<Short>
Content copied to clipboard
inline fun IntBuffer.runningReduceIndexed(operation: (index: Int, acc: Int, Int) -> Int): List<Int>
Content copied to clipboard
inline fun LongBuffer.runningReduceIndexed(operation: (index: Int, acc: Long, Long) -> Long): List<Long>
Content copied to clipboard
inline fun FloatBuffer.runningReduceIndexed(operation: (index: Int, acc: Float, Float) -> Float): List<Float>
Content copied to clipboard
inline fun DoubleBuffer.runningReduceIndexed(operation: (index: Int, acc: Double, Double) -> Double): List<Double>
Content copied to clipboard
inline fun CharBuffer.runningReduceIndexed(operation: (index: Int, acc: Char, Char) -> Char): List<Char>
Content copied to clipboard
Returns a list containing successive accumulation values generated by applying operation from left to right to each element, its index in the original array and current accumulator value that starts with the first element of this array.
Samples
kool.buffers.Collections.Aggregates.runningReduce
Parameters
operation
function that takes the index of an element, current accumulator value and the element itself, and calculates the next accumulator value.