forked from HaoyaWHL/TDOA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMatrix.h
67 lines (52 loc) · 1.25 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#pragma once
#ifndef MATRIX_FILE
#define MATRIX_FILE
/*Matrix.h*/
#include <vector>
using namespace std;
enum DIM
{
ROW = 0,
COL,
BUTT
};
class MAT
{
public:
MAT(){}
MAT(int row,int col)
{resizeMat(row,col);}
MAT(const MAT& inMat)
{mMat = inMat.getMyMat();}
void operator =(vector<vector<double>> value);
~MAT(){}
int getRowSize()
{return mMat.size();}
vector<vector<double>> getMyMat()const
{return mMat;}
void push(vector<double> inVec)
{mMat.push_back(inVec);}
int getColSize()
{return mMat[0].size();}
void setValue(int row,int col,double value)
{mMat[row][col] = value;}
void resizeMat(int row,int col);
double at(int row,int col);
MAT MyMatrixDiffConstValue (double conValue);
MAT MyMatTanspose();
MAT MyMatDivide(double value);
MAT MyInv ();
MAT MyGetCol(int colNum);
MAT MyGetRow(int rowNum);
double MyMean(DIM inDim,int index);
MAT operator -(MAT &matRight);
MAT operator -(double value);
MAT operator *(MAT &matRight);
MAT operator *(double multiValue);
bool MyMatMatch_DimEqual(MAT &matRight);
bool MyMatMatch_DimMulti(MAT &matRight);
void ArrayToMat_Constructor(double *inArray,int rowSize,int colSize);
private:
vector<vector<double>> mMat;
};
#endif