diff options
Diffstat (limited to 'chilbert/BigBitVec.hpp')
-rw-r--r-- | chilbert/BigBitVec.hpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/chilbert/BigBitVec.hpp b/chilbert/BigBitVec.hpp index 83b8a5b..8f8dc6d 100644 --- a/chilbert/BigBitVec.hpp +++ b/chilbert/BigBitVec.hpp @@ -422,6 +422,16 @@ public: return 0; } + /// Return the number of set bits + size_t count() const + { + size_t c = 0; + for (size_t i = 0; i < m_iRacks; ++i) { + c += static_cast<size_t>(pop_count(m_pcRacks[i])); + } + return c; + } + /// Flip all bits (one's complement) CBigBitVec& flip() { |