Random Class Reference
[Real Evolutionary Algorithms Common (Core classes)]

This class generates number randomly. More...

#include <random.h>

Collaboration diagram for Random:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Random (IRealRandom *random)
virtual ~Random (void)
double rand (void)
int randint (unsigned low, unsigned high)
double randreal (double low, double high)
virtual double normal (double desv)
int getSample (int *sample, int *pmax)
 Random (IRealRandom *random)
 ~Random (void)
double rand (void)
int randint (unsigned low, unsigned high)
double randreal (double low, double high)
virtual double normal (double desv)
int getSample (int *sample, int *pmax)

Detailed Description

This class generates number randomly.

Definition at line 48 of file random.h.


Constructor & Destructor Documentation

Random::Random ( IRealRandom random  ) 

Constructor. It requires a simple number generator

Parameters:
random real random generator

Definition at line 27 of file random.cc.

Random::~Random ( void   )  [virtual]

Destructor. Release the IRealRandom object

Definition at line 32 of file random.cc.

Random::Random ( IRealRandom random  ) 

Constructor. It requires a simple number generator

Parameters:
random real random generator
Random::~Random ( void   ) 

Destructor. Release the IRealRandom object


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.

Here is the call graph for this function:

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:
std Standard Deviation
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:
std Standard Deviation
Returns:
a double in the range [0,1]

Definition at line 39 of file random.cc.

Here is the call graph for this function:

double Random::rand ( void   )  [inline]
Returns:
A random double between 0 and 1

Definition at line 63 of file random.h.

Here is the call graph for this function:

double Random::rand ( void   )  [inline]
Returns:
A random double between 0 and 1

Definition at line 64 of file random.h.

Here is the call graph for this function:

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.

Here is the call graph for this function:

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.

Here is the call graph for this function:

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.

Here is the call graph for this function:

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.

Here is the call graph for this function:


The documentation for this class was generated from the following files:

Generated on Sun May 9 12:26:14 2010 for Realea by  doxygen 1.6.1