-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrie.h
54 lines (46 loc) · 1.24 KB
/
trie.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
#ifndef _TRIE_H
#define _TRIE_H
#include<stdio.h>
#include<stdlib.h>
#include<queue>
#include "CutSplit.h"
using namespace std;
class trie {
struct nodeItem {
bool isleaf;
int nrules;
range field[MAXDIMENSIONS];
int *ruleid;
unsigned int ncuts;
hs_node_t* rootnode;
int* child;
int layNo;
int flag; //Cutting or Splitting
};
public:
int binth;
int pass; // max trie level
int k; //dim. of small
int freelist; // first nodeItem on free list
unsigned int threshold;
int Total_Rule_Size; // number of rules stored
int Total_Array_Size;
int Leaf_Node_Count;
int NonLeaf_Node_Count;
float total_ficuts_memory_in_KB;
float total_hs_memory_in_KB;
float total_memory_in_KB;
int max_depth;
int numrules;
pc_rule *rule;
int root; // root of trie
nodeItem *nodeSet; // base of array of NodeItems
public:
queue<int> qNode; //queue for node
trie(int, int, pc_rule*, pc_rule*,int, int);
~trie();
int count_np_ficut(nodeItem*);
void createtrie();
int trieLookup(int*);
};
#endif