[−][src]Struct flann::VecIndex
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]
point_len: usize,
points: I,
parameters: Parameters
) -> Result<Self, FlannError> where
I: IntoIterator<Item = P>,
P: IntoIterator<Item = T>,
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]
I: IntoIterator<Item = P>,
P: IntoIterator<Item = T>,
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]
&mut self,
point: &[T]
) -> Result<Neighbor<T::ResultType>, FlannError>
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]
&mut self,
num: usize,
point: &[T]
) -> Result<impl Iterator<Item = Neighbor<T::ResultType>>, FlannError>
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]
&mut self,
num: usize,
radius_squared: f32,
point: &[T]
) -> Result<impl Iterator<Item = Neighbor<T::ResultType>>, FlannError>
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]
&mut self,
num: usize,
points: I
) -> Result<IntoChunks<impl Iterator<Item = Neighbor<T::ResultType>>>, FlannError> where
I: IntoIterator<Item = P>,
P: IntoIterator<Item = T>,
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]
&mut self,
num: usize,
points: &[T]
) -> Result<IntoChunks<impl Iterator<Item = Neighbor<T::ResultType>>>, FlannError>
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.
fn deref(&self) -> &Self::Target
[src]
impl<T: Indexable> DerefMut for VecIndex<T>
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Same for T
type Output = T
Should always be Self