// $Id: matrix.h 370 2007-11-09 22:33:51Z cactus $ -*- c++ -*- #ifndef PP_ASSOC_MATRIX_H #define PP_ASSOC_MATRIX_H #include #include class Matrix { unsigned int cRow, cCol; std::vector rgf; public: Matrix (unsigned int cRow, unsigned int cCol); Matrix & operator= (const Matrix &m); unsigned int rows () const { return cRow; } unsigned int cols () const { return cCol; } const double& operator() (unsigned int i, unsigned int j) const { return rgf[i * cCol + j]; } double& operator() (unsigned int i, unsigned int j) { return rgf[i * cCol + j]; } void pvm_pack () const; static Matrix pvm_unpack (); void print (std::ostream &stream); }; Matrix operator* (const Matrix &mA, const Matrix &mB); #endif /* PP_ASSOC_MATRIX_H */