transpose method

Matrix transpose()

Implementation

Matrix transpose() {
  final List<Vector> cols = <Vector>[];
  for (int j = 0; j < ncols; j++) {
    final List<double> col = <double>[];
    for (int i = 0; i < nrows; i++) {
      col.add(_rows[i][j]);
    }
    cols.add(Vector.fromList(col));
  }
  return Matrix.fromRows(cols);
}