#include <HashBucket.h>
|
| HashBucket () |
|
| HashBucket (VectorXd p) |
|
| HashBucket (VectorXd p, double wi) |
|
| HashBucket (VectorXd p, double wi, int idx, int nscales) |
|
void | update (VectorXd p, std::mt19937_64 &rng) |
|
void | update (VectorXd p, double wi, std::mt19937_64 &rng) |
|
void | update (VectorXd p, double wi, int idx, std::mt19937_64 &rng) |
|
|
int | SCALES = 1 |
|
vector< int > | count |
|
vector< VectorXd > | sample |
|
vector< double > | wSum |
|
std::uniform_real_distribution | unif |
|
Hash bucket for LSH tables
◆ HashBucket() [1/4]
HashBucket::HashBucket |
( |
| ) |
|
|
inline |
◆ HashBucket() [2/4]
HashBucket::HashBucket |
( |
VectorXd |
p | ) |
|
|
inline |
Build a new hash bucket for data point p.
- Parameters
-
p | a data point that belongs to the bucket |
◆ HashBucket() [3/4]
HashBucket::HashBucket |
( |
VectorXd |
p, |
|
|
double |
wi |
|
) |
| |
|
inline |
Build a new hash bucket for data point p and weight wi.
- Parameters
-
p | a data point that belongs to the bucket |
wi | weight of the data point |
◆ HashBucket() [4/4]
HashBucket::HashBucket |
( |
VectorXd |
p, |
|
|
double |
wi, |
|
|
int |
idx, |
|
|
int |
nscales |
|
) |
| |
|
inline |
Build a new hash bucket for data point p, weight wi, scale idx out of a total of nscales scales
- Parameters
-
p | data |
wi | weight |
idx | index of scale that p falls into in the bucket |
nscales | total number of scales |
◆ update() [1/3]
void HashBucket::update |
( |
VectorXd |
p, |
|
|
std::mt19937_64 & |
rng |
|
) |
| |
|
inline |
Insert point into bucket: update count and replace bucket sample with reservoir sampling.
- Parameters
-
p | data point |
rng | random number generator |
◆ update() [2/3]
void HashBucket::update |
( |
VectorXd |
p, |
|
|
double |
wi, |
|
|
std::mt19937_64 & |
rng |
|
) |
| |
|
inline |
Insert point p with weight wi into bucket: update count and replace bucket sample with weighted reservoir sampling (A-Chao).
- Parameters
-
p | data point |
wi | weight of data point |
rng | random number generator |
◆ update() [3/3]
void HashBucket::update |
( |
VectorXd |
p, |
|
|
double |
wi, |
|
|
int |
idx, |
|
|
std::mt19937_64 & |
rng |
|
) |
| |
|
inline |
Insert point p with weight wi, belonging to scale idx into bucket: update count and replace bucket sample with weighted reservoir sampling (A-Chao). Note that samples for each scale is stored and updated separately.
- Parameters
-
p | data point |
wi | weight of data point |
idx | scale idx of data point |
rng | random number generator |
◆ count
vector<int> HashBucket::count |
Count of data points that falls into the bucket
◆ sample
vector<VectorXd> HashBucket::sample |
Samples of data points that falls into the bucket
◆ SCALES
int HashBucket::SCALES = 1 |
Store SCALES data samples per bucket, one from each weight scale. Comparing to storing 1 sample per bucket (default), storing more samples slightly longer but is more accurate. We do not recommend setting this to more than 3.
◆ wSum
vector<double> HashBucket::wSum |
Sum of weights of all data points that falls into the bucket.
The documentation for this class was generated from the following file: