api / koma.extensions / fill
fill
@JvmName("fillDouble") inline fun
Matrix
<
Double
>.fill(f: (row:
Int
, col:
Int
) ->
Double
):
Matrix
<
Double
>
@JvmName("fillFloat") inline fun
Matrix
<
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 fun
Matrix
<
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 fun
NDArray
<
Byte
>.fill(f: (idx:
IntArray
) ->
Byte
):
NDArray
<
Byte
>
@JvmName("fillDouble") inline fun
NDArray
<
Double
>.fill(f: (idx:
IntArray
) ->
Double
):
NDArray
<
Double
>
@JvmName("fillFloat") inline fun
NDArray
<
Float
>.fill(f: (idx:
IntArray
) ->
Float
):
NDArray
<
Float
>
@JvmName("fillGeneric") fun <T>
NDArray
<
T
>.fill(f: (idx:
IntArray
) ->
T
):
NDArray
<
T
>
@JvmName("fillInt") inline fun
NDArray
<
Int
>.fill(f: (idx:
IntArray
) ->
Int
):
NDArray
<
Int
>
@JvmName("fillLong") inline fun
NDArray
<
Long
>.fill(f: (idx:
IntArray
) ->
Long
):
NDArray
<
Long
>
@JvmName("fillShort") inline fun
NDArray
<
Short
>.fill(f: (idx:
IntArray
) ->
Short
):
NDArray
<
Short
>