-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSimpleMatrix.hpp
More file actions
33 lines (20 loc) · 805 Bytes
/
SimpleMatrix.hpp
File metadata and controls
33 lines (20 loc) · 805 Bytes
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
30
31
32
33
#IFNDEF __SIMPLE_MATRIX_H
#DEFINE __SIMPLE_MATRIX_H
#include <vector>
template <typename Type = double> class SimpleMatrix {
private:
vector<vector<Type>> > mat;// use a vector of vectors to store values
public:
SimpleMatrix(); //Default Constructor
//Constructor specfying #rows, #columns and a default type value
SimpleMatrix(const int& rows, const int& cols, const Type& val); //Parameter Constructor
//copy constructor
SimpleMatrix(const SimpleMatrix<Type>& _rhs);
//Assignment operator overloaded
SimpleMatrix<Type>& operator= (const SimpleMatrix<Type>& _rhs);
virtual ~SimpleMatrix(); //Destructor
//Access to the matrix values directly, via row and colum indices
vector<vector<Type> > get_mat() const;
Type& value(const int&row, const int&col);
};
#ENDIF