-
Notifications
You must be signed in to change notification settings - Fork 3
/
matrix.h
53 lines (53 loc) · 1.32 KB
/
matrix.h
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
45
46
47
48
49
50
51
52
53
#ifndef __MATRIX_H
#define __MATRIX_H
#include <vector>
template<typename T>
class matrix{
public:
//CONSTRUCTORS
matrix();
matrix(const int&,const T&);
matrix(const int&,const int&,const T&);
matrix(const std:: vector< std ::vector<T> > & );
matrix(const std:: initializer_list< std:: initializer_list<T> > & );
//DESTURCTOR
~matrix();
//OPERATOR OVERLOADING
inline T& operator () (const int& ,const int& );
template<typename F>
decltype(auto) operator + (matrix<F>&);
template<typename F>
decltype(auto) operator - (matrix<F>&);
template<typename F>
decltype(auto) operator * (matrix<F>&);
template<typename F>
decltype(auto) operator / (const F&);
template<typename F>
decltype(auto) operator * (const F& val);
template<typename F>
matrix<T> operator % (const F&);
template<typename F>
void operator += (matrix<F>&);
template<typename F>
void operator -= (matrix<F>&);
template<typename F>
void operator *= (matrix<F>&);
template<typename F>
void operator *= (const F&);
template<typename F>
void operator /= (const F&);
template<typename F>
void operator %= (const F&);
//INPUT/OUTPUT
void print();
//OTHERS
const std::pair<int,int> dim();
template<typename F>
matrix<T> exp(F,long long int MOD=-1);
private:
std::vector<std::vector<T>> __array;
int size_x;
int size_y;
long long int __mod;
};
#endif //MATRIX_H