pub struct VamanaGraph {
pub neighbors: Vec<Vec<u32>>,
pub medoid: u32,
pub max_degree: usize,
pub build_beam: usize,
pub alpha: f32,
}Expand description
Vamana graph with bounded out-degree
Fields§
§neighbors: Vec<Vec<u32>>§medoid: u32§max_degree: usize§build_beam: usize§alpha: f32Implementations§
Source§impl VamanaGraph
impl VamanaGraph
pub fn new(n: usize, max_degree: usize, build_beam: usize, alpha: f32) -> Self
Sourcepub fn build(&mut self, vectors: &FlatVectors) -> Result<()>
pub fn build(&mut self, vectors: &FlatVectors) -> Result<()>
Build the Vamana graph over flat vector storage
Sourcepub fn greedy_search_fast(
&self,
vectors: &FlatVectors,
query: &[f32],
beam_width: usize,
visited: &mut VisitedSet,
) -> (Vec<u32>, usize)
pub fn greedy_search_fast( &self, vectors: &FlatVectors, query: &[f32], beam_width: usize, visited: &mut VisitedSet, ) -> (Vec<u32>, usize)
Greedy beam search with reusable VisitedSet (zero-alloc per query)
Sourcepub fn greedy_search(
&self,
vectors: &FlatVectors,
query: &[f32],
beam_width: usize,
) -> (Vec<u32>, usize)
pub fn greedy_search( &self, vectors: &FlatVectors, query: &[f32], beam_width: usize, ) -> (Vec<u32>, usize)
Public search entry point (allocates its own VisitedSet)
Auto Trait Implementations§
impl Freeze for VamanaGraph
impl RefUnwindSafe for VamanaGraph
impl Send for VamanaGraph
impl Sync for VamanaGraph
impl Unpin for VamanaGraph
impl UnsafeUnpin for VamanaGraph
impl UnwindSafe for VamanaGraph
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
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