api / koma.extensions / mapIndexedN
mapIndexedN
@JvmName("mapIndexedNByte") inline fun
NDArray
<
Byte
>.mapIndexedN(f: (idx:
IntArray
, ele:
Byte
) ->
Byte
):
NDArray
<
Byte
>
@JvmName("mapIndexedNDouble") inline fun
NDArray
<
Double
>.mapIndexedN(f: (idx:
IntArray
, ele:
Double
) ->
Double
):
NDArray
<
Double
>
@JvmName("mapIndexedNFloat") inline fun
NDArray
<
Float
>.mapIndexedN(f: (idx:
IntArray
, ele:
Float
) ->
Float
):
NDArray
<
Float
>
@JvmName("mapIndexedNGeneric") fun <T>
NDArray
<
T
>.mapIndexedN(f: (idx:
IntArray
, ele:
T
) ->
T
):
NDArray
<
T
>
@JvmName("mapIndexedNInt") inline fun
NDArray
<
Int
>.mapIndexedN(f: (idx:
IntArray
, ele:
Int
) ->
Int
):
NDArray
<
Int
>
@JvmName("mapIndexedNLong") inline fun
NDArray
<
Long
>.mapIndexedN(f: (idx:
IntArray
, ele:
Long
) ->
Long
):
NDArray
<
Long
>
@JvmName("mapIndexedNShort") inline fun
NDArray
<
Short
>.mapIndexedN(f: (idx:
IntArray
, ele:
Short
) ->
Short
):
NDArray
<
Short
>
Takes each element in a NDArray, passes them through f, and puts the output of f into an output NDArray. Index given to f is the full ND index of the element.
Parameters
f
- A function that takes in an element and returns an element. Function also takes
in the ND index of the element's location.
Return the new NDArray after each element is mapped through f