[][src]Crate space

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

Structs

Hamming

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

L1 distance is applied to items wrapped in this type.

L2

L2 distance is applied to items wrapped in this type.

LInfinity

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

Neighbor

For k-NN algorithms to return neighbors.

Traits

MetricPoint

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

Functions

f32_metric

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

f64_metric

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

linear_knn

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