 |
RDKit
Open-source cheminformatics and machine learning.
|
Go to the documentation of this file.
12 #ifndef __RD_EXPLICITBITVECTS_H__
13 #define __RD_EXPLICITBITVECTS_H__
16 #include <boost/dynamic_bitset.hpp>
34 : dp_bits(0), d_size(0), d_numOnBits(0) {
48 d_size(static_cast<unsigned int>(bits->size())),
49 d_numOnBits(static_cast<unsigned int>(bits->count())){};
54 bool operator[](
const unsigned int which)
const;
55 bool setBit(
const unsigned int which);
56 bool unsetBit(
const unsigned int which);
57 bool getBit(
const unsigned int which)
const;
92 unsigned int d_numOnBits;
93 void _initForSize(
const unsigned int size);
virtual unsigned int getNumOffBits() const =0
returns the number of off bits
void clearBits()
clears (sets to off) all of our bits
RDKIT_DATASTRUCTS_EXPORT DiscreteValueVect operator+(const DiscreteValueVect &p1, const DiscreteValueVect &p2)
virtual bool getBit(const unsigned int which) const =0
returns the value of a particular bit
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
ExplicitBitVect(boost::dynamic_bitset<> *bits)
construct directly from a dynamic_bitset pointer
boost::dynamic_bitset * dp_bits
our raw storage
virtual unsigned int getNumOnBits() const =0
returns the number of on bits
#define RDKIT_DATASTRUCTS_EXPORT
virtual std::string toString() const =0
returns a serialized (pickled) version of this BitVect
Abstract base class for storing BitVectors.
virtual bool unsetBit(const unsigned int which)=0
unsets a particular bit and returns its original value
std::vector< int > IntVect
bool operator!=(const ExplicitBitVect &o) const
virtual unsigned int getNumBits() const =0
returns the number of bits (the length of the BitVect)
ExplicitBitVect(unsigned int size)
initialize with a particular size;
bool operator==(const ExplicitBitVect &o) const
a class for bit vectors that are densely occupied