10 #ifndef __RD_SPARSEBITVECTS_H__ 11 #define __RD_SPARSEBITVECTS_H__ 47 std::copy(bv->begin(), bv->end(), std::inserter(*
dp_bits,
dp_bits->end()));
57 bool operator[](
const unsigned int which)
const;
67 bool setBit(
const unsigned int which);
69 bool unsetBit(
const unsigned int which);
70 bool getBit(
const unsigned int which)
const;
92 void _initForSize(
const unsigned int size);
unsigned int getNumOnBits() const
returns the number of on bits
std::string toString() const
returns a serialized (pickled) version of this BitVect
SparseBitVect operator~() const
SparseBitVect operator &(const SparseBitVect &) const
void getOnBits(IntVect &v) const
replaces the contents of v with indices of our on bits
unsigned int getNumBits() const
returns the number of bits (the length of the BitVect)
IntVect::iterator IntVectIter
IntSet * dp_bits
our raw data, exposed for the sake of efficiency
const IntSet * getBitSet() const
returns a (const) pointer to our raw storage
bool setBit(const unsigned int which)
sets a particular bit and returns its original value
a class for bit vectors that are sparsely occupied.
IntSet::const_iterator IntSetConstIter
IntSet::iterator IntSetIter
bool operator!=(const SparseBitVect &o) const
bool getBit(const unsigned int which) const
returns the value of a particular bit
unsigned int getNumOffBits() const
returns the number of off bits
unsigned int size() const
SparseBitVect & operator=(const SparseBitVect &)
SparseBitVect operator|(const SparseBitVect &) const
void clearBits()
clears (sets to off) all of our bits
std::vector< int > IntVect
bool operator[](const unsigned int which) const
bool unsetBit(const unsigned int which)
unsets a particular bit and returns its original value
SparseBitVect(const SparseBitVect &other)
copy constructor
Abstract base class for storing BitVectors.
bool operator==(const SparseBitVect &o) const
SparseBitVect(unsigned int size)
initialize with a particular size;
SparseBitVect operator^(const SparseBitVect &) const