-
Notifications
You must be signed in to change notification settings - Fork 0
/
Matrix.h
52 lines (45 loc) · 998 Bytes
/
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
#define _USE_MATH_DEFINES
#include <math.h>
#ifndef _MATRIX_H_
#define _MATRIX_H_
namespace ljxMat
{
class Matrix
{
private:
unsigned int width;
unsigned int height;
double *mat;
//Error Code
enum ErrorCode
{
Succeeded,
SizeFail,
Exceed,
MatNull,
Singular
};
ErrorCode result;
public:
//Constructors & Deconstructors
Matrix(const unsigned int _height, const unsigned int _width);
Matrix(const unsigned int _height, const unsigned int _width, const double *_mat);
Matrix(Matrix &matrix);
~Matrix();
//Functions
ErrorCode SetIdentity();
void SetToZero();
double& at(unsigned int row, unsigned int col);
unsigned int Width();
unsigned int Height();
//Operators
void operator=(Matrix& matrix);
Matrix operator*(Matrix& matrix);
Matrix operator*(double x);
Matrix operator+(Matrix& matrix);
Matrix operator-(Matrix& matrix);
Matrix operator!(void); //תÖÃ
Matrix operator~(void); //Äæ
};
}
#endif