running Fold Indexed
inline fun <R> ComplexFloatArray.runningFoldIndexed(initial: R, operation: (index: Int, acc: R, ComplexFloat) -> R): List<R>
Content copied to clipboard
inline fun <R> ComplexDoubleArray.runningFoldIndexed(initial: R, operation: (index: Int, acc: R, ComplexDouble) -> R): List<R>
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 initial value.
Note that acc
value passed to operation function should not be mutated; otherwise it would affect the previous value in resulting list.
Parameters
operation
function that takes the index of an element, current accumulator value and the element itself, and calculates the next accumulator value.