fromFunction

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.

Parameters

width

The width of the matrix

height

The height of the matrix

valueFun

The function used to determine the value. The implementation does allow this value to change over time.