reduceOrNull

inline fun ComplexFloatArray.reduceOrNull(operation: (acc: ComplexFloat, ComplexFloat) -> ComplexFloat): ComplexFloat?
inline fun ComplexDoubleArray.reduceOrNull(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.

Returns null if the array is empty.

Parameters

operation

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