printMatrix method
Implementation
String printMatrix() {
// final list = matrix.asTypedList(rows * cols);
print("Rows: ${shape[0]}, Cols: ${shape[1]}");
String output = "";
for (int i = 0; i < shape[0]; i++) {
final row = data.sublist(i * shape[1], (i + 1) * shape[1]);
output +=
'\n ${row.map((e) => e.toStringAsFixed(1).padLeft(5)).join(' ')}';
// print(row.map((e) => e.toStringAsFixed(1).padLeft(5)).join(' '));
}
return output;
}