Go to the previous, next section.

CNACG -- Additive RNG

SYNOPSIS

#include <CNCL/ACG.h>

TYPE

CN_ACG

BASE CLASSES

CNRNG

DERIVED CLASSES

None

RELATED CLASSES

CNRandom

DESCRIPTION

CNACG is the additive random number generator class. This class has extremly long period lengths and provides a good independence. Unfortunately, uniformity is not too great.
NOTE: More information about this method you can find at:
Knuth, Donald E.;The Art Of Computer Programming, Volume II; Reading, Massachusetts; Addison-Wesley; page 26/27

Constructors:

CNACG(unsigned long seed = 0, int size = 55);
CNACG(CNParam *param);
Initializes CNACG.

In addition to the member functions required by CNCL, CNACG provides:

virtual unsigned long as_long32();
Draws a random number. The result is an unsigned integer in the range 0 ... 2^32-1.

virtual bool has_long32();
Returns TRUE because the CNACG is able to produce 32bit integer values.

virtual void reset();
Resets the CNACG to its initial state.

Go to the previous, next section.