Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Essential Math Module Reference Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

RWTRand<Generator>

Module:  Essential Math    Group:  Statistics classes


Does not inherit

Local Index

Members

Synopsis

#include <rw/rand.h>

Description

Class RWTRand<Generator> is the abstract base class for the random number generator classes. The classes derived from RWTRand<Generator> generate random numbers from specific probability distributions. Each of these derived classes generates a random number from a uniform distribution on the interval [0, 1], and from this deviate derives a random number generator from the appropriate probability distribution. The template parameter Generator is a function object that provides this uniform [0, 1] deviate. Specifically, Generator is presumed to be an object that overloads the function call operator to return a uniform random number of type double between 0 and 1.

The class Generator must have the following semantics, where gen is of type Generator:

Default Constructor:

Generator gen;

Function Call Operator:

double x = gen(); // 0 <= x <= 1 or 0 < x < 1

Public Constructors

RWTRand()
RWTRand(const RWTRand<Generator>& x);
RWTRand(const Generator& g);

Public Member Functions

const Generator&
generator() const;
Generator&
generator();
void   
setGenerator(const Generator& x);
void
setGenerator(const RWTRand<Generator>& x);

Public Member Operator

virtual double    operator()() = 0;


Previous fileTop of DocumentContentsIndex pageNext file

© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.