public class Hash
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
Hash(int d,
int k,
double w,
int H)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
add(int index,
double[] x)
Insert an item into the hash table.
|
Bucket |
get(double[] x)
Returns the bucket entry for the given point.
|
Bucket |
get(int i)
Returns the bucket entry for the given hash value.
|
int |
hash(double[] x)
Apply hash functions on given vector x.
|
public Hash(int d, int k, double w, int H)
d
- the dimensionality of data.k
- the number of random projection hash functions, which is usually
set to log(N) where N is the dataset size.w
- the width of random projections. It should be sufficiently away
from 0. But we should not choose an w value that is too large,
which will increase the query time.H
- the size of universal hash tables.public int hash(double[] x)
x
- the vector to be hashed.public void add(int index, double[] x)
public Bucket get(int i)
public Bucket get(double[] x)