This class generates number randomly.
More...
#include <random.h>
List of all members.
Detailed Description
This class generates number randomly.
Definition at line 48 of file random.h.
Constructor & Destructor Documentation
Constructor. It requires a simple number generator
- Parameters:
-
| random | real random generator |
Definition at line 27 of file random.cc.
Random::~Random |
( |
void |
|
) |
[virtual] |
Constructor. It requires a simple number generator
- Parameters:
-
| random | real random generator |
Member Function Documentation
int Random::getSample |
( |
int * |
sample, |
|
|
int * |
pmax | |
|
) |
| | |
return a position value of a vector positions
- Parameters:
-
| sample | array of positions |
| pmax | maximum size of sample, it is modified |
- Returns:
- a position randomly chosen
int Random::getSample |
( |
int * |
sample, |
|
|
int * |
pmax | |
|
) |
| | |
return a position value of a vector positions
- Parameters:
-
| sample | array of positions |
| pmax | maximum size of sample, it is modified |
- Returns:
- a position randomly chosen
Definition at line 61 of file random.cc.
virtual double Random::normal |
( |
double |
desv |
) |
[virtual] |
Generate a double number following a normal distribution with center in 0 and std as its standard desviation
- Parameters:
-
- Returns:
- a double in the range [0,1]
double Random::normal |
( |
double |
desv |
) |
[virtual] |
Generate a double number following a normal distribution with center in 0 and std as its standard desviation
- Parameters:
-
- Returns:
- a double in the range [0,1]
Definition at line 39 of file random.cc.
double Random::rand |
( |
void |
|
) |
[inline] |
- Returns:
- A random double between 0 and 1
Definition at line 63 of file random.h.
double Random::rand |
( |
void |
|
) |
[inline] |
- Returns:
- A random double between 0 and 1
Definition at line 64 of file random.h.
int Random::randint |
( |
unsigned |
low, |
|
|
unsigned |
high | |
|
) |
| | [inline] |
Generates randomly a integer between low and high
- Parameters:
-
| low | lowest value |
| high | higher value |
- Returns:
- an integer in [low, high] randomly generated
Definition at line 76 of file random.h.
int Random::randint |
( |
unsigned |
low, |
|
|
unsigned |
high | |
|
) |
| | [inline] |
Generates randomly a integer between low and high
- Parameters:
-
| low | lowest value |
| high | higher value |
- Returns:
- an integer in [low, high] randomly generated
Definition at line 77 of file random.h.
double Random::randreal |
( |
double |
low, |
|
|
double |
high | |
|
) |
| | [inline] |
Generates randomly a double between low and high
- Parameters:
-
| low | lowest value |
| high | higher value |
- Returns:
- a double in [low, high] randomly generated
Definition at line 91 of file random.h.
double Random::randreal |
( |
double |
low, |
|
|
double |
high | |
|
) |
| | [inline] |
Generates randomly a double between low and high
- Parameters:
-
| low | lowest value |
| high | higher value |
- Returns:
- a double in [low, high] randomly generated
Definition at line 92 of file random.h.
The documentation for this class was generated from the following files: