org.spaceroots.mantissa.random
Class GaussianRandomGenerator

java.lang.Object
  extended byorg.spaceroots.mantissa.random.GaussianRandomGenerator
All Implemented Interfaces:
NormalizedRandomGenerator, Serializable

public class GaussianRandomGenerator
extends Object
implements NormalizedRandomGenerator

This class is a gaussian normalized random generator for scalars.

This class is a simple interface adaptor around the MersenneTwister generator, which calls its nextGaussian method.

Version:
$Id: GaussianRandomGenerator.java 1709 2006-12-03 21:16:50Z luc $
Author:
L. Maisonobe
See Also:
MersenneTwister, Serialized Form

Constructor Summary
GaussianRandomGenerator()
          Create a new generator.
GaussianRandomGenerator(int seed)
          Creates a new random number generator using a single int seed.
GaussianRandomGenerator(int[] seed)
          Creates a new random number generator using an int array seed.
GaussianRandomGenerator(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

GaussianRandomGenerator

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


GaussianRandomGenerator

public GaussianRandomGenerator(int seed)
Creates a new random number generator using a single int seed.

Parameters:
seed - the initial seed (32 bits integer)

GaussianRandomGenerator

public GaussianRandomGenerator(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

GaussianRandomGenerator

public GaussianRandomGenerator(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.

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


Copyright © 2001-2007 Luc Maisonobe. All Rights Reserved.