Matrix<T>.identity constructor
Matrix<T>.identity (
- DataType<
T> dataType, - int rowCount,
- int columnCount, {
- T? value,
- MatrixFormat? format,
Returns an identity matrix with the constant value
.
If format
is specified the resulting matrix is mutable, otherwise this
is a read-only view.
Implementation
factory Matrix.identity(DataType<T> dataType, int rowCount, int columnCount,
{T? value, MatrixFormat? format}) {
final result = IdentityMatrix<T>(dataType, rowCount, columnCount,
value ?? dataType.field.multiplicativeIdentity);
return format == null ? result : result.toMatrix(format: format);
}