4 releases (2 breaking)

0.3.1 Mar 10, 2024
0.3.0 Feb 20, 2024
0.2.0 Feb 20, 2024
0.1.0 Feb 19, 2024

#252 in Database implementations

Download history 1/week @ 2024-01-07 304/week @ 2024-02-18 164/week @ 2024-02-25 32/week @ 2024-03-03 232/week @ 2024-03-10 11/week @ 2024-03-17 1/week @ 2024-03-24 19/week @ 2024-03-31 21/week @ 2024-04-07 149/week @ 2024-04-14

192 downloads per month

Apache-2.0/MIT

11KB
214 lines

Vector Package Documentation Build

The package provides a vector database allowing for efficient search of nearest neighbors.

Example

use vector::Index;

let vectors = vec![
    [4.0, 2.0],
    [5.0, 7.0],
    [2.0, 9.0],
    [7.0, 8.0],
];
let index = Index::build(&vectors, 1, 1, 42);

let query = [5.0, 5.0];
let (indices, distances): (Vec<_>, Vec<_>) = index
    .search(&vectors, &query, 2)
    .into_iter()
    .unzip();
assert_eq!(indices, &[1, 0]);

Contribution

Your contribution is highly appreciated. Do not hesitate to open an issue or a pull request. Note that any contribution submitted for inclusion in the project will be licensed according to the terms given in LICENSE.md.

Dependencies

~7KB