store an explicit member with the number of on bits; this enables some forthcoming optimizations

This commit is contained in:
Greg Landrum
2007-03-24 05:43:22 +00:00
parent c643e7b2a4
commit 5587bc66a7
2 changed files with 17 additions and 8 deletions

View File

@@ -20,9 +20,9 @@
*/
class ExplicitBitVect : public BitVect {
public:
ExplicitBitVect() : dp_bits(0), d_size(0) {};
ExplicitBitVect() : dp_bits(0), d_size(0), d_numOnBits(0) {};
//! initialize with a particular size;
explicit ExplicitBitVect(unsigned int size) : dp_bits(0), d_size(0) {_InitForSize(size);};
explicit ExplicitBitVect(unsigned int size) : dp_bits(0), d_size(0), d_numOnBits(0) {_InitForSize(size);};
ExplicitBitVect(const ExplicitBitVect& other);
//! construct from a string pickle
ExplicitBitVect(const std::string);
@@ -48,12 +48,13 @@ public:
void GetOnBits (IntVect& v) const;
// FIX: complete these
void ClearBits() { ; };
void ClearBits() { dp_bits->reset(); };
std::string ToString() const;
boost::dynamic_bitset<> *dp_bits; //!< our raw storage
private:
unsigned int d_size;
unsigned int d_numOnBits;
void _InitForSize(const unsigned int size);
};