SST/macro
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | List of all members
RNG::CONG Class Reference

The congruential random number generator by George Marsaglia (1999; internet posting). More...

#include <rng.h>

Inheritance diagram for RNG::CONG:
Inheritance graph
Collaboration diagram for RNG::CONG:
Collaboration graph

Public Member Functions

virtual std::string to_string () const
 
 ~CONG ()
 
rngint_t value ()
 
void vec_reseed (const std::vector< rngint_t > &seeds)
 
int nseed ()
 
- Public Member Functions inherited from RNG::UniformInteger
virtual ~UniformInteger ()
 
rngint_t value_in_range (rngint_t range)
 
virtual double realvalue (bool include_zero=true, bool include_one=true)
 Return a random value in the interval [0,1], (0,1], [0,1), or (0,1) More...
 
void reseed ()
 
void reseed (rngint_t)
 
void reseed (rngint_t, rngint_t)
 
void reseed (rngint_t, rngint_t, rngint_t)
 
void reseed (rngint_t, rngint_t, rngint_t, rngint_t)
 

Static Public Member Functions

static CONGconstruct ()
 
static CONGconstruct (const std::vector< rngint_t > &)
 
static CONGconstruct (rngint_t jcongarg)
 

Protected Member Functions

 CONG ()
 
 CONG (const std::vector< rngint_t > &)
 
 CONG (rngint_t jcongarg)
 

Private Attributes

rngint_t jcong
 

Detailed Description

The congruential random number generator by George Marsaglia (1999; internet posting).

This RNG is fast and has a very low memory footprint. Here is an excerpt from the posting describing this generator: CONG is a congruential generator with the widely used 69069 as multiplier: x(n)=69069x(n-1)+1234567. It has period 232. The leading half of its 32 bits seem to pass all tests, but bits in the last half are too regular.

Definition at line 254 of file rng.h.

Constructor & Destructor Documentation

RNG::CONG::~CONG ( )
RNG::CONG::CONG ( )
protected
RNG::CONG::CONG ( const std::vector< rngint_t > &  )
protected
RNG::CONG::CONG ( rngint_t  jcongarg)
protected

Member Function Documentation

static CONG* RNG::CONG::construct ( )
static
static CONG* RNG::CONG::construct ( const std::vector< rngint_t > &  )
static
static CONG* RNG::CONG::construct ( rngint_t  jcongarg)
static
int RNG::CONG::nseed ( )
virtual

Implements RNG::UniformInteger.

virtual std::string RNG::CONG::to_string ( ) const
inlinevirtual

Definition at line 261 of file rng.h.

rngint_t RNG::CONG::value ( )
inlinevirtual

Implements RNG::UniformInteger.

Definition at line 277 of file rng.h.

References RNG::UniformInteger::nseed(), and RNG::UniformInteger::vec_reseed().

Here is the call graph for this function:

void RNG::CONG::vec_reseed ( const std::vector< rngint_t > &  seeds)
virtual

Implements RNG::UniformInteger.

Member Data Documentation

rngint_t RNG::CONG::jcong
private

Definition at line 257 of file rng.h.


The documentation for this class was generated from the following file: