SHARE
TWEET

matrix.h

a guest Nov 29th, 2010 1,829 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #ifndef MATRIX_H
  2. #define MATRIX_H
  3.  
  4. #include <vector>
  5. using namespace std;
  6.  
  7. class matrix
  8. {
  9. public:
  10.     matrix(int dim, bool random, bool strassen);
  11.    
  12.     inline int dim() {
  13.                         return dim_;
  14.                 }
  15.                 inline int& operator()(unsigned row, unsigned col) {
  16.                         return data_[dim_*row + col];
  17.                 }
  18.  
  19.                 inline int operator()(unsigned row, unsigned col) const {
  20.                         return data_[dim_*row + col];
  21.                 }
  22.                
  23.                 void print();
  24.                 matrix operator+(matrix b);
  25.                 matrix operator-(matrix b);
  26.  
  27. private:
  28.     int dim_;
  29.     int* data_;
  30. };
  31.  
  32. #endif
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top