mapInt

inline fun <T> Matrix<T>.mapInt(transform: (T) -> Int): IntMatrix
inline fun IntMatrix.mapInt(transform: (Int) -> Int): IntMatrix

Create a new IntMatrix with the dimensions of the original where the value of each cell is the result of applying the transform to the value of the cell in the original.

Receiver

The matrix to use as basis

Parameters

transform

the function used to determine the new value


inline fun <T> SparseMatrix<T>.mapInt(transform: (T) -> Int): SparseIntMatrix

Create a new SparseIntMatrix with the dimensions of the original where the value of each cell is the result of applying the transform to the value of the cell in the original.

Receiver

The matrix to use as basis

Parameters

transform

the function used to determine the new value


inline fun <R> IntMatrix.mapInt(transform: (Int) -> R): Matrix<R>

Create a new Matrix with the dimensions of the original where the value of each cell is the result of applying the transform to the value of the cell in the original.

Receiver

The matrix to use as basis

Parameters

transform

the function used to determine the new value