[][src]Trait lsh_rs::HashTables

pub trait HashTables<N, K> where
    N: Numeric,
    K: Integer
{ fn new(
        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>;
fn query_bucket(
        &self,
        hash: &[K],
        hash_table: usize
    ) -> Result<HashSet<u32>>;
fn get_unique_hash_int(&self) -> FnvHashSet<i32>; 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<()> { ... }
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<()> { ... }
fn load_hashers<H: VecHash<N, K> + DeserializeOwned>(
        &self
    ) -> Result<Vec<H>> { ... } }

Hashtable consisting of L Hash tables.

Required methods

fn new(
    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>

Loading content...

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<()>

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<()>

fn load_hashers<H: VecHash<N, K> + DeserializeOwned>(&self) -> Result<Vec<H>>

Loading content...

Implementors

impl<N, K> HashTables<N, K> for MemoryTable<N, K> where
    N: Numeric,
    K: Integer
[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 query_bucket(&self, hash: &[K], hash_table: usize) -> Result<HashSet<u32>>[src]

Query the whole bucket

impl<N, K> HashTables<N, K> for SqlTable<N, K> where
    N: Numeric,
    K: Integer
[src]

fn query_bucket(&self, hash: &[K], hash_table: usize) -> Result<HashSet<u32>>[src]

Query the whole bucket

impl<N, K> HashTables<N, K> for SqlTableMem<N, K> where
    N: Numeric,
    K: Integer
[src]

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 query_bucket(&self, hash: &[K], hash_table: usize) -> Result<HashSet<u32>>[src]

Query the whole bucket

Loading content...