// MatrixStructure.cpp // // Base class for matrix storage structure. // A size_t is used for indexing. Indexing starts at 1. // // 1 february 1999 RD Started // // (C) Datasim Component Technology 1999 #ifndef MatrixStructure_cpp #define MatrixStructure_cpp #include "MatrixStructure.hpp" // Constructors & destructor template MatrixStructure::MatrixStructure() { // Default constructor } template MatrixStructure::MatrixStructure(const MatrixStructure& source) { // Copy constructor } template MatrixStructure::~MatrixStructure() { // Destructor } // Selectors template inline const V& MatrixStructure::Element(size_t row, size_t column) const { // Get element at position // Use the subscripting operator of derived class return (*this)[row][column]; } template size_t MatrixStructure::MinRowIndex() const { // Return the minimum row index // Always ONE return 1; } template size_t MatrixStructure::MaxRowIndex() const { // Return the maximum row index // Always row size . use the Rows() function of derived classes return Rows(); } template size_t MatrixStructure::MinColumnIndex() const { // Return the minimum column index // Always ONE return 1; } template size_t MatrixStructure::MaxColumnIndex() const { // Return the maximum column index // Always column size. use the Columns() function of derived classes return Columns(); } // Modifiers template inline void MatrixStructure::Element(size_t row, size_t column, const V& val) { // Change element at position // Use the subscripting operator of derived class (*this)[row][column]=val; } // Operators template MatrixStructure& MatrixStructure::operator = (const MatrixStructure& source) { // Assignment operator return *this; } template inline V& MatrixStructure::operator () (size_t row, size_t column) { // Get element at position // Use the subscripting operator of derived class return (*this)[row][column]; } template inline const V& MatrixStructure::operator () (size_t row, size_t column) const { // Get element at position // Use the subscripting operator of derived class return (*this)[row][column]; } #endif // MatrixStructure_cpp