pub struct LinearScan<S> { /* private fields */ }Expand description
Checks every stored state on each query: O(n) per query, no preprocessing.
Exact for any metric and fine for a few thousand nodes. Use a spatial index for more.
Trait Implementations§
Source§impl<S: Clone> Clone for LinearScan<S>
impl<S: Clone> Clone for LinearScan<S>
Source§impl<S: Debug> Debug for LinearScan<S>
impl<S: Debug> Debug for LinearScan<S>
Source§impl<S> Default for LinearScan<S>
impl<S> Default for LinearScan<S>
Source§impl<Sp: StateSpace> NearestNeighbors<Sp> for LinearScan<Sp::State>
impl<Sp: StateSpace> NearestNeighbors<Sp> for LinearScan<Sp::State>
Source§fn nearest(&self, space: &Sp, query: &Sp::State) -> Option<usize>
fn nearest(&self, space: &Sp, query: &Sp::State) -> Option<usize>
The id of the node closest to
query, or None if the structure is empty.Source§fn within_radius(
&self,
space: &Sp,
query: &Sp::State,
radius: f64,
out: &mut Vec<usize>,
)
fn within_radius( &self, space: &Sp, query: &Sp::State, radius: f64, out: &mut Vec<usize>, )
Replaces the contents of
out with the ids of all nodes within radius of query,
in insertion order.Source§impl<Sp: StateSpace> RemovableNeighbors<Sp> for LinearScan<Sp::State>
impl<Sp: StateSpace> RemovableNeighbors<Sp> for LinearScan<Sp::State>
Auto Trait Implementations§
impl<S> Forget for LinearScan<S>
impl<S> Freeze for LinearScan<S>
impl<S> Move for LinearScan<S>
impl<S> RefUnwindSafe for LinearScan<S>
impl<S> Send for LinearScan<S>
impl<S> Sync for LinearScan<S>
impl<S> Unpin for LinearScan<S>
impl<S> UnsafeUnpin for LinearScan<S>
impl<S> UnwindSafe for LinearScan<S>
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