matrix1.h 694 Bytes
Newer Older
Mario Bajer's avatar
Mario Bajer committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef MATRIX_H
#define MATRIX_H
 
#include <vector>
using namespace std;
 
class matrix
{
public:
    matrix(int dim, bool random, bool strassen);
   
    inline int dim() {
                        return dim_;
                }
                inline int& operator()(unsigned row, unsigned col) {
                        return data_[dim_*row + col];
                }
 
                inline int operator()(unsigned row, unsigned col) const {
                        return data_[dim_*row + col];
                }
               
                void print();
                matrix operator+(matrix b);
                matrix operator-(matrix b);
 
private:
    int dim_;
    int* data_;