rwlogo
SourcePro C++ 12.0

SourcePro® C++ API Reference Guide



   SourcePro C++
Documentation Home

RWTRand< Generator > Class Template Reference
[Statistics]

Abstract base class from which the random number generator classes derive. More...

#include <rw/rand.h>

Inheritance diagram for RWTRand< Generator >:
RWRandInterface RWTRandBinomial< Generator > RWTRandExponential< Generator > RWTRandGamma< Generator > RWTRandNormal< Generator > RWTRandPoisson< Generator > RWTRandUniform< Generator >

List of all members.

Public Member Functions

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

Detailed Description

template<class Generator>
class RWTRand< Generator >

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

Synopsis

 #include <rw/rand.h>

Constructor & Destructor Documentation

template<class Generator >
RWTRand< Generator >::RWTRand (  ) 

Uses the default constructor of class Generator to initialize the underlying uniform random number generator.

template<class Generator >
RWTRand< Generator >::RWTRand ( const Generator &  g  ) 

Initializes the underlying uniform random number generator with g.

template<class Generator >
RWTRand< Generator >::RWTRand ( const RWTRand< Generator > &  x  ) 

Initializes the underlying uniform random number generator with x's.


Member Function Documentation

template<class Generator >
Generator& RWTRand< Generator >::generator (  )  [inline]

Returns a reference to the underlying uniform random number generator.

template<class Generator >
const Generator& RWTRand< Generator >::generator (  )  const [inline]

Returns the underlying uniform random number generator as a const reference.

template<class Generator >
void RWTRand< Generator >::setGenerator ( const RWTRand< Generator > &  x  ) 

Sets the underlying uniform random number generator to the underlying uniform random number generator of x.

template<class Generator >
void RWTRand< Generator >::setGenerator ( const Generator &  x  ) 

Sets the underlying uniform random number generator to x.

 All Classes Functions Variables Typedefs Enumerations Enumerator Friends

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