Skip to main content

CrackIndex

Struct CrackIndex 

Source
pub struct CrackIndex { /* private fields */ }
Expand description

Adaptive crack index for progressive column partitioning.

Maintains a permutation of row indices and a sorted set of crack points. Each filter operation partitions the relevant region around the predicate pivot, progressively sorting the column across repeated queries.

Only works with numeric columns (values convertible to f64).

§Example

let mut crack = CrackIndex::new(column.len());
let gt5 = crack.filter_gt(&column, 5.0);  // partitions around 5.0
let gt3 = crack.filter_gt(&column, 3.0);  // refines: only re-scans [0, 5.0] region

Implementations§

Source§

impl CrackIndex

Source

pub fn new(len: usize) -> Self

Create a new crack index for a column of len rows.

Source

pub fn num_cracks(&self) -> usize

Number of crack points recorded so far.

Source

pub fn filter_gt(&mut self, column: &Column, value: f64) -> Vec<usize>

Return row indices where column[row] > value.

Source

pub fn filter_lte(&mut self, column: &Column, value: f64) -> Vec<usize>

Return row indices where column[row] <= value.

Source

pub fn filter_gte(&mut self, column: &Column, value: f64) -> Vec<usize>

Return row indices where column[row] >= value.

Source

pub fn filter_lt(&mut self, column: &Column, value: f64) -> Vec<usize>

Return row indices where column[row] < value.

Source

pub fn filter_eq(&mut self, column: &Column, value: f64) -> Vec<usize>

Return row indices where column[row] == value.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.