List of usage examples for org.apache.commons.math.random RandomDataImpl nextUniform
public double nextUniform(double lower, double upper)
Algorithm Description: scales the output of Random.nextDouble(), but rejects 0 values (i.e., will generate another random double if Random.nextDouble() returns 0).
From source file:datafu.pig.hash.lsh.p_stable.AbstractStableDistributionFunction.java
public void reset(int dim, double w) throws MathException { RandomDataImpl dataSampler = new RandomDataImpl(rg); Sampler sampler = getSampler();/* w ww . j a v a 2s. c om*/ this.a = new double[dim]; this.dim = dim; this.w = w; for (int i = 0; i < dim; ++i) { a[i] = sampler.sample(dataSampler); } b = dataSampler.nextUniform(0, w); }