crng 1.2

Note added 2007-08-23: This package is currently not maintained. It
has been largely superceded by the 'random' module in the standard
Python distribution.

The Python module
crng implements random-number generators (RNGs) based
on several different algorithms producing uniform deviates in the open
interval (0,1), i.e. exclusive of the end-point values 0 and 1. A few
continuous and integer-valued non-uniform deviates are also
available. Each RNG algorithm is implemented as a separate Python
extension type. The RNG types are independent of each other, but have
very similar interfaces. The entire module is implemented as one
single C source code file.

There are already several RNGs available for Python, notably the
standard module random (implementing various
random-number distributions) based on whrandom (the
Wichmann-Hill algorithm). These are coded in Python, and hence
slow. The purpose of the crng module is to provide
efficient implementations coded in C of several modern RNG
algorithms. The design allows easy comparison and interchange of the
RNGs in Python code.

The crng module contains a
C interface that allows other
Python extension modules to directly call the C function for each RNG
implementation. One may thereby attain execution speeds close to those
possible for a direct implementation in C, while retaining the
flexibility of the Python interface.

Several recent and reasonably well-tested RNGs are available in the
crng module. This author is by no means an expert on
the subject, but having read some of the recent literature, I would
recommend using MT19937; it appears to
combine speed of execution with good results in several standard tests
of RNG quality. It has an astronomical period of approximately
4.3*106001.