running Fold
inline fun <R> ComplexFloatArray.runningFold(initial: R, operation: (acc: R, ComplexFloat) -> R): List<R>
Content copied to clipboard
inline fun <R> ComplexDoubleArray.runningFold(initial: R, operation: (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 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 current accumulator value and an element, and calculates the next accumulator value.