-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscan_xp.h
62 lines (40 loc) · 1003 Bytes
/
scan_xp.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
58
59
60
61
#ifndef SCAN_QUERY_SCANXP
#define SCAN_QUERY_SCANXP
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <omp.h> //OpenMP
#include <iostream>
#include <vector>
#include <fstream>
#include <set>
#include <atomic> //CAS
#include "set-inter/csr_set_intersection_serial.h"
using namespace std;
class SCAN_XP {
private:
int min_u_;
double epsilon_;
private:
Graph g;
UnionFind *uf_ptr;
private:
bool CheckHub(Graph *g, UnionFind *uf, int a);
uint32_t BinarySearch(int *array, uint32_t offset_beg, uint32_t offset_end, int val);
private:
void CheckCore(Graph *g);
void ClusterCore();
void LabelNonCore();
void PostProcess();
void MarkClusterMinEleAsId(UnionFind *union_find_ptr);
void PrepareResultOutput();
public:
int thread_num_;
int FindSrc(Graph *g, int u, uint32_t edge_idx);
public:
SCAN_XP(int thread_num, int min_u, double epsilon, char *dir);
~SCAN_XP();
void Execute();
};
#endif