#include <composite.h>
Public Types | |
typedef LSH | Super |
typedef Super::Domain | Domain |
Public Member Functions | |
template<typename RNG> | |
void | reset (const Parameter ¶m, RNG &rng) |
template<typename RNG> | |
Repeat (const Parameter ¶m, RNG &rng) | |
unsigned | getRange () const |
unsigned | operator() (Domain obj) const |
template<class Archive> | |
void | serialize (Archive &ar, const unsigned int version) |
Protected Attributes | |
std::vector< Super > | lsh_ |
unsigned | dup_ |
unsigned | range_ |
unsigned | unit_ |
Classes | |
struct | Parameter |
The concatenation of a number of LSHes of the same class is usually used as a new LSH to augment the locality sensitivity. The Repeat class is to concatenate N independent LSH instances.
The domain of LSH remains the same. The new parameter is defined as:
struct Parameter { unsigned repeat; // # of LSHes to concatenate. ... // all parameters of the base LSH are inherited. };
Because the hash value is represented as unsigned int, which has only 32 bits, the range of the original LSH need to be small enough so that the concatenated value does not overflow. Specifically, we require that
We also require that the range of the base LSH only depends on the parameter, so an array of such LSHes initialized with the same parameter but independent random numbers have the same range.