rwlogo
SourcePro C++ 12.0

SourcePro® C++ API Reference Guide



   SourcePro C++
Documentation Home

RWRandGenMCG59 Class Reference
[Statistics]

Generates random numbers uniformly distributed over the interval [0, 1]. More...

#include <rw/randmcg59.h>

Inheritance diagram for RWRandGenMCG59:
RWRandGenBasicMLC

List of all members.

Public Member Functions

 RWRandGenMCG59 ()
 RWRandGenMCG59 (unsigned long seed)
 RWRandGenMCG59 (const RWRandGenMCG59 &u)
double operator() ()

Detailed Description

Class RWRandGenMCG59 generates random numbers uniformly distributed over the interval [0, 1], and may be used instead of class RWRandGenerator as a template parameter to any of the distribution generators derived from abstract base class RWTRand<> . RWRandGenMCG59 is a 59-bit multiplicative congruential generator.

$ x_{n} = ax_{n-1}(mod (m)) $
$ u_{n} = x_{n}/m $
$ a = 13^{13}, m = 2^{59} $

Unlike class RWRandGenerator, each instance of RWRandGenMCG59 contains and maintains its own, independent state. This can make it easier to use in some situations. The "internal state" of an instance of RWRandGenMCG59 consists of only a seed.

Synopsis

 #include <rw/randmcg59.h>
 RWRandgenMCG59 gen;

Constructor & Destructor Documentation

RWRandGenMCG59::RWRandGenMCG59 (  )  [inline]

Constructs a generator, abitrarily seeded by a call to the time() function.

RWRandGenMCG59::RWRandGenMCG59 ( unsigned long  seed  )  [inline]

Constructs a generator with a specified seed.

RWRandGenMCG59::RWRandGenMCG59 ( const RWRandGenMCG59 u  )  [inline]

Constructs a copy of u. The copy's state will equal the state of u at the time the copy is created, but will not share the state of u.


Member Function Documentation

double RWRandGenMCG59::operator() (  )  [virtual]

Returns a random double in [0,1].

Implements RWRandGenBasicMLC.

 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.