api / koma.extensions / map

map

@JvmName("mapDouble") inline funMatrix<Double>.map(f: (Double) ->Double):Matrix<Double> @JvmName("mapFloat") inline funMatrix<Float>.map(f: (Float) ->Float):Matrix<Float> @JvmName("mapGeneric") fun <T>Matrix<T>.map(f: (T) ->T):Matrix<T> @JvmName("mapInt") inline funMatrix<Int>.map(f: (Int) ->Int):Matrix<Int>

Takes each element in a matrix, passes them through f, and puts the output of f into an output matrix. This process is done in row-major order.

Parameters

f - A function that takes in an element and returns an element

Return the new matrix after each element is mapped through f

@JvmName("mapByte") inline funNDArray<Byte>.map(f: (Byte) ->Byte):NDArray<Byte> @JvmName("mapDouble") inline funNDArray<Double>.map(f: (Double) ->Double):NDArray<Double> @JvmName("mapFloat") inline funNDArray<Float>.map(f: (Float) ->Float):NDArray<Float> @JvmName("mapGeneric") fun <T>NDArray<T>.map(f: (T) ->T):DefaultGenericNDArray<T> @JvmName("mapInt") inline funNDArray<Int>.map(f: (Int) ->Int):NDArray<Int> @JvmName("mapLong") inline funNDArray<Long>.map(f: (Long) ->Long):NDArray<Long> @JvmName("mapShort") inline funNDArray<Short>.map(f: (Short) ->Short):NDArray<Short>

Takes each element in a NDArray, passes them through f, and puts the output of f into an output NDArray.

Parameters

f - A function that takes in an element and returns an element

Return the new NDArray after each element is mapped through f