[][src]Crate hnsw

Re-exports

pub use candidates::*;
pub use generic_array::typenum;

Modules

candidates

Structs

Euclidean

Any list, vector, etc of floats wrapped in Euclidean is to be treated as having euclidean distance.

GenericArray

Struct representing a generic array - GenericArray<T, N> works like [T; N]

HNSW

This provides a HNSW implementation for any distance function.

Hamming

Treats each bit contained in this struct as its own dimension and distance is computed as hamming distance.

Params
Searcher

Contains all the state used when searching the HNSW

Traits

ArrayLength

Trait making GenericArray work, marking types to be used as length of an array

Distance

This is the primary trait used by the HNSW. This is also implemented for FloatingDistance. If your features have a floating point distance, please implement the distance using FloatingDistance. Implementing FloatingDistance implements Distance so long as you satisfy its conditions.

FloatingDistance

Implement this trait when your features have a floating point distance between them. You will take no performance penalty for doing so. Please ensure your distance satisfies the conditions on floating_distance.

Type Definitions

f32x2

A 64-bit vector with 2 f32 lanes.

f32x4

A 128-bit vector with 4 f32 lanes.

f32x8

A 256-bit vector with 8 f32 lanes.

f32x16

A 512-bit vector with 16 f32 lanes.

u128x2

A 256-bit vector with 2 u128 lanes.

u128x4

A 512-bit vector with 4 u128 lanes.