#include "matrix.h" Matrix::Matrix(int nrows, int ncols) { _nrows = nrows; _ncols = ncols; } int Matrix::num_rows() { return _nrows; } int Matrix::num_cols() { return _ncols; } ostream & operator << (ostream & os, Matrix & mat) { for (int i = 0; i < mat.num_rows(); i++) { for (int j = 0; j < mat.num_cols(); j++) os << mat(i, j) << '\t'; os << endl; } return os; }