What is an efficient way to get the number of bits set in a System.Collections.BitArray (like bitset.count in C++ or BitSet.cardinality in Java)?
So far I only found solutions for BitArray smaller than 64 bit, for example: Counting bits set in a .Net BitArray Class