distances

Crates.iodistances
lib.rsdistances
version1.8.0
sourcesrc
created_at2020-04-22 14:18:32.415103
updated_at2024-10-12 16:28:40.623462
descriptionFast and generic distance functions for high-dimensional data.
homepage
repository
max_upload_size
id232947
size151,164
clam (github:uri-abd:clam)

documentation

README

Distances (v1.8.0)

Fast and generic distance functions for high-dimensional data.

Usage

Add this to your project:

> cargo add distances@1.8.0

Use it in your project:

use distances::Number;
use distances::vectors::euclidean;

let a = [1.0_f32, 2.0, 3.0];
let b = [4.0_f32, 5.0, 6.0];

let distance: f32 = euclidean(&a, &b);

assert!((distance - (27.0_f32).sqrt()).abs() < 1e-6);

Features

  • A Number trait to abstract over different numeric types.
    • Distance functions are generic over the return type implementing Number.
    • Distance functions may also be generic over the input type being a collection of Numbers.
  • SIMD accelerated implementations for float types.
  • Python bindings with maturin and pyo3.
  • no_std support.

Available Distance Functions

Contributing

Contributions are welcome, encouraged, and appreciated! See CONTRIBUTING.md.

License

Licensed under the MIT license.

Commit count: 0

cargo fmt