a class for bit vectors that are densely occupied More...
#include <ExplicitBitVect.h>
Public Member Functions | |
| ExplicitBitVect () | |
| ExplicitBitVect (unsigned int size) | |
| initialize with a particular size; | |
| ExplicitBitVect (const ExplicitBitVect &other) | |
| ExplicitBitVect (const std::string &) | |
| construct from a string pickle | |
| ExplicitBitVect (const char *, const unsigned int) | |
| construct from a text pickle | |
| ~ExplicitBitVect () | |
| ExplicitBitVect & | operator= (const ExplicitBitVect &other) |
| bool | operator[] (const unsigned int which) const |
| bool | setBit (const unsigned int which) |
| sets a particular bit and returns its original value | |
| bool | unsetBit (const unsigned int which) |
| unsets a particular bit and returns its original value | |
| bool | getBit (const unsigned int which) const |
| returns the value of a particular bit | |
| ExplicitBitVect | operator^ (const ExplicitBitVect &other) const |
| ExplicitBitVect | operator& (const ExplicitBitVect &other) const |
| ExplicitBitVect | operator| (const ExplicitBitVect &other) const |
| ExplicitBitVect | operator~ () const |
| unsigned int | getNumBits () const |
| returns the number of bits (the length of the BitVect) | |
| unsigned int | getNumOnBits () const |
| returns the number of on bits | |
| unsigned int | getNumOffBits () const |
| returns the number of off bits | |
| void | getOnBits (IntVect &v) const |
replaces the contents of v with indices of our on bits | |
| void | clearBits () |
| clears (sets to off) all of our bits | |
| std::string | toString () const |
| returns a serialized (pickled) version of this BitVect | |
| bool | operator== (const ExplicitBitVect &o) const |
| bool | operator!= (const ExplicitBitVect &o) const |
Public Attributes | |
| boost::dynamic_bitset * | dp_bits |
| our raw storage | |
a class for bit vectors that are densely occupied
ExplicitBitVect objects store all of their bits using a boost::dynamic_bitset
These are very fast, but can require large amounts of memory for large, sparsely occupied vectors.
Definition at line 25 of file ExplicitBitVect.h.
| ExplicitBitVect::ExplicitBitVect | ( | ) | [inline] |
Definition at line 27 of file ExplicitBitVect.h.
| ExplicitBitVect::ExplicitBitVect | ( | unsigned int | size | ) | [inline, explicit] |
initialize with a particular size;
Definition at line 29 of file ExplicitBitVect.h.
| ExplicitBitVect::ExplicitBitVect | ( | const ExplicitBitVect & | other | ) |
| ExplicitBitVect::ExplicitBitVect | ( | const std::string & | ) |
construct from a string pickle
| ExplicitBitVect::ExplicitBitVect | ( | const char * | , | |
| const unsigned | int | |||
| ) |
construct from a text pickle
| ExplicitBitVect::~ExplicitBitVect | ( | ) |
| void ExplicitBitVect::clearBits | ( | ) | [inline, virtual] |
clears (sets to off) all of our bits
Implements BitVect.
Definition at line 55 of file ExplicitBitVect.h.
References dp_bits.
| bool ExplicitBitVect::getBit | ( | const unsigned int | which | ) | const [virtual] |
returns the value of a particular bit
Implements BitVect.
| unsigned int ExplicitBitVect::getNumBits | ( | ) | const [virtual] |
| unsigned int ExplicitBitVect::getNumOffBits | ( | ) | const [virtual] |
returns the number of off bits
Implements BitVect.
| unsigned int ExplicitBitVect::getNumOnBits | ( | ) | const [virtual] |
returns the number of on bits
Implements BitVect.
| void ExplicitBitVect::getOnBits | ( | IntVect & | v | ) | const [virtual] |
replaces the contents of v with indices of our on bits
Implements BitVect.
| bool ExplicitBitVect::operator!= | ( | const ExplicitBitVect & | o | ) | const [inline] |
Definition at line 63 of file ExplicitBitVect.h.
References dp_bits.
| ExplicitBitVect ExplicitBitVect::operator& | ( | const ExplicitBitVect & | other | ) | const |
| ExplicitBitVect& ExplicitBitVect::operator= | ( | const ExplicitBitVect & | other | ) |
| bool ExplicitBitVect::operator== | ( | const ExplicitBitVect & | o | ) | const [inline] |
Definition at line 60 of file ExplicitBitVect.h.
References dp_bits.
| bool ExplicitBitVect::operator[] | ( | const unsigned int | which | ) | const [virtual] |
Implements BitVect.
| ExplicitBitVect ExplicitBitVect::operator^ | ( | const ExplicitBitVect & | other | ) | const |
| ExplicitBitVect ExplicitBitVect::operator| | ( | const ExplicitBitVect & | other | ) | const |
| ExplicitBitVect ExplicitBitVect::operator~ | ( | ) | const |
| bool ExplicitBitVect::setBit | ( | const unsigned int | which | ) | [virtual] |
sets a particular bit and returns its original value
Implements BitVect.
Referenced by RDInfoTheory::BitCorrMatGenerator::collectVotes().
| std::string ExplicitBitVect::toString | ( | ) | const [virtual] |
| bool ExplicitBitVect::unsetBit | ( | const unsigned int | which | ) | [virtual] |
unsets a particular bit and returns its original value
Implements BitVect.
| boost::dynamic_bitset* ExplicitBitVect::dp_bits |
our raw storage
Definition at line 58 of file ExplicitBitVect.h.
Referenced by clearBits(), operator!=(), and operator==().
1.7.1