-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmatrix.h
38 lines (35 loc) · 910 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
#pragma once
#include"vector"
#include <math.h>
using namespace std;
class Matrix
{
public:
Matrix();
vector<vector<double>> GetMatrix(int x, int y);
vector<vector<double>> GetMatrix(int x, int y,vector<double> datalist);
Matrix Hexchange(int x, int y);
Matrix Vexchange(int x, int y);
void printx();
void printy();
void printmatrix();
bool equal();
Matrix operator+(const Matrix& other) const;
Matrix operator+(const double& other) const;
Matrix operator-(const Matrix& other) const;
Matrix operator-(const double& other) const;
Matrix operator*(const Matrix& other) const;
Matrix operator*(const double& other) const;
Matrix transpose();
Matrix UMatrix();
Matrix LMatrix();
Matrix inv();
Matrix solve(Matrix& A, Matrix& B);
double det();
//int Level();
private:
int num_x = 0;
int num_y = 0;
bool level = true;
vector<vector<double>> data;
};