readMatrix<T> method

Future<void> readMatrix<T>(
  1. Matrix<T> a,
  2. int m,
  3. int n
)

Implementation

Future<void> readMatrix<T>(Matrix<T> a, int m, int n) async {
  a = a.having(offset: (x: 0, y: 0));
  for (var i = 0; i < m; i++) {
    final dataIter = (await readData<T>(n)).iterator;
    for (var j = 0; j < n; j++) {
      if (!dataIter.moveNext()) break;
      a[i][j] = dataIter.current;
    }
  }
}