14 This class is used to construct a DeltaVector.
17 class DeltaEncoder : public VectorEncoder
20 DeltaEncoder(usint block_bytes, usint superblock_size = VectorEncoder::SUPERBLOCK_SIZE);
23 void setBit(usint value);
24 void setRun(usint start, usint len);
26 // These versions are just for compatibility with RLEVector.
27 void addBit(usint value);
28 void addRun(usint start, usint len);
29 void flush(); // Does nothing.
33 // These are not allowed.
35 DeltaEncoder(const DeltaEncoder&);
36 DeltaEncoder& operator = (const DeltaEncoder&);
41 This is a gap-encoded bit vector using delta coding.
44 class DeltaVector : public BitVector
47 typedef DeltaEncoder Encoder;
49 DeltaVector(std::ifstream& file);
50 DeltaVector(std::FILE * file);
51 DeltaVector(Encoder& encoder, usint universe_size);
54 //--------------------------------------------------------------------------
56 usint reportSize() const;
58 //--------------------------------------------------------------------------
60 class Iterator : public BitVector::Iterator
63 Iterator(const DeltaVector& par);
66 usint rank(usint value, bool at_least = false);
68 usint select(usint index);
71 pair_type valueAfter(usint value);
72 pair_type nextValue();
74 pair_type selectRun(usint index, usint max_length);
75 pair_type selectNextRun(usint max_length);
77 bool isSet(usint value);
79 // Counts the number of 1-bit runs.
84 // These are not allowed.
86 Iterator(const Iterator&);
87 Iterator& operator = (const Iterator&);
90 //--------------------------------------------------------------------------
94 // These are not allowed.
96 DeltaVector(const DeltaVector&);
97 DeltaVector& operator = (const DeltaVector&);
104 #endif // DELTAVECTOR_H