Package-level declarations

A package that contains specialized classes for Int types. It works analogous to the main matrix package (but specialized for integer values).

Types

Link copied to clipboard

An implementation of a mutable matrix backed by an IntArray. This matrix optimizes storing Int values.

Link copied to clipboard
abstract class ArrayMutableIntMatrixBase : AbstractMutableSparseMatrix<Int> , MutableSparseIntMatrix

Helper base class for array based int matrices.

Link copied to clipboard

Mutable sparse int matrix backed by an array.

Link copied to clipboard
Link copied to clipboard

Interface representing a specialised mutable matrix type for storing integers.

Link copied to clipboard

A mutable sparse matrix for integers. This interface supports mutating the values.

Link copied to clipboard
class SingleValueIntMatrix(width: Int, height: Int, value: Int) : SingleValueMatrix<Int> , IntMatrix

IntMatrix that contains a single value for all nonsparse coordinates.

Link copied to clipboard
class SingleValueSparseIntMatrix(maxWidth: Int, maxHeight: Int, value: Int, val validator: (Int, Int) -> Boolean) : SingleValueSparseMatrix<Int> , SparseIntMatrix

SparseIntMatrix that contains a single value for all nonsparse coordinates.

Link copied to clipboard

A sparse matrix for storing integers. It works just like SparseMatrix but optimizes int storage. This particular interface only provides read access. The matrix needs to be initialized appropriately or used on a class that is actually mutable.

Functions

Link copied to clipboard
operator fun IntMatrix.div(other: Int): IntMatrix

Element-wise division of two matrices. It requires the other matrix to be strictly larger than the left side matrix. The result is a matrix of the size of the receiver.

Link copied to clipboard
operator fun MutableIntMatrix.divAssign(other: Int)

Element-wise division of two matrices into the receiver. It requires the other matrix to be strictly larger than the left side matrix.

Link copied to clipboard
inline fun MutableSparseIntMatrix.fill(setter: (Int, Int) -> Int)

Helper function to set values into a MutableSparseIntMatrix.

Link copied to clipboard
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.

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.

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.

Link copied to clipboard
operator fun IntMatrix.minus(other: Int): IntMatrix

Element-wise subtraction of two matrices. It requires the other matrix to be strictly larger than the left side matrix. The result is a matrix of the size of the receiver.

Link copied to clipboard
operator fun MutableIntMatrix.minusAssign(other: Int)

Element-wise subtraction of two matrices into the receiver. It requires the other matrix to be strictly larger than the left side matrix.

Link copied to clipboard
operator fun IntMatrix.plus(other: Int): IntMatrix

Element-wise addition of two matrices. It requires the other matrix to be strictly larger than the left side matrix. The result is a matrix of the size of the receiver.

Link copied to clipboard
operator fun MutableIntMatrix.plusAssign(other: Int)

Element-wise addition of two matrices into the receiver. It requires the other matrix to be strictly larger than the left side matrix.

Link copied to clipboard
operator fun IntMatrix.rem(other: Int): IntMatrix

Element-wise remainder of two matrices. It requires the other matrix to be strictly larger than the left side matrix. The result is a matrix of the size of the receiver.

Link copied to clipboard
operator fun MutableIntMatrix.remAssign(other: Int)

Element-wise remainder of two matrices into the receiver. It requires the other matrix to be strictly larger than the left side matrix.

Link copied to clipboard
operator fun IntMatrix.times(other: IntMatrix): IntMatrix

Multiply the two matrices (using matrix multiplication). This requires the width of the left matrix to be equal to the height of the right matrix.