pub struct BitMask { /* private fields */ }Expand description
A compact, word-aligned bitmask over nrows rows.
Words are u64, stored LSB-first within each word. Bit i is set in
words[i / 64] at position i % 64. Tail bits (above nrows) are
guaranteed to be zero so that iteration never yields phantom rows.
Implementations§
Source§impl BitMask
impl BitMask
Sourcepub fn from_bools(bools: &[bool]) -> Self
pub fn from_bools(bools: &[bool]) -> Self
Construct from a Vec<bool>, one entry per row.
Sourcepub fn count_ones(&self) -> usize
pub fn count_ones(&self) -> usize
Number of set bits (masked-in rows).
Sourcepub fn and(&self, other: &BitMask) -> BitMask
pub fn and(&self, other: &BitMask) -> BitMask
Merge two masks with AND semantics (chain of filter().filter()).
Panics if nrows differs – this is a programming error (same base df).
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).
Sourcepub fn words_slice(&self) -> &[u64]
pub fn words_slice(&self) -> &[u64]
Read-only access to the backing words. Used by AdaptiveSelection
to perform AND/OR over raw words without re-iterating bit-by-bit.
Sourcepub fn from_words_for_test(words: Vec<u64>, nrows: usize) -> Self
pub fn from_words_for_test(words: Vec<u64>, nrows: usize) -> Self
Construct a BitMask directly from owned words and a row count.
The caller must ensure tail bits past nrows are zero. Used by
AdaptiveSelection::intersect/union after the AND/OR step.
Trait Implementations§
impl Eq for BitMask
impl StructuralPartialEq for BitMask
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more