Companion

object Companion : ImmutableMatrixCompanion<Boolean>

The companion object contains factory functions to create new instances with initialization.

Functions

Link copied to clipboard
open fun <T : Boolean> fromFunction(width: Int, height: Int, valueFun: (Int, Int) -> T): Matrix<T>

Create a matrix where each value is determined by invoking the valueFun function. It does not store any values.

Link copied to clipboard
open operator override fun <T : Boolean> invoke(original: Matrix<T>): Matrix<T>

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

operator fun invoke(source: Matrix<Boolean>): BooleanMatrix
operator fun invoke(source: BooleanMatrix): BooleanMatrix

open operator override fun <T : Boolean> invoke(width: Int, height: Int, initValue: T): Matrix<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.

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

Create an BooleanMatrix initialized with the given value

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

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

inline operator fun invoke(width: Int, height: Int, init: (Int, Int) -> Boolean): BooleanMatrix

Create an BooleanMatrix initialized according to the init function.