pub struct RoutingLayer { /* private fields */ }Expand description
Compressed routing layer for cache-resident operations
Implementations§
Source§impl RoutingLayer
impl RoutingLayer
Sourcepub fn build(centroids: &[f32], dim: usize, config: RoutingConfig) -> Self
pub fn build(centroids: &[f32], dim: usize, config: RoutingConfig) -> Self
Build routing layer from FP32 centroids
Sourcepub fn route(&self, query: &[f32], n_probes: usize) -> Vec<ListCandidate>
pub fn route(&self, query: &[f32], n_probes: usize) -> Vec<ListCandidate>
Route query to top-k lists
Two-stage process:
- Coarse ranking using compressed centroids (cache-resident)
- Refine top candidates using full precision (optional)
Sourcepub fn update_cap(&mut self, list_idx: usize, cap: SphericalCapMetadata)
pub fn update_cap(&mut self, list_idx: usize, cap: SphericalCapMetadata)
Update spherical cap metadata for a list
Sourcepub fn memory_bytes(&self) -> usize
pub fn memory_bytes(&self) -> usize
Get memory footprint
Sourcepub fn fits_in_cache(&self) -> bool
pub fn fits_in_cache(&self) -> bool
Check if routing layer fits in target cache
Sourcepub fn stats(&self) -> RoutingStats
pub fn stats(&self) -> RoutingStats
Get routing statistics
Auto Trait Implementations§
impl Freeze for RoutingLayer
impl RefUnwindSafe for RoutingLayer
impl Send for RoutingLayer
impl Sync for RoutingLayer
impl Unpin for RoutingLayer
impl UnsafeUnpin for RoutingLayer
impl UnwindSafe for RoutingLayer
Blanket Implementations§
impl<T> Allocation for T
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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