#ifndef _densematrix_h_ #define _densematrix_h_ #include using namespace std; #include "matrix.h" template class DenseMatrix: public Matrix { public: DenseMatrix(int nrows, int ncols); ValType & operator()(int i, int j); private: vector _values; }; template DenseMatrix::DenseMatrix(int nrows, int ncols) : Matrix(nrows, ncols) { _values.resize(nrows * ncols); } template ValType & DenseMatrix::operator()(int i, int j) { return _values[j + i * this->_ncols]; } #endif