libcoyotl - A Library of C++ Tools

Created by Scott Robert Ladd at Coyote Gulch Productions.


Public Member Functions
libcoyotl::cmwc4096 Class Reference

Implements CMWC4096, a peudorandom number generator. More...

#include <cmwc4096.h>

Inheritance diagram for libcoyotl::cmwc4096:
libcoyotl::prng

List of all members.

Public Member Functions


Detailed Description

The cmwc4096 class encapsulates a complimentary-multiply-with-carry algorithm for psuedorandom number generation, as suggested by George Marsaglia.


Constructor & Destructor Documentation

libcoyotl::cmwc4096::cmwc4096 ( )

The constructor initializes the prng seed from either the time or some stochastic source such as /dev/random or /dev/urandom.

libcoyotl::cmwc4096::cmwc4096 ( uint32_t  seed)

The constructor uses an explicit value for the seed.

Parameters:
seed- Seed value used to "start" or seed the generator

Member Function Documentation

virtual uint32_t libcoyotl::cmwc4096::get_rand ( ) [virtual]

Returns the next uint32_t in sequence.

Returns:
A pseudorandom uint32_t value

Implements libcoyotl::prng.

virtual void libcoyotl::cmwc4096::init ( uint32_t  seed) [virtual]

Resets the generator using the provided seed value.

Parameters:
seed- Seed value used to "start" or seed the generator

Reimplemented from libcoyotl::prng.


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

© 1996-2005 Scott Robert Ladd. All rights reserved.
HTML documentation generated by Dimitri van Heesch's excellent Doxygen tool.