-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMatrix.h
55 lines (47 loc) · 1.2 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
#ifndef MATRIX
#define MATRIX
#include "stdint.h"
#include "stdio.h"
#include <vector>
#include "MyException.h"
class Matrix{
public:
Matrix(int m, int n);
Matrix(Matrix* m);
~Matrix();
void set(int y, int x, double d);
double get(int y, int x);
void identity();
int width();
int height();
void transpose();
void rowSubtract(int r1, int r2);
void rowSwap(int r1, int r2);
void rowMult(int r1, double d);
void rowMultAndSub(int r1, int r2, double d);
bool eschelon();
bool invertable();
Matrix inverse();
Matrix& invert();
void print();
Matrix operator+(Matrix m);
Matrix& operator+=(Matrix m);
Matrix operator-(Matrix m);
Matrix& operator-=(Matrix m);
Matrix operator*(Matrix m);
Matrix& operator*=(Matrix m);
Matrix operator*(uint64_t i);
Matrix& operator*=(uint64_t i);
Matrix operator*(double d);
Matrix& operator*=(double d);
Matrix operator/(Matrix m);
Matrix& operator/=(Matrix m);
Matrix operator/(uint64_t i);
Matrix& operator/=(uint64_t i);
Matrix operator/(double d);
Matrix& operator/=(double d);
private:
int w, h;
vector<double> a;
};
#endif