Count of set bits.
(&self)
| 84 | |
| 85 | /// Count of set bits. |
| 86 | pub fn count_ones(&self) -> usize { |
| 87 | self.bits.iter().map(|w| w.count_ones() as usize).sum() |
| 88 | } |
| 89 | |
| 90 | /// Iterate over set bit positions. |
| 91 | pub fn iter_ones(&self) -> impl Iterator<Item = u32> + '_ { |