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

A simple random generator using MWC, CONG, and SHR3 by George Marsaglia (1999; internet posting). More...

#include <rng.h>

Inheritance diagram for RNG::SimpleCombo:
Inheritance graph
Collaboration diagram for RNG::SimpleCombo:
Collaboration graph

Public Member Functions

virtual std::string to_string () const
 
 ~SimpleCombo ()
 
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 SimpleComboconstruct ()
 
static SimpleComboconstruct (const std::vector< rngint_t > &)
 
static SimpleComboconstruct (rngint_t zarg)
 
static SimpleComboconstruct (rngint_t zarg, rngint_t warg)
 
static SimpleComboconstruct (rngint_t zarg, rngint_t warg, rngint_t jsrarg)
 
static SimpleComboconstruct (rngint_t zarg, rngint_t warg, rngint_t jsrarg, rngint_t jcongarg)
 

Protected Member Functions

 SimpleCombo ()
 

Private Attributes

MWCmwc_
 
CONGcong_
 
SHR3shr3_
 

Detailed Description

A simple random generator using MWC, CONG, and SHR3 by George Marsaglia (1999; internet posting).

Here is an excerpt from the posting describing this generator: The KISS generator, (Keep It Simple Stupid), is designed to combine the two multiply-with-carry generators in MWC with the 3-shift register SHR3 and the congruential generator CONG, using addition and exclusive-or. Period about 2123. It is one of my favorite generators.

Definition at line 305 of file rng.h.

Constructor & Destructor Documentation

RNG::SimpleCombo::~SimpleCombo ( )
RNG::SimpleCombo::SimpleCombo ( )
protected

Member Function Documentation

static SimpleCombo* RNG::SimpleCombo::construct ( )
static
static SimpleCombo* RNG::SimpleCombo::construct ( const std::vector< rngint_t > &  )
static
static SimpleCombo* RNG::SimpleCombo::construct ( rngint_t  zarg)
static
static SimpleCombo* RNG::SimpleCombo::construct ( rngint_t  zarg,
rngint_t  warg 
)
static
static SimpleCombo* RNG::SimpleCombo::construct ( rngint_t  zarg,
rngint_t  warg,
rngint_t  jsrarg 
)
static
static SimpleCombo* RNG::SimpleCombo::construct ( rngint_t  zarg,
rngint_t  warg,
rngint_t  jsrarg,
rngint_t  jcongarg 
)
static
int RNG::SimpleCombo::nseed ( )
virtual

Implements RNG::UniformInteger.

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

Definition at line 314 of file rng.h.

rngint_t RNG::SimpleCombo::value ( )
inlinevirtual

Implements RNG::UniformInteger.

Definition at line 341 of file rng.h.

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

Here is the call graph for this function:

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

Implements RNG::UniformInteger.

Member Data Documentation

CONG* RNG::SimpleCombo::cong_
private

Definition at line 309 of file rng.h.

MWC* RNG::SimpleCombo::mwc_
private

Definition at line 308 of file rng.h.

SHR3* RNG::SimpleCombo::shr3_
private

Definition at line 310 of file rng.h.


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