The MCFClass Project
OPTrand Class Reference

Provide a common interface to the different random generators that are available in different platforms. More...

#include <OPTUtils.h>

Public Member Functions

 OPTrand (void)
 constructor of the class
 
double rand (void)
 Returns a random number uniformly distributed in [0, 1).
 
void srand (long seed)
 Seeds the random generator for this instance of OPTrand.
 

Detailed Description

Provide a common interface to the different random generators that are available in different platforms.

Member Function Documentation

◆ rand()

double rand ( void  )
inline

Returns a random number uniformly distributed in [0, 1).

Note
each object of class OPTrand has its own sequence, so that multiple OPTrand objects being used within the same program do not interfere with each other (as opposed to what C random routines would do).

References OPTrand::rand(), and OPTrand::srand().

Referenced by OPTrand::rand().