summaryrefslogtreecommitdiff
path: root/extractor/veb.cc
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.cc
parentce6937f136a38af93d9a5cd9628acc712da95543 (diff)
Initial working commit.
Diffstat (limited to 'extractor/veb.cc')
-rw-r--r--extractor/veb.cc25
1 files changed, 25 insertions, 0 deletions
diff --git a/extractor/veb.cc b/extractor/veb.cc
new file mode 100644
index 00000000..f38f672e
--- /dev/null
+++ b/extractor/veb.cc
@@ -0,0 +1,25 @@
+#include "veb.h"
+
+#include "veb_bitset.h"
+#include "veb_tree.h"
+
+int VEB::MIN_BOTTOM_BITS = 5;
+int VEB::MIN_BOTTOM_SIZE = 1 << VEB::MIN_BOTTOM_BITS;
+
+shared_ptr<VEB> VEB::Create(int size) {
+ if (size > MIN_BOTTOM_SIZE) {
+ return shared_ptr<VEB>(new VEBTree(size));
+ } else {
+ return shared_ptr<VEB>(new VEBBitset(size));
+ }
+}
+
+int VEB::GetMinimum() {
+ return min;
+}
+
+int VEB::GetMaximum() {
+ return max;
+}
+
+VEB::VEB(int min, int max) : min(min), max(max) {}