-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMatrix.h
More file actions
44 lines (30 loc) · 896 Bytes
/
Matrix.h
File metadata and controls
44 lines (30 loc) · 896 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
34
35
36
37
38
39
40
41
42
43
44
#ifndef _MATRIX_H_
#define _MATRIX_H_
#include <vector>
using std::ostream;
template<class mat_type>
class Matrix;
template<class mat_type>
ostream& operator<<(ostream&, const Matrix<mat_type>& m);
template <class mat_type>
class Matrix
{
friend ostream& operator<< <>(ostream&, const Matrix<mat_type>& m);
private:
std::vector<std::vector<mat_type>> mat;
int dimx;
int dimy;
public:
Matrix(int dim_x, int dim_y, mat_type inst);
Matrix(int dim_x, int dim_y);
Matrix(std::vector<std::vector<mat_type>> &obj);
Matrix(const Matrix<mat_type>& m);
Matrix transpose();
//Matrix& transpose(Matrix& m);
Matrix matmul(Matrix& m);
std::pair<std::size_t, std::size_t> shape() const;
std::vector<std::vector<mat_type>> vec() const;
mat_type& operator() (const size_t a, const size_t b);
//Matrix& operator=(const Matrix& m);
};
#endif