libidx
ebl::random Class Reference

List of all members.

Public Member Functions

 random (int x)
 random (int argc=0, char **argv=NULL)
virtual ~random ()
 Destructor.
double drand (void)
double drand (double v)
double drand (double v0, double v1)

Protected Member Functions

void init (int x)
 Initialize seed.
void dseed (int x)

Constructor & Destructor Documentation

ebl::random::random ( int  x)

Constructs a random number generator with seed 'x'. Use x == 0 to construct a fixed-seed generator.

ebl::random::random ( int  argc = 0,
char **  argv = NULL 
)

Constructs a random number generator with a random seed taken from current time and the sum of all arguments characters, if present. This can be useful if several programs are called at the same time with different input arguments.


Member Function Documentation

double ebl::random::drand ( void  )

random number generator. Return a random number drawn from a uniform distribution over [0,1].

double ebl::random::drand ( double  v)

random number generator. Return a random number drawn from a uniform distribution over [-v,+v].

double ebl::random::drand ( double  v0,
double  v1 
)

random number generator. Return a random number drawn from a uniform distribution over [v0,v1].

void ebl::random::dseed ( int  x) [protected]

sets the seed of the random number generator. This MUST be called at least once before the random number generator is used. Otherwise calls to drand() and dgauss() always return the same number.


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