10 #ifndef __RD_SPARSEBITVECTS_H__ 11 #define __RD_SPARSEBITVECTS_H__ 46 std::copy(bv->begin(),bv->end(),std::inserter(*
dp_bits,
dp_bits->end()));
56 bool operator[](
const unsigned int which)
const;
66 bool setBit(
const unsigned int which);
68 bool unsetBit(
const unsigned int which);
69 bool getBit (
const unsigned int which)
const;
92 void _initForSize(
const unsigned int size);
SparseBitVect operator|(const SparseBitVect &) const
unsigned int getNumOffBits() const
returns the number of off bits
unsigned int getNumOnBits() const
returns the number of on bits
SparseBitVect operator^(const SparseBitVect &) const
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.
bool operator!=(const SparseBitVect &o) const
void getOnBits(IntVect &v) const
replaces the contents of v with indices of our on bits
IntSet::const_iterator IntSetConstIter
IntSet::iterator IntSetIter
SparseBitVect operator&(const SparseBitVect &) const
unsigned int getNumBits() const
returns the number of bits (the length of the BitVect)
std::string toString() const
returns a serialized (pickled) version of this BitVect
bool operator==(const SparseBitVect &o) const
SparseBitVect operator~() const
unsigned int size() const
SparseBitVect & operator=(const SparseBitVect &)
bool getBit(const unsigned int which) const
returns the value of a particular bit
void clearBits()
clears (sets to off) all of our bits
std::vector< int > IntVect
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 unsigned int which) const
SparseBitVect(unsigned int size)
initialize with a particular size;