lshkit::Repeat< LSH > Class Template Reference

Concatenation of a number of LSHes. More...

#include <composite.h>

List of all members.

Public Types

typedef LSH Super
typedef Super::Domain Domain

Public Member Functions

template<typename RNG>
void reset (const Parameter &param, RNG &rng)
template<typename RNG>
 Repeat (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_
unsigned dup_
unsigned range_
unsigned unit_

Classes

struct  Parameter


Detailed Description

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

Concatenation of a number of LSHes.

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

\[ LSH::getRange()^N <= 2^{32}. \]

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.


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