be.hogent.tarsos.lsh.families
Class CityBlockHash

java.lang.Object
  extended by be.hogent.tarsos.lsh.families.CityBlockHash
All Implemented Interfaces:
HashFunction

public class CityBlockHash
extends java.lang.Object
implements HashFunction


Constructor Summary
CityBlockHash(int dimensions, int w)
           
 
Method Summary
 int hash(Vector vector)
          Hashes a vector of arbitrary dimensions to an integer.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CityBlockHash

public CityBlockHash(int dimensions,
                     int w)
Method Detail

hash

public int hash(Vector vector)
Description copied from interface: HashFunction
Hashes a vector of arbitrary dimensions to an integer. The hash function needs to be locality sensitive to work in the locality sensitive hash (LSH) scheme. Meaning that vectors that are 'close' according to some metric have a high probability to end up with the same hash.

Specified by:
hash in interface HashFunction
Parameters:
vector - The vector to hash. Can have any number of dimensions.
Returns:
A locality sensitive hash (LSH). Vectors that are 'close' according to some metric have a high probability to end up with the same hash.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object