proximity-cache 0.1.1

Experiments on approximate vector search in high-dimensional spaces
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::numerics::comp::ApproxComparable;

// size of caches in implementations where that should be known at comptime
pub const COMPTIME_CACHE_SIZE: usize = 1024;

pub trait ApproximateCache<K, V>
where
    K: ApproxComparable,
    V: Clone,
{
    fn find(&mut self, key: &K) -> Option<V>;
    fn insert(&mut self, key: K, value: V);
    fn len(&self) -> usize;
    fn is_empty(&self) -> bool {
        self.len() == 0
    }
}