-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmatrix.h
56 lines (40 loc) · 1.31 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
#ifndef MATRIX_H
#define MATRIX_H
#include "fraction.h"
#include <vector>
#include <sys/types.h>
class matrix
{
public:
matrix();
~matrix();
void enterMatrix();
void print();
void clear();
void push_back(std::vector<fraction> temp);
std::size_t size(unsigned depth);
std::vector< std::vector<fraction> > toVector();
std::vector<fraction> operator [](std::size_t idx);
friend fraction det(matrix inMatrix);
friend matrix getInversiveMatrix(matrix inMatrix);
friend matrix getMinor(matrix inMatrix, size_t exclRow, size_t exclCol);
friend matrix transposeMatrix(matrix inMatrix);
fraction det();
matrix getInversiveMatrix();
matrix getMinor(size_t exclRow, size_t exclCol);
matrix transposeMatrix();
matrix operator +(matrix inMatrix);
matrix operator -(matrix inMatrix);
matrix operator +(fraction number);
matrix operator -(fraction number);
matrix operator *(matrix inMatrix);
matrix operator *(fraction number);
matrix operator /(fraction number);
private:
std::vector< std::vector<fraction> > matr;
fraction det(matrix inMatrix);
matrix getInversiveMatrix(matrix inMatrix);
matrix getMinor(matrix inMatrix, size_t exclRow, size_t exclCol);
matrix transposeMatrix(matrix inMatrix);
};
#endif // MATRIX_H