lshkit::WeightedHammingHelper< CHUNK > Class Template Reference

Weighted hamming distance calculator. More...

#include <sketch.h>

List of all members.

Public Member Functions

 WeightedHammingHelper (unsigned chunks)
 Constructor.
void update (const CHUNK *in, const float *asym)
 Update the information of the query point.
float distTo (const CHUNK *in)
 Calculate the distance between the saved query point to an incoming point.

Static Public Attributes

static const unsigned CHUNK_BIT = sizeof(CHUNK) * 8


Detailed Description

template<typename CHUNK = unsigned char>
class lshkit::WeightedHammingHelper< CHUNK >

Weighted hamming distance calculator.

A helper class to accelerate weighted hamming distance calculation by using a lookup table. Weighted hamming distance is used in asymmetric distance evaluation between a sketch and a query point. A instance of this class holds the information of a single query point, and can be used to estimate the distance from the query point to different sketches in the database. The construction of such a helper instance is costly, so once constructed, you need to use it as many times as possible to lower the amortized cost.


Constructor & Destructor Documentation

template<typename CHUNK = unsigned char>
lshkit::WeightedHammingHelper< CHUNK >::WeightedHammingHelper ( unsigned  chunks  )  [inline]

Constructor.

Parameters:
chunks number of chunks in sketch.


Member Function Documentation

template<typename CHUNK = unsigned char>
void lshkit::WeightedHammingHelper< CHUNK >::update ( const CHUNK *  in,
const float *  asym 
) [inline]

Update the information of the query point.

Parameters:
in sketch of the query point.
asym weights, the output of Sketch::apply.


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