Matrix.zeros constructor

Matrix.zeros(
  1. int rows,
  2. int cols, {
  3. bool isDouble = false,
})

Creates a Matrix of the specified dimensions with all elements set to 0.

rows: Number of rows. cols: Number of columns.

Example:

var m = Matrix.zeros(2, 3);
print(m);
// Output:
// Matrix: 2x3
// ┌ 0 0 0 ┐
// └ 0 0 0 ┘

Implementation

factory Matrix.zeros(int rows, int cols, {bool isDouble = false}) {
  return Matrix.factory
      .create(MatrixType.zeros, rows, cols, isDouble: isDouble);
}