11 #ifndef __RD_SPARSEBITVECTS_H__ 12 #define __RD_SPARSEBITVECTS_H__ 48 std::copy(bv->begin(), bv->end(), std::inserter(*dp_bits, dp_bits->end()));
58 bool operator[](
const unsigned int which)
const;
68 bool setBit(
const unsigned int which);
70 bool unsetBit(
const unsigned int which);
71 bool getBit(
const unsigned int which)
const;
75 unsigned int getNumOnBits()
const {
return static_cast<unsigned int>(dp_bits->size()); };
76 unsigned int getNumOffBits()
const {
return d_size -
static_cast<unsigned int>(dp_bits->size()); };
93 void _initForSize(
const unsigned int size);
unsigned int getNumOnBits() const
returns the number of 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
a class for bit vectors that are sparsely occupied.
virtual void clearBits()=0
clears (sets to off) all of our bits
IntSet::const_iterator IntSetConstIter
IntSet::iterator IntSetIter
#define RDKIT_DATASTRUCTS_EXPORT
bool operator!=(const SparseBitVect &o) const
virtual bool unsetBit(const unsigned int which)=0
unsets a particular bit and returns its original value
virtual bool operator[](const unsigned int which) const =0
unsigned int getNumOffBits() const
returns the number of off bits
virtual bool getBit(const unsigned int which) const =0
returns the value of a particular bit
virtual void getOnBits(IntVect &v) const =0
replaces the contents of v with indices of our on bits
std::vector< int > IntVect
virtual std::string toString() const =0
returns a serialized (pickled) version of this BitVect
SparseBitVect(const SparseBitVect &other)
copy constructor
Abstract base class for storing BitVectors.
virtual bool setBit(const unsigned int which)=0
sets a particular bit and returns its original value
bool operator==(const SparseBitVect &o) const
SparseBitVect(unsigned int size)
initialize with a particular size;