Example usage for org.apache.commons.math3.random HaltonSequenceGenerator HaltonSequenceGenerator

List of usage examples for org.apache.commons.math3.random HaltonSequenceGenerator HaltonSequenceGenerator

Introduction

In this page you can find the example usage for org.apache.commons.math3.random HaltonSequenceGenerator HaltonSequenceGenerator.

Prototype

public HaltonSequenceGenerator(final int dimension, final int[] bases, final int[] weights)
        throws NullArgumentException, OutOfRangeException, DimensionMismatchException 

Source Link

Document

Construct a new Halton sequence generator with the given base numbers and weights for each dimension.

Usage

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);
}