api / koma.extensions / map
map
@JvmName("mapDouble") inline fun
Matrix
<
Double
>.map(f: (
Double
) ->
Double
):
Matrix
<
Double
>
@JvmName("mapFloat") inline fun
Matrix
<
Float
>.map(f: (
Float
) ->
Float
):
Matrix
<
Float
>
@JvmName("mapGeneric") fun <T>
Matrix
<
T
>.map(f: (
T
) ->
T
):
Matrix
<
T
>
@JvmName("mapInt") inline fun
Matrix
<
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 fun
NDArray
<
Byte
>.map(f: (
Byte
) ->
Byte
):
NDArray
<
Byte
>
@JvmName("mapDouble") inline fun
NDArray
<
Double
>.map(f: (
Double
) ->
Double
):
NDArray
<
Double
>
@JvmName("mapFloat") inline fun
NDArray
<
Float
>.map(f: (
Float
) ->
Float
):
NDArray
<
Float
>
@JvmName("mapGeneric") fun <T>
NDArray
<
T
>.map(f: (
T
) ->
T
):
DefaultGenericNDArray
<
T
>
@JvmName("mapInt") inline fun
NDArray
<
Int
>.map(f: (
Int
) ->
Int
):
NDArray
<
Int
>
@JvmName("mapLong") inline fun
NDArray
<
Long
>.map(f: (
Long
) ->
Long
):
NDArray
<
Long
>
@JvmName("mapShort") inline fun
NDArray
<
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