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

RWRandGenerator

Module:  Essential Math    Group:  Statistics classes


Does not inherit

Local Index

Members

Non-Members

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. The Essential Math Module 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);
void
printOn(std::ostream& s) const; 
void
scanFrom(std::istream& s);
void
restoreFrom(RWvistream&);
void
restoreFrom(RWFile&);
void
saveOn(RWvostream&) const;
void
saveOn(RWFile&) const;

Related Global Operator

std::ostream& rwmathexport
operator<< (std::ostream& s, const RWRandGenerator& rgen);
std::istream& rwmathexport
operator>> (std::istream& s, RWRandGenerator& rgen);


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.