#include <CNCL/FiboG.h>
CN_FIBOG
CNRNG
None
CNRandom
CNFiboG
is the Fibonacci random number generator class.
This generator is a lagged fibonacci generator which is a modification based
on the algorithm proposed by Marsaglia, Zaman and Tsang [9].
Concerning the seed selection and the amount of memory required
James [10] states the following:
"A most exceptional property of this generator is the extreme simplicity of
generating independently disjoint sequences. The generator must be
initialized by giving one 32-bit integer ..., each value of which gives
rise to an independent sequence of sufficient length for an entire
calculation. This means that in a collaboration between different physicists,
each
physicist can be assigned one number between zero and 9999 as the last four
decimal digits of the initiator, and he will be assured of not overlapping
the sequences of any other, even though he still has about 90000 possibilities
for the other digits at his disposal for independent initialization.
That is, the program can generate about 900 million different subsequences,
each one very long (average length ca. 10^30).
On the other hand, there is a small price to pay for the exceptionally long
period: The complete specification of the state of the generator at a given
point (for example to be able to regenerate a given event in the middle of
a calculation) requires one hundred and two full words... This contrasts
with the one word (two words) necessary for a MLCG of period ca.
10^9 (10^18)."
The implemented version is based on the following algorithm:
The period of this generator is determined by N = (2^32 - 1) * 2^96. For further details and statistical tests of this generator refer to Richter [11].
The main advantage of this method can be seen in a combination of a simple mathematical formula and a period length sufficient enough for physical simulation runs. Nevertheless, it still represents a pseudo random number generator. Thus, a non-ideal correlation can be expected.
Constructors:
CNFiboG(CNParam *param);
CNFiboG(unsigned long init = 54217137);
CNFiboG
with a 97 elements circular queue and initial
seed.
In addition to the member functions required by CNCL, CNFiboG
provides:
virtual unsigned long as_long32();
virtual bool has_long32();
virtual void reset();
void seed_internal(unsigned long *ulp);
*ulp
, an array of 98 values.
Go to the first, previous, next, last section, table of contents.