A collection of basic random number generation algorithms.
More...
#include <yarp/os/Random.h>
|
| static double | uniform () |
| | Generates a random number in the range 0 to 1. More...
|
| |
| static double | normal (double m, double s) |
| | A normal random number generator. More...
|
| |
| static void | seed (int seed) |
| | Sets the seed of the random number generator. More...
|
| |
| static double | normal () |
| |
| static int | uniform (int min, int max) |
| | A random number in a specified range. More...
|
| |
A collection of basic random number generation algorithms.
Definition at line 29 of file Random.h.
◆ normal() [1/2]
| double Random::normal |
( |
| ) |
|
|
static |
- Returns
- a random number normally distributed with 0 mean and unitary standard deviation.
Definition at line 24 of file Random.cpp.
◆ normal() [2/2]
| double Random::normal |
( |
double |
m, |
|
|
double |
s |
|
) |
| |
|
static |
A normal random number generator.
- Parameters
-
| m | is the mean of the gaussian distribution. |
| s | is the standard deviation of the distribution. |
- Returns
- a random number with normal distribution.
Definition at line 29 of file Random.cpp.
◆ seed()
| void Random::seed |
( |
int |
seed | ) |
|
|
static |
Sets the seed of the random number generator.
- Parameters
-
| seed | is the new seed of the random number generator. |
Definition at line 35 of file Random.cpp.
◆ uniform() [1/2]
| double Random::uniform |
( |
| ) |
|
|
static |
Generates a random number in the range 0 to 1.
- Returns
- a random floating point number in the range 0 to 1.
Definition at line 18 of file Random.cpp.
◆ uniform() [2/2]
| int Random::uniform |
( |
int |
min, |
|
|
int |
max |
|
) |
| |
|
static |
A random number in a specified range.
- Parameters
-
| min | is the minimum of the range. |
| max | is the maximum of the range. |
- Returns
- a random integer in the specified range.
Definition at line 41 of file Random.cpp.
The documentation for this class was generated from the following files: