summaryrefslogtreecommitdiff
path: root/extractor/veb.cc
blob: f38f672ea5ef5f8603e8eeb7e90b81b55bfbe5cb (plain)
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
#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) {}