Companion

object Companion : ImmutableMatrixCompanion<Any?>

The companion object contains factory functions to create new instances. There is no guarantee as to the specific type returned for the interface (but always an instance of Matrix).

Functions

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

A matrix backed directly by the function. The function is invoked on each read of the matrix.

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

Create a copy of the parameter using the copyOf member function.

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

A matrix that is contains the given "initial" value. The implementation is immutable.

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

A simple array-like matrix that contains the values given by the function. The values are assigned at construction.