CompactArrayMutableSparseMatrix

constructor(maxWidth: Int, maxHeight: Int, initValue: T, validator: (Int, Int) -> Boolean)

Create a new instance of the class with the given validation function. All elements of the matrix will be set to the same initial value. The validation function does not need to validate that the coordinate is within

Parameters

maxWidth

The width of the matrix in columns

maxHeight

The height of the matrix in rows

initValue

The initial value for all cells

validator

The function used to determine whether a cell is used in the matrix.


constructor(original: CompactArrayMutableSparseMatrix<T>)

Create a new instance that is a copy of the original matrix. This will be a shallow copy as in the elements will not be copied.


constructor(source: Matrix<SparseMatrix.SparseValue<T>>)

A constructor that creates a new CompactArrayMutableSparseMatrix given a matrix of SparseValues. Those are used to initialize the matrix.

Parameters

source

The matrix to get values from.