-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMatrix.h
57 lines (45 loc) · 1.41 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
//!
//! \file Matrix.h
//! \author Simon Vivier, Jean Marliere, Maxime Dapp
//! \version 1.0
//! \brief Fichier de déclaration de la classe Matrix. Définit les matrices.
//!
// --------------------------------
#include <string>
#include "FullMatrix.h"
#include "SparseMatrix.h"
class Matrix
{
private:
FullMatrix* matrix_fullMatrix = NULL;
SparseMatrix* matrix_sparseMatrix = NULL;
const static float matrix_conversionCap = 0.2; // % de nombre != de 0 à avoir dans la matrice pour qu'elle soit rentable en SparseMatrix
public:
Matrix();
Matrix(string filePath, bool isSparse);
Matrix(int height, int width);
Matrix(Matrix& m2);
~Matrix();
Matrix& operator=(Matrix& m2);
Matrix& operator+(Matrix& m2);
void operator+=(Matrix& m2);
Matrix& operator-(Matrix& m2);
void operator-=(Matrix& m2);
Matrix& operator*(Matrix& m2);
void operator*=(Matrix& m2);
static int Matrix_getConversionCap();
int Matrix_getValue(int x, int y);
void Matrix_setValue(int x, int y, int value);
int Matrix_getHeight();
void Matrix_setHeight(int height);
int Matrix_getWidth();
void Matrix_setWidth(int width);
FullMatrix* Matrix_getFullMatrix();
void Matrix_setFullMatrix(FullMatrix* m2);
SparseMatrix* Matrix_getSparseMatrix();
void Matrix_setSparseMatrix(SparseMatrix* m2);
void Matrix_conversion();
void Matrix_sparseToFull();
void Matrix_fullToSparse();
void Matrix_display();
};