include/lshkit/concept.h File Reference
Check the LSH concept.
More...
#include <boost/concept/assert.hpp>
#include <boost/concept/usage.hpp>
Go to the source code of this file.
Namespaces
namespace lshkit
Classes
Detailed Description
Check the LSH concept.
An LSH class should define the following items to be used in the LSHKIT framework:
- The parameter type:
- The domain type (type that the LSH applies on):
- Default constructor:
- Initialization method (same as LSH() immediately followed by reset()):
void reset(const Parameter &, RNG &);
The reset() function and on of the constructors take a random number generator. This random number generator should not be further used after reset() or the constructor has returned. - Initializing constructor:
LSH(const Parameter &, RNG &); // equivalent to LSH() followed by reset()
- A method that returns the range of hash value:
unsigned getRange () const;
If getRange() returns 0, then the hash value (returned by operator()) can be anything. Otherwise, it can be from 0 to getRange() - 1. - An operator to apply the hash function:
unsigned operator () (const Domain) const;
- A serialization method following Boost serialization interface.
template<class Archive>
void serialize(Archive & ar, const unsigned int version)
Some of the LSH functions are created by rouding a real number to an integer, and the part rounded off (delta) usually carries useful information. Such LSH functions are modeled by the DeltaLSH concept, which should implement the following extra method:
- An operator to apply the LSH and also return the delta.
unsigned operator () const (Domain, float *delta);
Get LSHKIT at SourceForge.net. Fast, secure and Free Open Source software downloads
doxygen