[−][src]Struct smartcore::algorithm::neighbour::cover_tree::CoverTree
Implements Cover Tree algorithm
Implementations
impl<T: Debug + PartialEq, F: RealNumber, D: Distance<T, F>> CoverTree<T, F, D>
[src]
pub fn new(data: Vec<T>, distance: D) -> Result<CoverTree<T, F, D>, Failed>
[src]
Construct a cover tree.
data
- vector of data points to search for.distance
- distance metric to use for searching. This function should extendDistance
interface.
pub fn find(&self, p: &T, k: usize) -> Result<Vec<(usize, F, &T)>, Failed>
[src]
Find k nearest neighbors of p
p
- look for k nearest points top
k
- the number of nearest neighbors to return
pub fn find_radius(
&self,
p: &T,
radius: F
) -> Result<Vec<(usize, F, &T)>, Failed>
[src]
&self,
p: &T,
radius: F
) -> Result<Vec<(usize, F, &T)>, Failed>
Find all nearest neighbors within radius radius
from p
p
- look for k nearest points top
radius
- radius of the search
Trait Implementations
impl<T: Debug, F: Debug + RealNumber, D: Debug + Distance<T, F>> Debug for CoverTree<T, F, D>
[src]
impl<'de, T, F: RealNumber, D: Distance<T, F>> Deserialize<'de> for CoverTree<T, F, D> where
T: Deserialize<'de>,
F: Deserialize<'de>,
D: Deserialize<'de>,
[src]
T: Deserialize<'de>,
F: Deserialize<'de>,
D: Deserialize<'de>,
pub fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<T, F: RealNumber, D: Distance<T, F>> PartialEq<CoverTree<T, F, D>> for CoverTree<T, F, D>
[src]
pub fn eq(&self, other: &Self) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<T, F: RealNumber, D: Distance<T, F>> Serialize for CoverTree<T, F, D> where
T: Serialize,
F: Serialize,
D: Serialize,
[src]
T: Serialize,
F: Serialize,
D: Serialize,
Auto Trait Implementations
impl<T, F, D> RefUnwindSafe for CoverTree<T, F, D> where
D: RefUnwindSafe,
F: RefUnwindSafe,
T: RefUnwindSafe,
[src]
D: RefUnwindSafe,
F: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, F, D> Send for CoverTree<T, F, D> where
D: Send,
F: Send,
T: Send,
[src]
D: Send,
F: Send,
T: Send,
impl<T, F, D> Sync for CoverTree<T, F, D> where
D: Sync,
F: Sync,
T: Sync,
[src]
D: Sync,
F: Sync,
T: Sync,
impl<T, F, D> Unpin for CoverTree<T, F, D> where
D: Unpin,
F: Unpin,
T: Unpin,
[src]
D: Unpin,
F: Unpin,
T: Unpin,
impl<T, F, D> UnwindSafe for CoverTree<T, F, D> where
D: UnwindSafe,
F: UnwindSafe,
T: UnwindSafe,
[src]
D: UnwindSafe,
F: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,