Crate space[][src]

Expand description

This library is intended to be incredibly lightweight (cost nothing), but provide common traits that can be shared among spatial data structures.

Structs

Any data contained in this struct is treated such that all of the bits of the data are each separate dimensions that can be of length 0 or 1. This is referred to as hamming space. This leads to all Lp spaces being equal and all distances being no larger than the number of bits of the data.

L1 distance is applied to items wrapped in this type.

L2 distance is applied to items wrapped in this type.

L-infinity distance is applied to items wrapped in this type.

For k-NN algorithms to return neighbors.

Traits

This trait is implemented by points inside of a metric space.

Functions

Converts a f32 metric to a u32 metric with no loss in precision.

Converts a f64 metric into a u32 metric by truncating 32-bits of precision.

Performs a linear knn search by iterating over everything in the space and performing a binary search on running set of neighbors.