#include <composite.h>
Inheritance diagram for lshkit::RepeatHash< LSH >:

Public Types | |
| typedef LSH | Super |
| typedef LSH::Domain | Domain |
Public Member Functions | |
| template<typename RNG> | |
| void | reset (const Parameter ¶m, RNG &rng) |
| template<typename RNG> | |
| RepeatHash (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_ |
| std::vector< unsigned > | a_ |
Classes | |
| struct | Parameter |
This composition is to workaround the case where the range of individual LSHes are so large that the concatenation can not be held in a single unsgined int. The method is to further hash the concatenated value. Specifically, if <h1, h2, ..., hN> are the original values, this composition produces (a1*h1 + a2*h2 + aN*hN), with a1~aN being random unsigned integers. The range of the produced LSH is 0 (the whole range of unsigned).
The domain of the 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. };