12#ifndef __RD_EXPLICITBITVECTS_H__
13#define __RD_EXPLICITBITVECTS_H__
16#include <boost/dynamic_bitset.hpp>
34 : dp_bits(nullptr), d_size(0), d_numOnBits(0) {
49 d_size(static_cast<unsigned int>(bits->size())),
50 d_numOnBits(static_cast<unsigned int>(bits->count())) {}
56 bool operator[](
const unsigned int which)
const override;
57 bool setBit(
const unsigned int which)
override;
58 bool unsetBit(
const unsigned int which)
override;
59 bool getBit(
const unsigned int which)
const override;
83 std::unique_ptr<boost::dynamic_bitset<>> dp_bits{
94 unsigned int d_size{0};
95 unsigned int d_numOnBits{0};
96 void _initForSize(
const unsigned int size)
override;
std::vector< int > IntVect
Abstract base class for storing BitVectors.
a class for bit vectors that are densely occupied
bool operator!=(const ExplicitBitVect &o) const
unsigned int getNumOnBits() const override
returns the number of on bits
bool getBit(const unsigned int which) const override
returns the value of a particular bit
std::unique_ptr< boost::dynamic_bitset<> > dp_bits
our raw storage
ExplicitBitVect operator^(const ExplicitBitVect &other) const
ExplicitBitVect(unsigned int size)
initialize with a particular size;
ExplicitBitVect & operator=(ExplicitBitVect &&other) noexcept
ExplicitBitVect operator|(const ExplicitBitVect &other) const
bool setBit(const unsigned int which) override
sets a particular bit and returns its original value
ExplicitBitVect & operator+=(const ExplicitBitVect &other)
void getOnBits(IntVect &v) const override
replaces the contents of v with indices of our on bits
ExplicitBitVect(const std::string &pkl)
construct from a string pickle
ExplicitBitVect(const char *, const unsigned int)
construct from a text pickle
bool operator[](const unsigned int which) const override
ExplicitBitVect operator~() const
ExplicitBitVect & operator|=(const ExplicitBitVect &other)
void clearBits() override
clears (sets to off) all of our bits
ExplicitBitVect & operator^=(const ExplicitBitVect &other)
ExplicitBitVect operator+(const ExplicitBitVect &other) const
ExplicitBitVect(ExplicitBitVect &&other) noexcept
ExplicitBitVect & operator=(const ExplicitBitVect &other)
ExplicitBitVect(unsigned int size, bool bitsSet)
initialize with a particular size and all bits set
std::string toString() const override
returns a serialized (pickled) version of this BitVect
bool operator==(const ExplicitBitVect &o) const
ExplicitBitVect & operator&=(const ExplicitBitVect &other)
ExplicitBitVect(const ExplicitBitVect &other)
~ExplicitBitVect() override
bool unsetBit(const unsigned int which) override
unsets a particular bit and returns its original value
ExplicitBitVect operator&(const ExplicitBitVect &other) const
ExplicitBitVect(boost::dynamic_bitset<> *bits)
unsigned int getNumBits() const override
returns the number of bits (the length of the BitVect)
unsigned int getNumOffBits() const override
returns the number of off bits
#define RDKIT_DATASTRUCTS_EXPORT