filledWithScalar function
Implementation
Matrix filledWithScalar(int rows, int? columns, num scalar) {
columns ??= rows;
assert(rows > 0 && columns > 0);
List<Vector> listOfRows = [];
Vector scalarVector = Vector.filled(columns, scalar);
for (int i = 0; i < rows; i++) {
listOfRows.add(scalarVector);
}
return Matrix.fromRows(listOfRows);
}