RReverser / acap

As Close As Possible — nearest neighbor search in Rust

Home Page:https://tavianator.com/projects/acap.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

acap

crates.io Documentation License Build Status

As Close As Possible — nearest neighbor search in Rust.

Example

use acap::euclid::Euclidean;
use acap::vp::VpTree;
use acap::NearestNeighbors;

let tree = VpTree::balanced(vec![
    Euclidean([3, 4]),
    Euclidean([5, 12]),
    Euclidean([8, 15]),
    Euclidean([7, 24]),
]);

let nearest = tree.nearest(&[7, 7]).unwrap();
assert_eq!(nearest.item, &Euclidean([3, 4]));
assert_eq!(nearest.distance, 5);

About

As Close As Possible — nearest neighbor search in Rust

https://tavianator.com/projects/acap.html

License:MIT License


Languages

Language:Rust 98.7%Language:HTML 1.3%