Class GasDev

java.lang.Object
  |
  +--GasDev

public class GasDev
extends java.lang.Object

Merely a Java translation of the popular C program gasdev.c (Press et al. 1988) for generating normally distributed deviates.


Reference:

Press, WH, Teukolsky, SA, Vetterling, WT, Flannery, BP, 1992, Numerical Recipes in C, Cambridge University Press, Cambridge, UK, 994 p.


Constructor Summary
GasDev()
          Create one.
 
Method Summary
 void changeRange(double lower, double upper)
          Change the range for the deviates from the default of [0., 10000].
 double nextDeviate()
          Obtain the next random deviate ~ N(ll,ul), where by default ll=0, ul=1000.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GasDev

public GasDev()
Create one.

Method Detail

nextDeviate

public double nextDeviate()
Obtain the next random deviate ~ N(ll,ul), where by default ll=0, ul=1000.

Returns:
the deviate

changeRange

public void changeRange(double lower,
                        double upper)
Change the range for the deviates from the default of [0., 10000].

Parameters:
lower - Lower limit of the range;
upper - Upper limit of the range;