Matrix<T>.generate constructor
Matrix<T>.generate (
- DataType<
T> dataType, - int rowCount,
- int columnCount,
- MatrixGeneratorCallback<
T> callback, { - MatrixFormat? format,
Generates a matrix from calling a callback
on every value.
If format
is specified the resulting matrix is mutable, otherwise this
is a read-only view.
Implementation
factory Matrix.generate(DataType<T> dataType, int rowCount, int columnCount,
MatrixGeneratorCallback<T> callback,
{MatrixFormat? format}) {
final result =
GeneratedMatrix<T>(dataType, rowCount, columnCount, callback);
return format == null ? result : result.toMatrix(format: format);
}