[−][src]Trait lsh_rs::HashTables
Hashtable consisting of L
Hash tables.
Required methods
fn new(
n_hash_tables: usize,
only_index_storage: bool,
db_path: &str
) -> Result<Box<Self>>
n_hash_tables: usize,
only_index_storage: bool,
db_path: &str
) -> Result<Box<Self>>
fn put(&mut self, hash: Vec<K>, d: &[N], hash_table: usize) -> Result<u32>
Arguments
hash
- hashed vector.d
- Vector to store in the buckets.hash_table
- Number of the hash_table to store the vector. Ranging from 0 to L.
fn query_bucket(&self, hash: &[K], hash_table: usize) -> Result<HashSet<u32>>
Query the whole bucket
fn get_unique_hash_int(&self) -> FnvHashSet<i32>
Provided methods
fn delete(&mut self, _hash: &[K], _d: &[N], _hash_table: usize) -> Result<()>
fn update_by_idx(
&mut self,
_old_hash: &[K],
_new_hash: Vec<K>,
_idx: u32,
_hash_table: usize
) -> Result<()>
&mut self,
_old_hash: &[K],
_new_hash: Vec<K>,
_idx: u32,
_hash_table: usize
) -> Result<()>
fn idx_to_datapoint(&self, _idx: u32) -> Result<&Vec<N>>
fn increase_storage(&mut self, _size: usize)
fn describe(&self) -> Result<String>
fn store_hashers<H: VecHash<N, K> + Serialize>(
&mut self,
_hashers: &[H]
) -> Result<()>
&mut self,
_hashers: &[H]
) -> Result<()>
fn load_hashers<H: VecHash<N, K> + DeserializeOwned>(&self) -> Result<Vec<H>>
Implementors
impl<N, K> HashTables<N, K> for MemoryTable<N, K> where
N: Numeric,
K: Integer,
[src]
N: Numeric,
K: Integer,
fn new(
n_hash_tables: usize,
only_index_storage: bool,
_: &str
) -> Result<Box<Self>>
[src]
n_hash_tables: usize,
only_index_storage: bool,
_: &str
) -> Result<Box<Self>>
fn put(&mut self, hash: Vec<K>, d: &[N], hash_table: usize) -> Result<u32>
[src]
fn delete(&mut self, hash: &[K], d: &[N], hash_table: usize) -> Result<()>
[src]
Expensive operation we need to do a linear search over all datapoints
fn update_by_idx(
&mut self,
old_hash: &[K],
new_hash: Vec<K>,
idx: u32,
hash_table: usize
) -> Result<()>
[src]
&mut self,
old_hash: &[K],
new_hash: Vec<K>,
idx: u32,
hash_table: usize
) -> Result<()>
fn query_bucket(&self, hash: &[K], hash_table: usize) -> Result<HashSet<u32>>
[src]
Query the whole bucket
fn idx_to_datapoint(&self, idx: u32) -> Result<&Vec<N>>
[src]
fn increase_storage(&mut self, size: usize)
[src]
fn describe(&self) -> Result<String>
[src]
fn get_unique_hash_int(&self) -> FnvHashSet<i32>
[src]
impl<N, K> HashTables<N, K> for SqlTable<N, K> where
N: Numeric,
K: Integer,
[src]
N: Numeric,
K: Integer,
fn new(
n_hash_tables: usize,
only_index_storage: bool,
db_path: &str
) -> Result<Box<Self>>
[src]
n_hash_tables: usize,
only_index_storage: bool,
db_path: &str
) -> Result<Box<Self>>
fn put(&mut self, hash: Vec<K>, _d: &[N], hash_table: usize) -> Result<u32>
[src]
fn query_bucket(&self, hash: &[K], hash_table: usize) -> Result<HashSet<u32>>
[src]
Query the whole bucket
fn describe(&self) -> Result<String>
[src]
fn store_hashers<H: VecHash<N, K> + Serialize>(
&mut self,
hashers: &[H]
) -> Result<()>
[src]
&mut self,
hashers: &[H]
) -> Result<()>
fn load_hashers<H: VecHash<N, K> + DeserializeOwned>(&self) -> Result<Vec<H>>
[src]
fn get_unique_hash_int(&self) -> FnvHashSet<i32>
[src]
impl<N, K> HashTables<N, K> for SqlTableMem<N, K> where
N: Numeric,
K: Integer,
[src]
N: Numeric,
K: Integer,
fn new(
n_hash_tables: usize,
only_index_storage: bool,
_db_path: &str
) -> Result<Box<Self>>
[src]
n_hash_tables: usize,
only_index_storage: bool,
_db_path: &str
) -> Result<Box<Self>>
fn put(&mut self, hash: Vec<K>, d: &[N], hash_table: usize) -> Result<u32>
[src]
Arguments
hash
- hashed vector.d
- Vector to store in the buckets.hash_table
- Number of the hash_table to store the vector. Ranging from 0 to L.
fn delete(&mut self, hash: &[K], d: &[N], hash_table: usize) -> Result<()>
[src]
fn query_bucket(&self, hash: &[K], hash_table: usize) -> Result<HashSet<u32>>
[src]
Query the whole bucket