@Reference(authors="M. Datar and N. Immorlica and P. Indyk and V. S. Mirrokni", title="Locality-sensitive hashing scheme based on p-stable distributions", booktitle="Proc. 20th annual symposium on Computational geometry", url="http://dx.doi.org/10.1145/997817.997857") public class MultipleProjectionsLocalitySensitiveHashFunction extends Object implements LocalitySensitiveHashFunction<NumberVector<?>>
Locality-sensitive hashing scheme based on p-stable distributions
M. Datar and N. Immorlica and P. Indyk and V. S. Mirrokni
Proc. 20th annual symposium on Computational geometry
Modifier and Type | Field and Description |
---|---|
(package private) RandomProjectionFamily.Projection |
projection
Projection matrix.
|
(package private) int[] |
randoms1
Random numbers for mixing the hash codes of the individual functions
|
(package private) double[] |
shift
Shift offset.
|
(package private) double |
width
Scaling factor.
|
Constructor and Description |
---|
MultipleProjectionsLocalitySensitiveHashFunction(RandomProjectionFamily.Projection projection,
double width,
Random rnd)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
static int |
fastModPrime(long data)
Fast modulo operation for the largest unsigned integer prime.
|
int |
hashObject(NumberVector<?> vec)
Compute the hash value of an object
|
RandomProjectionFamily.Projection projection
double[] shift
double width
int[] randoms1
public MultipleProjectionsLocalitySensitiveHashFunction(RandomProjectionFamily.Projection projection, double width, Random rnd)
projection
- Projection vectorswidth
- Width of binsrnd
- Random number generatorpublic int hashObject(NumberVector<?> vec)
LocalitySensitiveHashFunction
hashObject
in interface LocalitySensitiveHashFunction<NumberVector<?>>
vec
- Object to hashpublic static int fastModPrime(long data)
data
- Long inputdata % (2^32 - 5)
.