class rv

The rv class provides a random variable based on a selectable implementation.

Public Methods

[more] rv(unsigned long seed = 1)
Create a random variable with the default implementation
[more] rv(random_seq* rand)
Create a random variable with the desired implementation.
[more] rv(const rv& src)
Copy constructor relies on copy method of underlying stream
[more]const rv& operator= (const rv& src)
Assignment operator relies on copy method of underlying stream
[more]void set_seed(unsigned long seed)
See the random number generator implementation
[more]double triangular(double a, double b, double c)
Sample a triangular distribution with (a, b, c)
[more]double uniform(double a, double b)
Sample a uniform distribution in the range [a, b]
[more]double exp(double m)
Sample an exponential distribution with mean m
[more]double normal(double m, double s)
Sample a normally distributed random variable with mean m and standard deviation s
[more] ~rv()
Destructor


Documentation

The rv class provides a random variable based on a selectable implementation. By default, this implementation is the Mersenne Twister (see mtrand).
o rv(unsigned long seed = 1)
Create a random variable with the default implementation

o rv(random_seq* rand)
Create a random variable with the desired implementation. The implementation class is adopted by the rv.

o rv(const rv& src)
Copy constructor relies on copy method of underlying stream

oconst rv& operator= (const rv& src)
Assignment operator relies on copy method of underlying stream

ovoid set_seed(unsigned long seed)
See the random number generator implementation

odouble triangular(double a, double b, double c)
Sample a triangular distribution with (a, b, c)

odouble uniform(double a, double b)
Sample a uniform distribution in the range [a, b]

odouble exp(double m)
Sample an exponential distribution with mean m

odouble normal(double m, double s)
Sample a normally distributed random variable with mean m and standard deviation s

o ~rv()
Destructor


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.