Companion

object Companion : MutableMatrixCompanion<Int>

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

Functions

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

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

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

operator fun invoke(width: Int, height: Int): MutableIntMatrix
operator fun invoke(width: Int, height: Int, initValue: Int): MutableIntMatrix

Create a MutableIntMatrix initialized with the default value of the Int type (0)

open operator override fun <T : Int> 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.

open operator override fun <T : Int> 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.