-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSparseMatrix.h
More file actions
78 lines (61 loc) · 1.93 KB
/
SparseMatrix.h
File metadata and controls
78 lines (61 loc) · 1.93 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
//!
//! \file SparseMatrix.h
//! \author Simon Vivier, Jean Marliere, Maxime Dapp
//! \version 1.0
//! \brief Fichier de déclaration de la classe SparseMatrix. Définit les matrices creuses et leurs possibilités d'utilisation.
//!
// --------------------------------
#ifndef SPARSEMATRIX_H
#define SPARSEMATRIX_H
#include <iostream>
#include <iomanip>
#include <fstream>
#include <string>
#include <map>
#include <cstdlib>
#include <time.h>
// --------------------------------
using namespace std;
// --------------------------------
//!
//! \class SparseMatrix
//! \author Simon Vivier, Jean Marliere, Maxime Dapp
//! \brief Cette classe définit ce qu'est une matrice creuse, ses accesseurs, ainsi que les surcharges d'opérateurs associées.
//!
class SparseMatrix
{
private:
float sparseMatrix_use;
map<pair<int,int>,int> sparseMatrix_m;
int sparseMatrix_height;
int sparseMatrix_width;
void SparseMatrix_setUse(float use);
public:
SparseMatrix();
SparseMatrix(int height,int width);
SparseMatrix(SparseMatrix& m2);
SparseMatrix(string path);
~SparseMatrix();
int SparseMatrix_getHeight();
int SparseMatrix_getWidth();
int SparseMatrix_getValue(int x,int y);
int SparseMatrix_getMaxUse();
int SparseMatrix_getUse();
pair<int,int> SparseMatrix_getKey(map<pair<int,int>,int>::iterator it);
void SparseMatrix_setUse();
void SparseMatrix_setHeight(int height);
void SparseMatrix_setWidth(int width);
void SparseMatrix_setValue(int x,int y,int value);
void SparseMatrix_clear();
void SparseMatrix_display();
bool SparseMatrix_loadMatrix(string matrixName);
bool SparseMatrix_saveMatrix(string matrixName);
void operator+=(SparseMatrix& m2);
SparseMatrix& operator+(SparseMatrix& m2);
SparseMatrix& operator*(SparseMatrix& m2);
SparseMatrix& operator=(SparseMatrix& m2);
void SparseMatrix_random(float use);
void SparseMatrix_random();
};
// --------------------------------
#endif