Struct linfa_nn::LinearSearch
source · pub struct LinearSearch;
Expand description
Implementation of linear search, which is the simplest nearest neighbour algorithm. All queries
are implemented by scanning through every point, so all of them are O(N)
. Calling
from_batch
returns a LinearSearchIndex
.
Implementations§
source§impl LinearSearch
impl LinearSearch
Trait Implementations§
source§impl Clone for LinearSearch
impl Clone for LinearSearch
source§fn clone(&self) -> LinearSearch
fn clone(&self) -> LinearSearch
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for LinearSearch
impl Debug for LinearSearch
source§impl Default for LinearSearch
impl Default for LinearSearch
source§fn default() -> LinearSearch
fn default() -> LinearSearch
Returns the “default value” for a type. Read more
source§impl NearestNeighbour for LinearSearch
impl NearestNeighbour for LinearSearch
source§fn from_batch_with_leaf_size<'a, F: Float, DT: Data<Elem = F>, D: 'a + Distance<F>>(
&self,
batch: &'a ArrayBase<DT, Ix2>,
leaf_size: usize,
dist_fn: D
) -> Result<Box<dyn Send + Sync + NearestNeighbourIndex<F> + 'a>, BuildError>
fn from_batch_with_leaf_size<'a, F: Float, DT: Data<Elem = F>, D: 'a + Distance<F>>( &self, batch: &'a ArrayBase<DT, Ix2>, leaf_size: usize, dist_fn: D ) -> Result<Box<dyn Send + Sync + NearestNeighbourIndex<F> + 'a>, BuildError>
Builds a spatial index using a MxN two-dimensional array representing M points with N
dimensions. Also takes
leaf_size
, which specifies the number of elements in the leaf
nodes of tree-like index structures. Read moresource§fn from_batch<'a, F: Float, DT: Data<Elem = F>, D: 'a + Distance<F>>(
&self,
batch: &'a ArrayBase<DT, Ix2>,
dist_fn: D
) -> Result<Box<dyn Send + Sync + NearestNeighbourIndex<F> + 'a>, BuildError>
fn from_batch<'a, F: Float, DT: Data<Elem = F>, D: 'a + Distance<F>>( &self, batch: &'a ArrayBase<DT, Ix2>, dist_fn: D ) -> Result<Box<dyn Send + Sync + NearestNeighbourIndex<F> + 'a>, BuildError>
Builds a spatial index using a default leaf size. See
from_batch_with_leaf_size
for more
information.source§impl PartialEq for LinearSearch
impl PartialEq for LinearSearch
source§fn eq(&self, other: &LinearSearch) -> bool
fn eq(&self, other: &LinearSearch) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for LinearSearch
impl StructuralEq for LinearSearch
impl StructuralPartialEq for LinearSearch
Auto Trait Implementations§
impl RefUnwindSafe for LinearSearch
impl Send for LinearSearch
impl Sync for LinearSearch
impl Unpin for LinearSearch
impl UnwindSafe for LinearSearch
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.