sumBy

inline fun <T : Number, D : Dimension> MultiArray<T, D>.sumBy(selector: (T) -> Int): Int
inline fun <T : Number, D : Dimension> MultiArray<T, D>.sumBy(selector: (T) -> Double): Double
inline fun <T, D : Dimension> MultiArray<T, D>.sumBy(selector: (T) -> ComplexFloat): ComplexFloat
inline fun <T, D : Dimension> MultiArray<T, D>.sumBy(selector: (T) -> ComplexDouble): ComplexDouble

Returns the sum of all values produced by selector function applied to each element in the collection.