 |
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())){};
55 bool setBit(
const unsigned int which);
57 bool getBit(
const unsigned int which)
const;
92 unsigned int d_numOnBits;
93 void _initForSize(
const unsigned int size);
ExplicitBitVect operator~() const
ExplicitBitVect operator|(const ExplicitBitVect &other) const
void clearBits()
clears (sets to off) all of our bits
ExplicitBitVect & operator+=(const ExplicitBitVect &other)
ExplicitBitVect & operator^=(const ExplicitBitVect &other)
unsigned int getNumBits() const
returns the number of bits (the length of the BitVect)
ExplicitBitVect(boost::dynamic_bitset<> *bits)
construct directly from a dynamic_bitset pointer
void getOnBits(IntVect &v) const
replaces the contents of v with indices of our on bits
boost::dynamic_bitset * dp_bits
our raw storage
ExplicitBitVect & operator=(const ExplicitBitVect &other)
bool unsetBit(const unsigned int which)
unsets a particular bit and returns its original value
#define RDKIT_DATASTRUCTS_EXPORT
bool operator[](const unsigned int which) const
Abstract base class for storing BitVectors.
unsigned int getNumOffBits() const
returns the number of off bits
bool getBit(const unsigned int which) const
returns the value of a particular bit
std::string toString() const
returns a serialized (pickled) version of this BitVect
unsigned int getNumOnBits() const
returns the number of on bits
ExplicitBitVect(const ExplicitBitVect &other)
ExplicitBitVect operator^(const ExplicitBitVect &other) const
ExplicitBitVect & operator|=(const ExplicitBitVect &other)
bool setBit(const unsigned int which)
sets a particular bit and returns its original value
ExplicitBitVect(unsigned int size, bool bitsSet)
initialize with a particular size and all bits set
std::vector< int > IntVect
bool operator!=(const ExplicitBitVect &o) const
ExplicitBitVect & operator&=(const ExplicitBitVect &other)
ExplicitBitVect(const char *, const unsigned int)
construct from a text pickle
ExplicitBitVect operator+(const ExplicitBitVect &other) const
ExplicitBitVect(unsigned int size)
initialize with a particular size;
ExplicitBitVect operator&(const ExplicitBitVect &other) const
ExplicitBitVect(const std::string &)
construct from a string pickle
bool operator==(const ExplicitBitVect &o) const
a class for bit vectors that are densely occupied