pub struct KnearestResult<'a, T, N> {
    pub bot: &'a mut T,
    pub mag: N,
}
Expand description

The dinotree’s Num does not inherit any kind of arithmetic traits. This showcases that the tree construction and pair finding collision algorithms do not involves any arithmetic. However, when finding the nearest neighbor, we need to do some calculations to compute distance between points. So instead of giving the Num arithmetic and thus add uneeded bounds for general use of this tree, the user must provide functions for arithmetic specifically for this function. The user can also specify what the minimum distance function is minizing based off of. For example minimizing based off the square distance will give you the same answer as minimizing based off of the distant. The callback function will be called on the closest object, then the second closest, and so on up until k. User can also this way choose whether to use manhatan distance or not. Its important to distinguish the fact that there is no danger of any of the references returned being the same. The closest is guarenteed to be distinct from the second closest. That is not to say they they don’t overlap in 2d space. Returned by k_nearest_mut

Fields

bot: &'a mut Tmag: N

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.