pub struct FactorizedSelection { /* private fields */ }Expand description
Hierarchical selection for factorized data.
Tracks selections at each factorization level, enabling filtering without flattening or copying data.
Implementations§
Source§impl FactorizedSelection
impl FactorizedSelection
Sourcepub fn all(level_counts: &[usize]) -> Self
pub fn all(level_counts: &[usize]) -> Self
Creates a selection that selects all values at all levels.
Sourcepub fn new(level_selections: Vec<LevelSelection>) -> Self
pub fn new(level_selections: Vec<LevelSelection>) -> Self
Creates a selection from level selections.
Sourcepub fn level_count(&self) -> usize
pub fn level_count(&self) -> usize
Returns the number of levels.
Sourcepub fn level(&self, level: usize) -> Option<&LevelSelection>
pub fn level(&self, level: usize) -> Option<&LevelSelection>
Gets the selection for a specific level.
Sourcepub fn filter_level<F>(&self, level: usize, predicate: F) -> Self
pub fn filter_level<F>(&self, level: usize, predicate: F) -> Self
Filters at a specific level using a predicate.
Returns a new selection with the filter applied. This is O(n_physical) where n is the physical size of that level, not O(n_logical) where n is the logical row count.
Sourcepub fn is_selected(&self, level: usize, physical_idx: usize) -> bool
pub fn is_selected(&self, level: usize, physical_idx: usize) -> bool
Checks if a physical index at a level is selected.
Sourcepub fn selected_count(&mut self, multiplicities: &[Vec<usize>]) -> usize
pub fn selected_count(&mut self, multiplicities: &[Vec<usize>]) -> usize
Computes and caches the selected logical row count.
The computation considers parent-child relationships: a child is only counted if its parent is selected.
Sourcepub fn invalidate_cache(&mut self)
pub fn invalidate_cache(&mut self)
Invalidates the cached selected count.
Trait Implementations§
Source§impl Clone for FactorizedSelection
impl Clone for FactorizedSelection
Source§fn clone(&self) -> FactorizedSelection
fn clone(&self) -> FactorizedSelection
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for FactorizedSelection
impl RefUnwindSafe for FactorizedSelection
impl Send for FactorizedSelection
impl Sync for FactorizedSelection
impl Unpin for FactorizedSelection
impl UnwindSafe for FactorizedSelection
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