invoke

open operator override fun <T : Boolean> invoke(original: Matrix<T>): MutableMatrix<T>

Create a new matrix that is a copy of the original. The copy is a shallow copy.

Parameters

original

the matrix to copy (dimensions and content).


operator fun invoke(source: Matrix<Boolean>): MutableBooleanMatrix
inline operator fun invoke(width: Int, height: Int, init: (Int, Int) -> Boolean): MutableBooleanMatrix


operator fun invoke(width: Int, height: Int): MutableBooleanMatrix

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

Parameters

width

Width of the matrix

height

Height of the matrix


open operator override fun <T : Boolean> invoke(width: Int, height: Int, initValue: T): MutableMatrix<T>

Create a new matrix with the given dimensions and initial value. Note that this function is provided for concistency on Matrix, but SingleValueMatrix is recommended for the usecase.

Parameters

width

The width of the matrix to create

height

The height of the matrix to create

initValue

The initial value of each cell (this is also the actual value for read-only matrices)


operator fun invoke(width: Int, height: Int, initValue: Boolean): MutableBooleanMatrix

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

Parameters

width

Width of the matrix

height

Height of the matrix

initValue

The initial value of the elements of the matrix


open operator override fun <T : Boolean> invoke(width: Int, height: Int, init: (Int, Int) -> T): MutableMatrix<T>

Create a new matrix with the given dimensions and initialised using the init function.

Parameters

width

The width of the matrix to create

height

The height of the matrix to create

init

The function that determines the initial value for each function