rehashing
Public Member Functions | Public Attributes | List of all members
HashTable Class Reference

#include <HashTable.h>

Public Member Functions

 HashTable (shared_ptr< MatrixXd > X, double w, int k, std::mt19937_64 &rng)
 
 HashTable (shared_ptr< MatrixXd > X, double w, int k, vector< pair< int, double >> &samples, std::mt19937_64 &rng)
 
 HashTable (shared_ptr< MatrixXd > X, double w, int k, vector< pair< int, double >> &samples, std::mt19937_64 &rng, int scales)
 
vector< HashBucketsample (VectorXd query)
 

Public Attributes

unordered_map< size_t, HashBuckettable
 
int bucket_count = 0
 

Detailed Description

Hash table for LSH

Constructor & Destructor Documentation

◆ HashTable() [1/3]

HashTable::HashTable ( shared_ptr< MatrixXd >  X,
double  w,
int  k,
std::mt19937_64 &  rng 
)
inline

Construct an LSH table

Parameters
Xdataset
wbin wdith
knumber of hash functions
rng

◆ HashTable() [2/3]

HashTable::HashTable ( shared_ptr< MatrixXd >  X,
double  w,
int  k,
vector< pair< int, double >> &  samples,
std::mt19937_64 &  rng 
)
inline

Construct an LSH table on from the specified set of weighted samples.

Parameters
Xdataset
wbin width
knumber of hash functions
samplesa collection of weighted samples; each pair contains the weight and index of the sample
rngrandom number generator

◆ HashTable() [3/3]

HashTable::HashTable ( shared_ptr< MatrixXd >  X,
double  w,
int  k,
vector< pair< int, double >> &  samples,
std::mt19937_64 &  rng,
int  scales 
)
inline

Construct an LSH table on from the specified set of weighted samples.

Parameters
Xdataset
wbin width
knumber of hash functions
samplesa collection of weighted samples; each pair contains the weight and index of the sample
rngrandom number generator
scalesnumber of weight scales for each bucket

Member Function Documentation

◆ sample()

vector<HashBucket> HashTable::sample ( VectorXd  query)
inline

Find hash buckets that the query falls in.

Parameters
queryquery point
Returns

Member Data Documentation

◆ bucket_count

int HashTable::bucket_count = 0

Number of buckets in the hash table

◆ table

unordered_map<size_t, HashBucket> HashTable::table

Table: map from hash keys to HashBucket objects


The documentation for this class was generated from the following file: