[−][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: Hash,
d: &DataPointSlice,
hash_table: usize
) -> Result<u32>
&mut self,
hash: Hash,
d: &DataPointSlice,
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: &Hash, hash_table: usize) -> Result<HashSet<u32>>
Query the whole bucket
fn get_unique_hash_int(&self) -> FnvHashSet<HashPrimitive>
Provided methods
fn delete(
&mut self,
_hash: &Hash,
_d: &DataPointSlice,
_hash_table: usize
) -> Result<()>
&mut self,
_hash: &Hash,
_d: &DataPointSlice,
_hash_table: usize
) -> Result<()>
fn update_by_idx(
&mut self,
_old_hash: &Hash,
_new_hash: Hash,
_idx: u32,
_hash_table: usize
) -> Result<()>
&mut self,
_old_hash: &Hash,
_new_hash: Hash,
_idx: u32,
_hash_table: usize
) -> Result<()>
fn idx_to_datapoint(&self, _idx: u32) -> Result<&DataPoint>
fn increase_storage(&mut self, _size: usize)
fn describe(&self) -> Result<String>
fn store_hashers<H: VecHash + Serialize>(
&mut self,
_hashers: &[H]
) -> Result<()>
&mut self,
_hashers: &[H]
) -> Result<()>
fn load_hashers<H: VecHash + DeserializeOwned>(&self) -> Result<Vec<H>>
Implementors
impl HashTables for MemoryTable
[src]
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: Hash,
d: &DataPointSlice,
hash_table: usize
) -> Result<u32>
[src]
&mut self,
hash: Hash,
d: &DataPointSlice,
hash_table: usize
) -> Result<u32>
fn delete(
&mut self,
hash: &Hash,
d: &DataPointSlice,
hash_table: usize
) -> Result<()>
[src]
&mut self,
hash: &Hash,
d: &DataPointSlice,
hash_table: usize
) -> Result<()>
Expensive operation we need to do a linear search over all datapoints
fn update_by_idx(
&mut self,
old_hash: &Hash,
new_hash: Hash,
idx: u32,
hash_table: usize
) -> Result<()>
[src]
&mut self,
old_hash: &Hash,
new_hash: Hash,
idx: u32,
hash_table: usize
) -> Result<()>
fn query_bucket(&self, hash: &Hash, hash_table: usize) -> Result<HashSet<u32>>
[src]
Query the whole bucket
fn idx_to_datapoint(&self, idx: u32) -> Result<&DataPoint>
[src]
fn increase_storage(&mut self, size: usize)
[src]
fn describe(&self) -> Result<String>
[src]
fn get_unique_hash_int(&self) -> FnvHashSet<HashPrimitive>
[src]
impl HashTables for SqlTable
[src]
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: Hash,
_d: &DataPointSlice,
hash_table: usize
) -> Result<u32>
[src]
&mut self,
hash: Hash,
_d: &DataPointSlice,
hash_table: usize
) -> Result<u32>
fn query_bucket(&self, hash: &Hash, hash_table: usize) -> Result<HashSet<u32>>
[src]
Query the whole bucket
fn describe(&self) -> Result<String>
[src]
fn store_hashers<H: VecHash + Serialize>(&mut self, hashers: &[H]) -> Result<()>
[src]
fn load_hashers<H: VecHash + DeserializeOwned>(&self) -> Result<Vec<H>>
[src]
fn get_unique_hash_int(&self) -> FnvHashSet<HashPrimitive>
[src]
impl HashTables for SqlTableMem
[src]
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: Hash,
d: &DataPointSlice,
hash_table: usize
) -> Result<u32>
[src]
&mut self,
hash: Hash,
d: &DataPointSlice,
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 delete(
&mut self,
hash: &Hash,
d: &DataPointSlice,
hash_table: usize
) -> Result<()>
[src]
&mut self,
hash: &Hash,
d: &DataPointSlice,
hash_table: usize
) -> Result<()>
fn query_bucket(&self, hash: &Hash, hash_table: usize) -> Result<HashSet<u32>>
[src]
Query the whole bucket