reduce

inline fun ComplexFloatArray.reduce(operation: (acc: ComplexFloat, ComplexFloat) -> ComplexFloat): ComplexFloat
inline fun ComplexDoubleArray.reduce(operation: (acc: ComplexDouble, ComplexDouble) -> ComplexDouble): ComplexDouble

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.

Parameters

operation

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