pub struct BitMask { /* private fields */ }Expand description
Packed bitmask over N rows. One bit per row, stored in 64-bit words.
Iteration uses trailing_zeros() for O(popcount) scanning —
entirely-zero words are skipped in O(1).
Implementations§
Source§impl BitMask
impl BitMask
Sourcepub fn from_bools(bools: &[bool]) -> Self
pub fn from_bools(bools: &[bool]) -> Self
Construct from a bool slice, one entry per row.
Sourcepub fn count_ones(&self) -> usize
pub fn count_ones(&self) -> usize
Number of set bits (visible rows).
Sourcepub fn and(&self, other: &BitMask) -> BitMask
pub fn and(&self, other: &BitMask) -> BitMask
AND two masks together (chained filter semantics).
Panics if nrows differs — this is a programming error (same base data).
Sourcepub fn iter_set(&self) -> impl Iterator<Item = usize> + '_
pub fn iter_set(&self) -> impl Iterator<Item = usize> + '_
Iterate over set row indices in ascending order (deterministic).
Uses word-level bit scanning with trailing_zeros() for O(popcount)
iteration. Entirely-zero words are skipped in O(1).
Sourcepub fn size_bytes(&self) -> usize
pub fn size_bytes(&self) -> usize
Memory size in bytes.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BitMask
impl RefUnwindSafe for BitMask
impl Send for BitMask
impl Sync for BitMask
impl Unpin for BitMask
impl UnsafeUnpin for BitMask
impl UnwindSafe for BitMask
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more