-
Notifications
You must be signed in to change notification settings - Fork 0
/
Cluster.hpp
50 lines (40 loc) · 1.2 KB
/
Cluster.hpp
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
#ifndef CLUSTER_HPP
#define CLUSTER_HPP
#include <algorithm>
#include <iostream>
#include <unordered_map>
#include <functional>
#include <Graph/Node.hpp>
#include <Graph/GraphStd.hpp>
#include <Trie.hpp>
#include <Shingle.hpp>
#include <Biclique.hpp>
class Trie;
class Cluster
{
public:
Cluster(std::vector<NodePtr>* entry);
Cluster(Signatures* entry);
~Cluster() = default;
void computeTrie();
std::vector<BicliquePtr>& getBicliques();
void printCluster();
void printMap();
private:
std::vector<NodePtr>* nodes = nullptr;
Signatures* signatures = nullptr;
std::unordered_map<uInt, uint32_t> mapFrecuency; // Valor Nodo, Frecuencia
std::unordered_map<std::string, uint32_t> mapFrecuencyWeighted; // Valor Nodo, Frecuencia
uint16_t minFreq = 1;
std::unique_ptr<Trie> t;
bool weighted = false;
bool sortSizeCompSign(const SignNode& a, const SignNode& b);
bool sortSizeComp(const NodePtr& a, const NodePtr& b);
void computeFrecuency();
void computeFrecuencyFromSignatures();
void computeHistogram();
void computeHistogramFromSignatures();
void updateFrecuency(uInt& id);
void updateFrecuency(std::string& id);
};
#endif