lshkit::Sketch< LSH, CHUNK > Class Template Reference

LSH-based sketcher. More...

#include <sketch.h>

List of all members.

Public Types

typedef LSH::Parameter Parameter
 LSH parameter.
typedef LSH::Domain Domain
 Domain of LSH & Sketcheter.

Public Member Functions

 Sketch ()
template<typename Engine>
void reset (unsigned chunks, Parameter param, Engine &engine)
template<typename Engine>
 Sketch (unsigned chunks, Parameter param, Engine &engine)
void apply (Domain in, CHUNK *out) const
 Sketch construction.
void apply (Domain in, CHUNK *out, float *asym) const
 Asymmetric sketch construction.
template<class Archive>
void serialize (Archive &ar, const unsigned int version)
 Serialize the sketcher.
void load (std::istream &is)
 Load from stream.
void save (std::ostream &os)
 Save to stream.
unsigned getBits () const
 Return the number of bits in the sketch.
unsigned getChunks () const
 Return the number of chunks in the sketch.

Static Public Attributes

static const unsigned CHUNK_BIT = sizeof(CHUNK) * 8
 Number of bits in each CHUNK.


Detailed Description

template<typename LSH, typename CHUNK = unsigned char>
class lshkit::Sketch< LSH, CHUNK >

LSH-based sketcher.


Constructor & Destructor Documentation

template<typename LSH, typename CHUNK = unsigned char>
lshkit::Sketch< LSH, CHUNK >::Sketch (  )  [inline]

Constructor, without initialization.

template<typename LSH, typename CHUNK = unsigned char>
template<typename Engine>
lshkit::Sketch< LSH, CHUNK >::Sketch ( unsigned  chunks,
Parameter  param,
Engine &  engine 
) [inline]

Constructor with initialation (same as Sketch() immediately followed by reset()).

Parameters:
chunks Number of chunks in the sketch.
param Parameter to LSH.
engine Random number generator (usually a variable of type lshkit::DefaultRng.


Member Function Documentation

template<typename LSH, typename CHUNK = unsigned char>
void lshkit::Sketch< LSH, CHUNK >::apply ( Domain  in,
CHUNK *  out,
float *  asym 
) const [inline]

Asymmetric sketch construction.

Parameters:
asym The values used for asymmetric distance estimation.
For sketch of N bits, the array asym should have enough space to hold N floats.

template<typename LSH, typename CHUNK = unsigned char>
template<typename Engine>
void lshkit::Sketch< LSH, CHUNK >::reset ( unsigned  chunks,
Parameter  param,
Engine &  engine 
) [inline]

Reset the sketcher.

Parameters:
chunks Number of chunks in the sketch.
param Parameter to LSH.
engine Random number generator (usually a variable of type lshkit::DefaultRng.


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