[][src]Struct flann::VecIndex

pub struct VecIndex<T: Indexable + 'static> { /* fields omitted */ }

Methods

impl<T: Indexable> VecIndex<T>[src]

pub fn new<I, P>(
    point_len: usize,
    points: I,
    parameters: Parameters
) -> Result<Self, FlannError> where
    I: IntoIterator<Item = P>,
    P: IntoIterator<Item = T>, 
[src]

pub fn add(&mut self, point: Vec<T>) -> Result<(), FlannError>[src]

Adds a point to the index.

pub fn add_many<I, P>(&mut self, points: I) -> Result<(), FlannError> where
    I: IntoIterator<Item = P>,
    P: IntoIterator<Item = T>, 
[src]

Adds multiple points to the index.

Methods from Deref<Target = SliceIndex<'static, T>>

pub fn add_slice(&mut self, point: &'a [T]) -> Result<(), FlannError>[src]

Adds a point to the index.

pub fn add_many_slices(&mut self, points: &'a [T]) -> Result<(), FlannError>[src]

Adds multiple points to the index.

pub fn get(&self, idx: usize) -> Option<&'a [T]>[src]

Get the point that corresponds to this index idx.

pub fn remove(&mut self, idx: usize)[src]

Removes a point at index idx.

pub fn len(&self) -> usize[src]

pub fn is_empty(&self) -> bool[src]

pub fn find_nearest_neighbor(
    &mut self,
    point: &[T]
) -> Result<Neighbor<T::ResultType>, FlannError>
[src]

Performs a search to find only the closest neighbor.

pub fn find_nearest_neighbors(
    &mut self,
    num: usize,
    point: &[T]
) -> Result<impl Iterator<Item = Neighbor<T::ResultType>>, FlannError>
[src]

Performs k-NN search for num neighbors. If there are less points in the set than num it returns that many neighbors.

pub fn find_nearest_neighbors_radius(
    &mut self,
    num: usize,
    radius_squared: f32,
    point: &[T]
) -> Result<impl Iterator<Item = Neighbor<T::ResultType>>, FlannError>
[src]

Performs k-NN search for num neighbors, limiting the search to radius distance. If there are less points in the set than num it returns that many neighbors.

The returned iterator is sorted by closest to furthest.

pub fn find_many_nearest_neighbors<I, P>(
    &mut self,
    num: usize,
    points: I
) -> Result<IntoChunks<impl Iterator<Item = Neighbor<T::ResultType>>>, FlannError> where
    I: IntoIterator<Item = P>,
    P: IntoIterator<Item = T>, 
[src]

Performs k-NN search for num neighbors for several points.

If there are less points in the set than num it returns that many neighbors for each point.

pub fn find_many_nearest_neighbors_flat(
    &mut self,
    num: usize,
    points: &[T]
) -> Result<IntoChunks<impl Iterator<Item = Neighbor<T::ResultType>>>, FlannError>
[src]

Performs k-NN search on num neighbors for several points.

If there are less points in the set than num it returns that many neighbors for each point.

This assumes points are already in a slice of memory in component order where there are point_len components (as specified in new or new_flat).

Trait Implementations

impl<T: Indexable> Drop for VecIndex<T>[src]

impl<T: Indexable> Deref for VecIndex<T>[src]

type Target = SliceIndex<'static, T>

The resulting type after dereferencing.

impl<T: Indexable> DerefMut for VecIndex<T>[src]

Auto Trait Implementations

impl<T> !Send for VecIndex<T>

impl<T> !Sync for VecIndex<T>

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Same for T

type Output = T

Should always be Self