lshkit::RepeatHash< LSH > Class Template Reference

Apply a random hash to the concatenation a number of hash values. More...

#include <composite.h>

Inheritance diagram for lshkit::RepeatHash< LSH >:

lshkit::MultiProbeLsh List of all members.

Public Types

typedef LSH Super
typedef LSH::Domain Domain

Public Member Functions

template<typename RNG>
void reset (const Parameter &param, RNG &rng)
template<typename RNG>
 RepeatHash (const Parameter &param, 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

Detailed Description

template<typename LSH>
class lshkit::RepeatHash< LSH >

Apply a random hash to the concatenation a number of hash values.

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.
      };


The documentation for this class was generated from the following file:
Get LSHKIT at SourceForge.net. Fast, secure and Free Open Source software downloads doxygen