api / koma.extensions / forEachIndexedN

forEachIndexedN

@JvmName("forEachIndexedNByte") inline funNDArray<Byte>.forEachIndexedN(f: (idx:IntArray, ele:Byte) ->Unit):Unit @JvmName("forEachIndexedNDouble") inline funNDArray<Double>.forEachIndexedN(f: (idx:IntArray, ele:Double) ->Unit):Unit @JvmName("forEachIndexedNFloat") inline funNDArray<Float>.forEachIndexedN(f: (idx:IntArray, ele:Float) ->Unit):Unit @JvmName("forEachIndexedNGeneric") fun <T>NDArray<T>.forEachIndexedN(f: (idx:IntArray, ele:T) ->Unit):Unit @JvmName("forEachIndexedNInt") inline funNDArray<Int>.forEachIndexedN(f: (idx:IntArray, ele:Int) ->Unit):Unit @JvmName("forEachIndexedNLong") inline funNDArray<Long>.forEachIndexedN(f: (idx:IntArray, ele:Long) ->Unit):Unit @JvmName("forEachIndexedNShort") inline funNDArray<Short>.forEachIndexedN(f: (idx:IntArray, ele:Short) ->Unit):Unit

Takes each element in a NDArray and passes them through f. Index given to f is the full ND index of the element.

Parameters

f - A function that takes in an element. Function also takes in the ND index of the element's location.