-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathgraph.h
76 lines (64 loc) · 1.29 KB
/
graph.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
//graph.h
//Graph format: Json based format: [src_id, src_weigh,[[connected_ver_0, edge_weight],[connected_ver_1, edge_weight],[connected_ver_2, edge_weight]]]
//Storage format:
//struct{
// int: src_ver
// Arr: [ver_0|ver_1|ver_2|...]
// Int: num_conn_ver
// }
#ifndef GRAPH_H
#define GRAPH_H
#include "wtime.h"
#include <fstream>
#include <string>
#include <iostream>
#include <sstream>
#include <queue>
#include "comm.h"
class graph{
//variable
public:
vertex_t vert_count;
vertex_t *adj_list;
vertex_t *head_list;
// index_t *adj_card;
index_t *beg_pos;
//after sort
vertex_t *upperAdj;
vertex_t *upperHead;
index_t *upperBegin;
index_t *upperDegree;
index_t upperEdgeCount;
index_t edge_count;
vertex_t *heapAdj;
//after partition
vertex_t** partAdj;
vertex_t** partHead;
index_t** partBegin;
index_t** partDegree;
index_t* partEdgeCount;
index_t *count;
int *valid;
//gpu data
// GPU_data *gdata;
//constructor
public:
graph() {};
graph( std::string filename);//,
void info();
void triangle_count();
void validation();
void bsvalidation();
void sort();
void reduce();
void rank_by_degree();
void reverse_rank_by_degree();
void partition();
void* scan(void*data);
void reheap();
void bs();
void tc();
};
//#include "kernel.cu"
//#include "scan.cu"
#endif