An auxiliary class. The class is used for generating random values.
More...
#include <Utility.h>
|
static int | nextInt (const int r) |
| Get a random integer from 0 to r - 1. More...
|
|
static int | nextInt (const int r1, const int r2) |
| Get a random integer from r1 to r2. More...
|
|
static double | nextDouble (const double range) |
| Get a random double from 0 to range. More...
|
|
static double | nextDouble (const double r1, const double r2) |
| Get a random double from r1 to r2. More...
|
|
static double | nextNormal () |
| Draw a random value from normal distribution N( 0, 1) More...
|
|
static double | nextNormal (const double mean, const double std) |
| Draw a random value from normal distribution N( mean, std * std) More...
|
|
An auxiliary class. The class is used for generating random values.
double Random::nextDouble |
( |
const double |
range | ) |
|
|
static |
Get a random double from 0 to range.
- Parameters
-
- Returns
- a double value
double Random::nextDouble |
( |
const double |
r1, |
|
|
const double |
r2 |
|
) |
| |
|
static |
Get a random double from r1 to r2.
- Parameters
-
r1 | lower bound |
r2 | upper bound |
- Returns
- a double value
int Random::nextInt |
( |
const int |
r | ) |
|
|
static |
Get a random integer from 0 to r - 1.
- Parameters
-
r | upper bound of integer value (exclusive) |
- Returns
- an integer
int Random::nextInt |
( |
const int |
r1, |
|
|
const int |
r2 |
|
) |
| |
|
static |
Get a random integer from r1 to r2.
- Parameters
-
r1 | tight lower bound |
r2 | tight upper bound |
- Returns
- an integer
double Random::nextNormal |
( |
| ) |
|
|
static |
Draw a random value from normal distribution N( 0, 1)
- Returns
- a double value
double Random::nextNormal |
( |
const double |
mean, |
|
|
const double |
std |
|
) |
| |
|
static |
Draw a random value from normal distribution N( mean, std * std)
- Parameters
-
mean | mean of normal distribution |
std | standard deviation of normal distribution |
- Returns
- a double value
The documentation for this class was generated from the following files: