pub struct PartitionTree {
pub cells: Vec<Cell>,
pub split_order: Vec<usize>,
pub k: usize,
}Expand description
Attribute Partition Tree (Algorithm 1 from the paper).
Recursive balanced partition on attributes. Each leaf is a cell of points sharing the same attribute combination.
Fields§
§cells: Vec<Cell>All leaf cells.
split_order: Vec<usize>Attribute split order (permutation of [0..k]).
k: usizeNumber of attribute dimensions.
Implementations§
Source§impl PartitionTree
impl PartitionTree
Sourcepub fn build(store: &PointStore) -> Self
pub fn build(store: &PointStore) -> Self
Build the partition tree from a PointStore. Split order: most-distinct-values first (information gain heuristic).
Sourcepub fn filter_cells(&self, constraints: &[(usize, Vec<u32>)]) -> Vec<usize>
pub fn filter_cells(&self, constraints: &[(usize, Vec<u32>)]) -> Vec<usize>
Find all cells compatible with a filter. A cell is compatible if for every constrained attribute j, the cell’s value on j is in the allowed set.
Sourcepub fn count_points(&self, cell_indices: &[usize]) -> usize
pub fn count_points(&self, cell_indices: &[usize]) -> usize
Total number of points across given cell indices.
Sourcepub fn collect_points(&self, cell_indices: &[usize]) -> Vec<u32>
pub fn collect_points(&self, cell_indices: &[usize]) -> Vec<u32>
Get all point ids in the given cell indices.
Auto Trait Implementations§
impl Freeze for PartitionTree
impl RefUnwindSafe for PartitionTree
impl Send for PartitionTree
impl Sync for PartitionTree
impl Unpin for PartitionTree
impl UnsafeUnpin for PartitionTree
impl UnwindSafe for PartitionTree
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
Converts
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>
Converts
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