|
SST/macro
|
The multiple-with-carry random number generator by George Marsaglia (1999; internet posting). More...
#include <rng.h>


Public Member Functions | |
| virtual std::string | to_string () const |
| ~MWC () | |
| 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 MWC * | construct () |
| static MWC * | construct (const std::vector< rngint_t > &) |
| static MWC * | construct (rngint_t zarg) |
| static MWC * | construct (rngint_t zarg, rngint_t warg) |
Protected Member Functions | |
| MWC () | |
Private Member Functions | |
| rngint_t | znew () |
| rngint_t | wnew () |
Private Attributes | |
| rngint_t | z |
| rngint_t | w |
Static Private Attributes | |
| static const rngint_t | default_z |
| static const rngint_t | default_w |
The multiple-with-carry random number generator by George Marsaglia (1999; internet posting).
This RNG is fast and has a low memory footprint. Here is an excerpt from the posting describing this generator: The MWC generator concatenates two 16-bit multiply-with-carry generators, x(n)=36969x(n-1)+carry, y(n)=18000y(n-1)+carry mod 216, has period about 260 and seems to pass all tests of randomness. A favorite stand-alone generator—faster than KISS, which contains it.
|
protected |
| RNG::MWC::~MWC | ( | ) |
|
static |
|
virtual |
Implements RNG::UniformInteger.
|
inlinevirtual |
|
inlinevirtual |
Implements RNG::UniformInteger.
Definition at line 135 of file rng.h.
References RNG::UniformInteger::nseed(), and RNG::UniformInteger::vec_reseed().

|
virtual |
Implements RNG::UniformInteger.
1.8.11