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
sourceimpl LinearSearch
impl LinearSearch
Trait Implementations
sourceimpl Clone for LinearSearch
impl Clone for LinearSearch
sourcefn clone(&self) -> LinearSearch
fn clone(&self) -> LinearSearch
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for LinearSearch
impl Debug for LinearSearch
sourceimpl Default for LinearSearch
impl Default for LinearSearch
sourcefn default() -> LinearSearch
fn default() -> LinearSearch
Returns the “default value” for a type. Read more
sourceimpl NearestNeighbour for LinearSearch
impl NearestNeighbour for LinearSearch
sourcefn 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 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 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 more
sourcefn 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 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 NearestNeighbourIndex<F> + 'a>, BuildError>
Builds a spatial index using a default leaf size. See from_batch_with_leaf_size
for more
information. Read more
sourceimpl PartialEq<LinearSearch> for LinearSearch
impl PartialEq<LinearSearch> for LinearSearch
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.