SLIKMC  1.0
 All Classes Functions Variables Pages
Static Public Member Functions | List of all members
Random Class Reference

An auxiliary class. The class is used for generating random values. More...

#include <Utility.h>

Static Public Member Functions

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...
 

Detailed Description

An auxiliary class. The class is used for generating random values.

Member Function Documentation

double Random::nextDouble ( const double  range)
static

Get a random double from 0 to range.

Parameters
rangeupper bound
Returns
a double value
double Random::nextDouble ( const double  r1,
const double  r2 
)
static

Get a random double from r1 to r2.

Parameters
r1lower bound
r2upper bound
Returns
a double value
int Random::nextInt ( const int  r)
static

Get a random integer from 0 to r - 1.

Parameters
rupper 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
r1tight lower bound
r2tight 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
meanmean of normal distribution
stdstandard deviation of normal distribution
Returns
a double value

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