#ifndef MATRIX_PROXY_H #define MATRIX_PROXY_H #include "range.h" #include "matrix_expression.h" /***************************************************** * matrix_proxy class ****************************************************/ class matrix_proxy : public matrix_expression { private: matrix_expression& _M; // reference to the underlying source (which may be matrix or proxy) const range _rows; // copy of range describe extent of rows const range _cols; // copy of range describing extent of columns public: // use inherited assignment operator (rather than default) using matrix_expression::operator=; matrix_proxy& operator=(const matrix_proxy& other); // constructor matrix_proxy(matrix_expression& src, const range& rows, const range& ccols); int numRows() const; int numColumns() const; // read-only version of indexing operator double operator()(int r, int c) const; // write-access version of indexing operator double& operator()(int r, int c); }; #endif