api / koma.extensions / forEach

forEach

@JvmName("forEachDouble") inline funMatrix<Double>.forEach(f: (Double) ->Unit):Unit @JvmName("forEachFloat") inline funMatrix<Float>.forEach(f: (Float) ->Unit):Unit @JvmName("forEachGeneric") fun <T>Matrix<T>.forEach(f: (T) ->Unit):Unit @JvmName("forEachInt") inline funMatrix<Int>.forEach(f: (Int) ->Unit):Unit

Passes each element in row major order into a function.

Parameters

f - A function that takes in an element@JvmName("forEachByte") inline funNDArray<Byte>.forEach(f: (ele:Byte) ->Unit):Unit @JvmName("forEachDouble") inline funNDArray<Double>.forEach(f: (ele:Double) ->Unit):Unit @JvmName("forEachFloat") inline funNDArray<Float>.forEach(f: (ele:Float) ->Unit):Unit @JvmName("forEachGeneric") fun <T>NDArray<T>.forEach(f: (ele:T) ->Unit):Unit @JvmName("forEachInt") inline funNDArray<Int>.forEach(f: (ele:Int) ->Unit):Unit @JvmName("forEachLong") inline funNDArray<Long>.forEach(f: (ele:Long) ->Unit):Unit @JvmName("forEachShort") inline funNDArray<Short>.forEach(f: (ele:Short) ->Unit):Unit

Takes each element in a NDArray and passes them through f.

Parameters

f - A function that takes in an element