This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

matrix.h

By: a guest on Nov 29th, 2010  |  syntax: C++  |  size: 0.53 KB  |  views: 990  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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
clone this paste RAW Paste Data