org.jscience.mathematics.analysis.optimization
Class UniformNormalizedRandomGenerator

java.lang.Object
  extended by org.jscience.mathematics.analysis.optimization.UniformNormalizedRandomGenerator
All Implemented Interfaces:
RandomGenerator

public class UniformNormalizedRandomGenerator
extends java.lang.Object
implements RandomGenerator

This class implements a normalized uniform random generator.

Since this is a normalized random generator, it has a null mean and a unit standard deviation. Beeing also a uniform generator, it produces numbers in the range [-sqrt(3) ; sqrt(3)]. It uses the MersenneTwister generator as the underlying generator.

See Also:
MersenneTwister

Constructor Summary
UniformNormalizedRandomGenerator()
          Create a new generator.
UniformNormalizedRandomGenerator(int[] seed)
          Creates a new random number generator using an int array seed.
UniformNormalizedRandomGenerator(long seed)
          Create a new generator initialized with a single long seed.
 
Method Summary
 double nextDouble()
          Generate a random scalar with null mean and unit standard deviation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UniformNormalizedRandomGenerator

public UniformNormalizedRandomGenerator()
Create a new generator. The seed of the generator is related to the current time.


UniformNormalizedRandomGenerator

public UniformNormalizedRandomGenerator(int[] seed)
Creates a new random number generator using an int array seed.

Parameters:
seed - the initial seed (32 bits integers array), if null the seed of the generator will be related to the current time

UniformNormalizedRandomGenerator

public UniformNormalizedRandomGenerator(long seed)
Create a new generator initialized with a single long seed.

Parameters:
seed - seed for the generator (64 bits integer)
Method Detail

nextDouble

public double nextDouble()
Generate a random scalar with null mean and unit standard deviation.

The number generated is uniformly distributed between -sqrt(3) and sqrt(3).

Specified by:
nextDouble in interface RandomGenerator
Returns:
a random scalar with null mean and unit standard deviation