     [file version.texi not included]

This is version VERSION of the PRNG-manual,

last updated UPDATED

PRNG -- Pseudo-Random Number Generator
**************************************

PRNG is a collection of algorithms for generating pseudorandom numbers as a library of C functions, released under the GPL (http://www.gnu.org/copyleft/gpl.html). It has been written by Otmar Lendl (lendl@cosy.sbg.ac.at) and is now maintained by Josef Leydold (leydold@statistik.wu-wien.ac.at).

The current version of this package can always be found on the ARVAG (Automatic Random VAriate Generation) project group (http://statistik.wu-wien.ac.at/arvag/) in Vienna, or the pLab server (http://random.mat.sbg.ac.at/) in Salzburg.

In the case of any troubles, bug reports or need of assistance please contact the maintainer via prng@statistik.wu-wien.ac.at. Please let us also know about your experiencies with the library.

Features
========

  * Portability. This library should compile on any computer with an ANSI C compiler. A verification program is included.

  * General Implementations. This library does not implement certain fixed generators like RANDU or rand, but implements the general PRNG algorithms to which all parameters can be supplied by the user.

  * Consistent and object-oriented interface. This interface simplifies the PRNG handling inside the main application.

  * Possibility of independent copies of the same generator.

  * Extensibility. New generators are easily integrated into the framework of this library.

  * Fully supported Pseudorandom number generating methods: (free parametrization)

       - LCG       (linear congruential generator)

       - ICG       (inversive congruential generator)

       - EICG      (explicit inversive congruential generator)

       - mEICG     (modified explicit inversive congruential generator)

       - DICG      (digital inversive congruential generator)

       - QCG       (quadratic congruential generator)

     Fixed parameter PRNG (external generators):

       - MT19937   (Mersenne Twister by M. Matsumoto)

       - TT800     (a large TSFR by M. Matsumoto)

       - CTG       (Combined Tausworthe Generator by P. L'Ecuyer)

       - MRG       (Multiple Recursive Generator by P. L'Ecuyer)

       - CMRG      (Combined (Multiple Recursive Generator by P. L'Ecuyer)

     plus the following methods (meta-generators):

       - C         (Compound generator)

       - SUB       (Subsequences)

       - ANTI      (antithetic random variables)

       - CON       (Consecutive blocks)

       - AFILE     (Ascii file)

       - BFILE     (Binary file)

Installing PRNG
***************

While the code is plain ANSI C and thus quite portable, the following adaptions might be neccessary for compile this library.

All configurations are done in the file src/prng.h. Each option is extensively commented there. Here is a quick rundown on what to expect there:

  * Definition of the basic numeric data-type prng_num. It is not recommended to change this. For 32 and 64 bit computers all neccessary auxiliary definitions will be made automatically. For other architectures, please edit prng.h according to the comments.

  * Various constants. See comments on the exact meanings.

  * Definition of prng_inverse. In previous versions, there was no algorithm which was fastest on all architectures, thus is was necessary configure the library for the each platform. Now prng_inverse_own, which combines the speedups of all old algorithms is the fastest one on all tested architectures and thus no configuration is necessary any more.

The code is optimized for GNU CC (gcc). If your compiler supports the type (long long int), too, you can use this feature by defining HAVE_LONGLONG in prng.h.

Then do:

             ./configure --prefix=<prefix_path>
             make

This should compile the library (libprng.a) and example programs.

To install the library (see also GNU generic installation instructions in file INSTALL) type:

             make install

which installs <prefix_path>/lib/libprng.a, <prefix_path>/include/prng.h, and <prefix_path>/info/prng.info. If --prefix is omitted, then /usr/local is used as default.

It is possible to remove these files by

             make uninstall

I could not test this code in many environments, thus it might be necessary to tweak the code to compile it. Please mail me any changes you made, so that I can include them in the next official release.

Documentation
=============

A manual can be found in directory doc in various formats, including PS, PDF, HTML, Info and plain text.

Profiling and Verification
==========================

Do

             make check

to make and run the following executables:

  * iter
     This program counts the number of iterations in the euclid_table algorithm. It's NOT kept up to date. Use at own risk.

  * validate
     Using the supplied file tests.dat, this program tests the generator library for correct operation. On 32-bit computers it will fail on generators requiring 64-bit arithmetic.

     [file usage.texi not included]

     [file theory.texi not included]

     [file tables.texi not included]