Rogue Wave banner
Previous fileTop of DocumentContentsIndexNext file

RWTRandNormal<Generator>


RWTRandNormal<Generator>RWTRand<Generator>

Data Type and Member Function Indexes
(exclusive of constructors and destructors)

Synopsis

#include <rw/rand.h>
RWTRandNormal<Generator> gen;

Descripton

Class RWTRandNormal<Generator> generates random numbers from a normal distribution:

where µ is the mean, and is the variance. The algorithm used to generate the random numbers begins with random numbers generated from a uniform distribution on the interval [0, 1]. Thus, the speed and statistical properties of the normal random numbers may be varied by varying the Generator template parameter, which is responsible for generating these uniformly distributed numbers.

The class Generator must be a function object whose function call operator returns a uniform random double between 0 and 1. The class RWRandGenerator supplied with the library may be used.

Example

Public Constructors

RWTRandNormal();
RWTRandNormal(double mean, double variance);
RWTRandNormal(const Generator& g, double mean=0, variance=1);
RWTRandNormal(const RWTRandNormal<Generator>& g);

Public Operator

double    operator()()

Public Member Functions

double
mean() const;
void
setMean(double m);
void
setVariance(double v);
double
variance() const;


Previous fileTop of DocumentContentsIndexNext file

©Copyright 1999, Rogue Wave Software, Inc.
Send mail to report errors or comment on the documentation.