ArrayMutableSparseMatrix

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: ArrayMutableSparseMatrix<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.