invoke

open operator override fun <T : Boolean> invoke(original: SparseMatrix<T>): MutableSparseMatrix<T>

Create a new SparseMatrix that is a copy of the original.




open operator override fun <T : Boolean> invoke(maxWidth: Int, maxHeight: Int, init: SparseMatrix.SparseInit<T>.(Int, Int) -> SparseMatrix.SparseValue<T>): MutableSparseMatrix<T>

Create a new SparseMatrix with the given size and intialization function. It also requires a validate function

Parameters

maxWidth

The width of the matrix

maxHeight

The height of the matrix

init

An initialization function that sets the values for the matrix.


Create a SparseBooleanMatrix initialized with the given value

Parameters

maxWidth

Width of the matrix

maxHeight

Height of the matrix

init

The function initializing the matrix


open operator override fun <T : Boolean> invoke(maxWidth: Int, maxHeight: Int, initValue: T, validator: (Int, Int) -> Boolean): MutableSparseMatrix<T>

Create a new SparseMatrix with the given size and intialization function. It also requires a validate function

Parameters

maxWidth

The width of the matrix

maxHeight

The height of the matrix

initValue

An value for the non-sparse elements of the matrix

validator

A function that is used to determine whether a particular coordinate is contained in the matrix.


operator fun invoke(maxWidth: Int, maxHeight: Int, validator: (Int, Int) -> Boolean): MutableSparseBooleanMatrix

Create a MutableBooleanMatrix initialized with the default value of the Boolean type (0)

Parameters

maxWidth

Width of the matrix

maxHeight

Height of the matrix

validator

Function that determines which cells are part of the matrix


operator fun invoke(maxWidth: Int, maxHeight: Int, initValue: Boolean, validator: (Int, Int) -> Boolean): MutableSparseBooleanMatrix

Create a MutableSparseBooleanMatrix initialized with the given value

Parameters

maxWidth

Width of the matrix

maxHeight

Height of the matrix

initValue

The initial value for the elements

validator

The function that determines whether a given cell is valid.


open inline operator override fun <T : Boolean> invoke(maxWidth: Int, maxHeight: Int, noinline validator: (Int, Int) -> Boolean, init: (Int, Int) -> T): MutableSparseMatrix<T>

Create a new SparseMatrix subclass instance with the given size and intialization function. It also requires a validate function

Parameters

maxWidth

The width of the matrix

maxHeight

The height of the matrix

validator

A function that is used to determine whether a particular coordinate is contained in the matrix.

init

An initialization function that sets the values for the matrix.


inline operator fun invoke(maxWidth: Int, maxHeight: Int, noinline validator: (Int, Int) -> Boolean, init: (Int, Int) -> Boolean): MutableSparseBooleanMatrix

Create a MutableSparseBooleanMatrix initialized with the given value

Parameters

maxWidth

Width of the matrix

maxHeight

Height of the matrix

init

The function initializing the matrix

validator

The function that determines whether a given cell is valid.