List of usage examples for org.apache.commons.math3.random HaltonSequenceGenerator HaltonSequenceGenerator
public HaltonSequenceGenerator(final int dimension, final int[] bases, final int[] weights) throws NullArgumentException, OutOfRangeException, DimensionMismatchException
From source file:gdsc.smlm.model.UniformDistribution.java
/** * Create a new uniform distribution using a Halton sequence * /* ww w .j a v a 2 s . com*/ * @param min * The minimum bounds for the distribution * @param max * The maximum bounds for the distribution * @param seed * Start at the i-th point in the Halton sequence */ public UniformDistribution(double[] min, double[] max, int seed) { //HaltonSequenceGenerator randomVectorGenerator = new HaltonSequenceGenerator(3); // The Halton sequence based on the prime of 2 does not provide great variety in the // lesser significant digits when simulating a 512x512 pixel image. This is not suitable for // PSF fitting since we require variation to at least 3 decimal places. HaltonSequenceGenerator randomVectorGenerator = new HaltonSequenceGenerator(3, new int[] { 3, 5, 7 }, null); randomVectorGenerator.skipTo(Math.abs(seed)); init(min, max, randomVectorGenerator); }