SSJ
V. labo.

umontreal.iro.lecuyer.randvar
Class NormalBoxMullerGen

java.lang.Object
  extended by umontreal.iro.lecuyer.randvar.RandomVariateGen
      extended by umontreal.iro.lecuyer.randvar.NormalGen
          extended by umontreal.iro.lecuyer.randvar.NormalBoxMullerGen

public class NormalBoxMullerGen
extends NormalGen

NormalBoxMullerGen

This class implements normal random variate generators using the Box-Muller method. Since the method generates two variates at a time, the second variate is returned upon the next call to the nextDouble.


Constructor Summary
NormalBoxMullerGen(RandomStream s)
          .
NormalBoxMullerGen(RandomStream s, double mu, double sigma)
          .
NormalBoxMullerGen(RandomStream s, NormalDist dist)
          .
 
Method Summary
 double nextDouble()
          Generates a random number from the continuous distribution contained in this object.
static double nextDouble(RandomStream s, double mu, double sigma)
           
 
Methods inherited from class umontreal.iro.lecuyer.randvar.NormalGen
getMu, getSigma
 
Methods inherited from class umontreal.iro.lecuyer.randvar.RandomVariateGen
getDistribution, getStream, nextArrayOfDouble, setStream, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NormalBoxMullerGen

public NormalBoxMullerGen(RandomStream s,
                          double mu,
                          double sigma)
. \begin{tabb}Creates a normal random variate generator with mean \texttt{mu}
 and standard deviation \texttt{sigma}, using stream \texttt{s}.
 \end{tabb}


NormalBoxMullerGen

public NormalBoxMullerGen(RandomStream s)
. \begin{tabb}Creates a standard normal random variate generator with mean
 \texttt{0} and standard deviation \texttt{1}, using stream \texttt{s}.
 \end{tabb}


NormalBoxMullerGen

public NormalBoxMullerGen(RandomStream s,
                          NormalDist dist)
. \begin{tabb}Creates a random variate generator for the normal distribution
 \texttt{dist} and stream \texttt{s}.
 \end{tabb}

Method Detail

nextDouble

public double nextDouble()
Description copied from class: RandomVariateGen
Generates a random number from the continuous distribution contained in this object. By default, this method uses inversion by calling the inverseF method of the distribution object. Alternative generating methods are provided in subclasses.

Overrides:
nextDouble in class RandomVariateGen
Returns:
the generated value

nextDouble

public static double nextDouble(RandomStream s,
                                double mu,
                                double sigma)

SSJ
V. labo.

To submit a bug or ask questions, send an e-mail to Pierre L'Ecuyer.