Rogue Wave banner
Previous fileTop of DocumentContentsIndexNext file

RWRandGenerator



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

Synopsis

#include <rw/randgen.h>
RWRandGenerator gen;

Description

Class RWRandGenerator generates random numbers uniformly distributed over the interval [0, 1]. RWRandGenerator objects can be independent or share state with each other. Math.h++ contains a global default state that is shared by all generators created with the default constructor. Using the default generator state does not guarantee repeatable sequences, even if you restart() it using a specific seed. This is because the global state may be shared among several applications in a multithreaded environment. There is no protection against multiple threads of control using the global default state at the same time. To achieve repeatable sequences, you must construct a generator with a specific seed value and use the generator for random number generation.

Public Constructors

RWRandGenerator();
RWRandGenerator(const RWRandGenerator& x);
RWRandGenerator(long seed);

Public Member Functions

void
deepenShallowCopy();
void
restart();
void
restart(long seed);
void
reference(const RWRandGenerator& x);

Public Member Operators

double    operator()();
RWRandGenerator&    operator=(const RWRandGenerator& x);


Previous fileTop of DocumentContentsIndexNext file

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