-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpagerank.h
More file actions
56 lines (39 loc) · 1.25 KB
/
Copy pathpagerank.h
File metadata and controls
56 lines (39 loc) · 1.25 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
#ifndef __PageRank_H__
#define __PageRank_H__
#include "Matrice.h"
#include "json.h"
#include <vector>
#include <utility>
#define EPS 1e-15
class PageRank {
public:
PageRank();
Matrix getVp();
std::vector<std::string> getAll();
std::vector<std::pair<double, std::string>> getRank();
double getVp(int);
std::string getAll(int);
double getAllFirst(int i);
std::string getAllSecond(int i);
int getSize();
void calculate(nlohmann::json, double = 0.85, int = 100);
void calculate(const char*, double = 0.85, int = 100);
void calculateFaulty(nlohmann::json, int = 100);
void calculateFaulty(const char*, int = 100);
void display() const;
void displayRank() const;
void fillRank();
void sortRankDescending();
void sortRankAscending();
void calculateRankDescending();
void calculateRankAscending();
int calculateEpsilon(const char*, double = 0.85, double = EPS);
int calculateEpsilon(nlohmann::json j, double = 0.85, double = EPS);
void calculateEpsilonFaulty(const char*, double = 0.85, double = EPS);
void calculateEpsilonFaulty(nlohmann::json j, double = 0.85, double = EPS);
private:
Matrix Vp;
std::vector<std::string> all;
std::vector<std::pair<double, std::string>> rank;
};
#endif