transform<S> method
Returns a view on this Matrix with all its elements lazily converted
by calling the provided read
transformation. An optionally provided
write
transformation enables writing to the returned matrix.
Implementation
Matrix<S> transform<S>(S Function(int row, int col, T value) read,
{T Function(int row, int col, S value)? write,
DataType<S>? dataType}) =>
TransformedMatrix<T, S>(
this,
read,
write ?? (r, c, v) => throw UnsupportedError('Matrix is not mutable.'),
dataType ?? DataType.fromType<S>(),
);