copy method

Matrix copy()

Returns a deep copy of the Matrix.

Implementation

Matrix copy() {
  List<List<double>> storage = [];
  for (int i = 0; i < m; i++) {
    storage.add(List<double>.generate(n, (j) => this[i][j]));
  }
  return Matrix(storage);
}