 |
RDKit
Open-source cheminformatics and machine learning.
|
Go to the documentation of this file.
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;
76 return static_cast<unsigned int>(dp_bits->size());
79 return d_size -
static_cast<unsigned int>(dp_bits->size());
97 void _initForSize(
const unsigned int size);
virtual bool getBit(const unsigned int which) const =0
returns the value of a particular bit
IntVect::iterator IntVectIter
virtual bool setBit(const unsigned int which)=0
sets a particular bit and returns its original value
virtual bool operator[](const unsigned int which) const =0
virtual void getOnBits(IntVect &v) const =0
replaces the contents of v with indices of our on bits
unsigned int getNumOffBits() const
returns the number of off bits
unsigned int getNumBits() const
returns the number of bits (the length of the BitVect)
SparseBitVect(unsigned int size)
initialize with a particular size;
unsigned int getNumOnBits() const
returns the number of on bits
IntSet::iterator IntSetIter
bool operator!=(const SparseBitVect &o) const
virtual void clearBits()=0
clears (sets to off) all of our bits
#define RDKIT_DATASTRUCTS_EXPORT
virtual std::string toString() const =0
returns a serialized (pickled) version of this BitVect
IntSet::const_iterator IntSetConstIter
Abstract base class for storing BitVectors.
const IntSet * getBitSet() const
returns a (const) pointer to our raw storage
virtual bool unsetBit(const unsigned int which)=0
unsets a particular bit and returns its original value
a class for bit vectors that are sparsely occupied.
std::vector< int > IntVect
IntSet * dp_bits
our raw data, exposed for the sake of efficiency
SparseBitVect(const SparseBitVect &other)
copy constructor
bool operator==(const SparseBitVect &o) const