public class L1LSH extends AbstractStableDistributionFunction implements Sampler
Constructor and Description |
---|
L1LSH(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 ~ Cauchy(0,1), which is 1-stable.
|
apply, reset
getDim, getRandomGenerator
public L1LSH(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 generator usedorg.apache.commons.math.MathException
- MathExceptionpublic double sample(org.apache.commons.math.random.RandomDataImpl randomData) throws org.apache.commons.math.MathException
protected Sampler getSampler()
AbstractStableDistributionFunction
getSampler
in class AbstractStableDistributionFunction