api / koma.extensions / fill

fill

@JvmName("fillDouble") inline funMatrix<Double>.fill(f: (row:Int, col:Int) ->Double):Matrix<Double> @JvmName("fillFloat") inline funMatrix<Float>.fill(f: (row:Int, col:Int) ->Float):Matrix<Float> @JvmName("fillGeneric") fun <T>Matrix<T>.fill(f: (row:Int, col:Int) ->T):Matrix<T> @JvmName("fillInt") inline funMatrix<Int>.fill(f: (row:Int, col:Int) ->Int):Matrix<Int>

Fills the matrix with the values returned by the input function.

Parameters

f - A function which takes row,col and returns the value to fill. Note that the return type must be the matrix primitive type (e.g. Double).@JvmName("fillByte") inline funNDArray<Byte>.fill(f: (idx:IntArray) ->Byte):NDArray<Byte> @JvmName("fillDouble") inline funNDArray<Double>.fill(f: (idx:IntArray) ->Double):NDArray<Double> @JvmName("fillFloat") inline funNDArray<Float>.fill(f: (idx:IntArray) ->Float):NDArray<Float> @JvmName("fillGeneric") fun <T>NDArray<T>.fill(f: (idx:IntArray) ->T):NDArray<T> @JvmName("fillInt") inline funNDArray<Int>.fill(f: (idx:IntArray) ->Int):NDArray<Int> @JvmName("fillLong") inline funNDArray<Long>.fill(f: (idx:IntArray) ->Long):NDArray<Long> @JvmName("fillShort") inline funNDArray<Short>.fill(f: (idx:IntArray) ->Short):NDArray<Short>