Go to the previous, next section.
#include <CNCL/LCG.h>
CN_LCG
CNRNG
None
CNRandom
CNLCG
is a linear congruence random number generator class.
This class is using the easiest method for pseudo random number generator. It is the fastest one, but its short-comings should not be neglected. The period is very short, usually not sufficient for any serious simulation. Depending on the chosen seed value only even or odd numbers are drawn. Any period of drawn numbers are highly correlated. Thus this class should not be used at any important simulation.
Constructors:
CNLCG(unsigned long seed = 929);
CNLCG(CNParam *param);
CNLCG
with initial seed
.
In addition to the member functions required by CNCL, CNLCG
provides:
virtual unsigned long as_long32();
virtual bool has_long32();
virtual void reset();
void seed(unsigned long);
Go to the previous, next section.