Random Class Reference
Draws random values from a normal distibuted using a simple rejection method.
More...
List of all members.
Public Member Functions |
double | NextExp (double lambda) |
| Nexts the exp.
|
double | NextNormal (double mean, double stdev) |
| Draw the next number from a normal distribution.
|
double | NextNormal () |
| Get the next number from the standard normal distribution.
|
| Random (int seed) |
| Creates a Random object initialized with a seed.
|
| Random () |
| Default constructor.
|
Static Public Member Functions |
static Random | GetInstance () |
| Gets the instance. If it does not exist yet, it will be created.
|
static void | InitInstance (int seed) |
| Initializes the instance with a given random seed.
|
Detailed Description
Draws random values from a normal distibuted using a simple rejection method.
Constructor & Destructor Documentation
Creates a Random object initialized with a seed.
- Parameters:
-
| seed | An integer for initializing the random number generator |
Member Function Documentation
static Random GetInstance |
( |
|
) |
[static] |
Gets the instance. If it does not exist yet, it will be created.
- Returns:
- the singleton instance
static void InitInstance |
( |
int |
seed |
) |
[static] |
Initializes the instance with a given random seed.
- Parameters:
-
double NextExp |
( |
double |
lambda |
) |
|
Nexts the exp.
- Parameters:
-
- Returns:
double NextNormal |
( |
double |
mean, |
|
|
double |
stdev | |
|
) |
| | |
Draw the next number from a normal distribution.
- Parameters:
-
| mean | mean of the Gaussian |
| stdev | standard deviation of the Gaussian |
- Returns:
- a random number drawn from a normal distribution with the given mean and standard deviation
Get the next number from the standard normal distribution.
- Returns:
- a random number drawn from the standard normal distribution
The documentation for this class was generated from the following file: