~DeltaEncoder();
void setBit(usint value);
+ void setRun(usint start, usint len);
+
+ // These versions are just for compatibility with RLEVector.
+ void addBit(usint value);
+ void addRun(usint start, usint len);
+ void flush(); // Does nothing.
+
+ protected:
+
+ // These are not allowed.
+ DeltaEncoder();
+ DeltaEncoder(const DeltaEncoder&);
+ DeltaEncoder& operator = (const DeltaEncoder&);
};
class DeltaVector : public BitVector
{
public:
+ typedef DeltaEncoder Encoder;
+
DeltaVector(std::ifstream& file);
- DeltaVector(DeltaEncoder& encoder, usint universe_size);
+ DeltaVector(std::FILE * file);
+ DeltaVector(Encoder& encoder, usint universe_size);
~DeltaVector();
//--------------------------------------------------------------------------
- usint rank(usint value, bool at_least = false);
+ usint reportSize() const;
+
+//--------------------------------------------------------------------------
+
+ class Iterator : public BitVector::Iterator
+ {
+ public:
+ Iterator(const DeltaVector& par);
+ ~Iterator();
+
+ usint rank(usint value, bool at_least = false);
+
+ usint select(usint index);
+ usint selectNext();
- usint select(usint index);
- usint selectNext();
+ pair_type valueAfter(usint value);
+ pair_type nextValue();
- pair_type valueAfter(usint value);
- pair_type nextValue();
+ pair_type selectRun(usint index, usint max_length);
+ pair_type selectNextRun(usint max_length);
- pair_type selectRun(usint index, usint max_length);
- pair_type selectNextRun(usint max_length);
+ bool isSet(usint value);
- bool isSet(usint value);
+ // Counts the number of 1-bit runs.
+ usint countRuns();
+
+ protected:
+
+ // These are not allowed.
+ Iterator();
+ Iterator(const Iterator&);
+ Iterator& operator = (const Iterator&);
+ };
//--------------------------------------------------------------------------
- usint reportSize();
+ protected:
+
+ // These are not allowed.
+ DeltaVector();
+ DeltaVector(const DeltaVector&);
+ DeltaVector& operator = (const DeltaVector&);
};