-
Notifications
You must be signed in to change notification settings - Fork 6
/
Grail.h
59 lines (53 loc) · 2.07 KB
/
Grail.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
/* Copyright (c) Hilmi Yildirim 2010,2011.
The software is provided on an as is basis for research purposes.
There is no additional support offered, nor are the author(s)
or their institutions liable under any circumstances.
*/
#ifndef _BOX_H
#define _BOX_H
#include "GraphUtil.h"
#include "exception_list.h"
// test switch
#define _TEST_
class Grail {
public:
Graph& g;
struct timeval after_time, before_time;
float run_time;
int dim;
int *visited;
int QueryCnt;
bool LEVEL_FILTER;
bool POOL;
int POOLSIZE;
unsigned int PositiveCut, NegativeCut, TotalCall, TotalDepth, CurrentDepth;
public:
Grail(Graph& graph, int dim);
Grail(Graph& graph, int dim, int labelingType, bool POOL, int POOLSIZE);
~Grail();
static int visit(Graph& tree, int vid, int& pre_post, vector<bool>& visited);
static int fixedreversevisit(Graph& tree, int vid, int& pre_post, vector<bool>& visited,int traversal);
static int customvisit(Graph& tree, int vid, int& pre_post, vector<bool>& visited, int traversal);
static void randomlabeling(Graph& tree);
static void customlabeling(Graph& tree, int traversal);
static void fixedreverselabeling(Graph& tree, int traversal);
static void setIndex(Graph& tree, int traversal);
static void setCustomIndex(Graph& tree, int traversal, int type);
void set_level_filter(bool lf);
bool reach(int src, int trg, ExceptionList * el);
bool reach_lf(int src, int trg, ExceptionList * el);
bool bidirectionalReach(int src, int trg, ExceptionList * el);
bool bidirectionalReach_lf(int src, int trg, ExceptionList * el);
bool reachPP(int src, int trg, ExceptionList * el);
bool reachPP_lf(int src, int trg, ExceptionList * el);
bool bidirectionalReachPP(int src, int trg, ExceptionList * el);
bool bidirectionalReachPP_lf(int src, int trg, ExceptionList * el);
bool go_for_reach(int src, int trg);
bool go_for_reach_lf(int src, int trg);
bool go_for_reachPP(int src, int trg);
bool go_for_reachPP_lf(int src, int trg);
bool contains(int src, int trg);
int containsPP(int src, int trg);
void index_size(int* ind_size);
};
#endif