Skip to main content

Region

Trait Region 

Source
pub trait Region {
    // Required methods
    fn dim(&self) -> usize;
    fn center(&self) -> &[f32];
    fn distance_to_point(&self, point: &[f32]) -> f32;
    fn contains(&self, point: &[f32]) -> bool;
}
Expand description

A geometric region in d-dimensional space.

Regions have a center point (used for ANN candidate retrieval), a distance function from an external point to the region surface, and a containment predicate.

Required Methods§

Source

fn dim(&self) -> usize

Dimensionality of the embedding space.

Source

fn center(&self) -> &[f32]

Center of the region. Used as the proxy point for ANN indexing.

Source

fn distance_to_point(&self, point: &[f32]) -> f32

Minimum L2 distance from point to the region surface. Returns 0.0 if the point is inside the region.

Source

fn contains(&self, point: &[f32]) -> bool

Whether point lies inside (or on the boundary of) this region.

Implementors§