public class L2LSH extends AbstractStableDistributionFunction implements Sampler
Constructor and Description |
---|
L2LSH(int dim,
double w,
org.apache.commons.math.random.RandomGenerator rand)
Constructs a new instance.
|
Modifier and Type | Method and Description |
---|---|
protected Sampler |
getSampler()
The sampler determines the metric which this LSH is associated with.
|
double |
sample(org.apache.commons.math.random.RandomDataImpl randomData)
Draw a sample s ~ Gaussian(0,1), which is 2-stable.
|
apply, reset
getDim, getRandomGenerator
public L2LSH(int dim, double w, org.apache.commons.math.random.RandomGenerator rand) throws org.apache.commons.math.MathException
dim
- the dimension of the vectors to be hashedw
- a double representing the quantization parameter (also known as the projection width)rand
- the random generatororg.apache.commons.math.MathException
- MathExceptionpublic double sample(org.apache.commons.math.random.RandomDataImpl randomData)
protected Sampler getSampler()
AbstractStableDistributionFunction
getSampler
in class AbstractStableDistributionFunction