#include <CNCL/MLCG.h>
CN_CNMLCG
CNRNG
None
CNRandom
CNMLCG
is a multiple linear congruence random number generator
class combining the results of two different CNLCGs.
It is the double MLCG described by L'Ecuyer [6].
The implementation was taken from the GNU-library libg++. This generator has a
fairly long period, and has been statistically analyzed to show that it gives
good intersample-independence.
The 'CNMLCG::CNMLCG' constructor has two parameters, both of which are seeds
for the generator. Both seeds are modified to give a "better" distribution
of seed digits. Thus, you can safely use values such as '0' and '1' for the
seeds. Such values are mapped to values with a sufficient number and
distribution of bits. Hence the constructor contains a table with 32
tested seed values.
Constructors:
CNMLCG();
CNMLCG(long seed1, long seed2);
CNMLCG(CNParam *param);
CNMLCG
with two seeds, seed1
and
seed2
. The default constructor sets both seeds to 0.
In addition to the member functions required by CNCL, CNMLCG
provides:
virtual unsigned long as_long32();
virtual bool has_long32();
virtual void reset();
void seed(unsigned long s);
s
and the second one
to s + 2147483561
.
void seed_internal(unsigned long, unsigned long);
Go to the first, previous, next, last section, table of contents.