summaryrefslogtreecommitdiff
path: root/extractor/veb_tree.h
diff options
context:
space:
mode:
authorPaul Baltescu <pauldb89@gmail.com>2013-01-28 11:56:31 +0000
committerPaul Baltescu <pauldb89@gmail.com>2013-01-28 11:56:31 +0000
commit5530575ae0ad939e17f08d6bd49978acea388ab7 (patch)
tree4620a276c1c827d824e285148f4f4a5bf781ebfe /extractor/veb_tree.h
parentce6937f136a38af93d9a5cd9628acc712da95543 (diff)
Initial working commit.
Diffstat (limited to 'extractor/veb_tree.h')
-rw-r--r--extractor/veb_tree.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/extractor/veb_tree.h b/extractor/veb_tree.h
new file mode 100644
index 00000000..578d3e6a
--- /dev/null
+++ b/extractor/veb_tree.h
@@ -0,0 +1,29 @@
+#ifndef _VEB_TREE_H_
+#define _VEB_TREE_H_
+
+#include <memory>
+#include <vector>
+
+using namespace std;
+
+#include "veb.h"
+
+class VEBTree: public VEB {
+ public:
+ VEBTree(int size);
+
+ void Insert(int value);
+
+ int GetSuccessor(int value);
+
+ private:
+ int GetNextValue(int value);
+ int GetCluster(int value);
+ int Compose(int cluster, int value);
+
+ int lower_bits, upper_size;
+ shared_ptr<VEB> summary;
+ vector<shared_ptr<VEB> > clusters;
+};
+
+#endif