Random number generators

Heiko Bauke heiko.bauke@physik.uni-magdeburg.de
Sat Jan 7 12:49:00 GMT 2006


some years ago I provided some patches for serveral pseudo-random number
generators.  In these patches I focussed on correctness and portability
not on performance.  

For (multiple) linear congruential generators with prime moduls a seedup
up to a factor 15 can be gained by switching from a implementation that
uses 32-bit arithmetic to 64-bit arithmetic.  The source files attached
to this mail contain compile time switches, that check if the data type
long long is available and choose a 64-bit implementation if

#if defined(LLONG_MAX)
  /* 64-bit implemtation */
  /* 32-bit implemtation */

The macro is only defined if the gcc switch --std=c99 is specified.

Instead of checking for LLONG_MAX it would be better to check in the
configure skript, if the data type long long is available and to define
a HAVE_LONG_LONG macro in config.h. But unfortunately I do not know
enough about autotools to integrate such a machnism.

My patches contain also some minor (aesthetic) correktions for other
generators and for the documenation of random number generators. In
particular I updated the performance measurements at the end of the
chapter about random number generators.

I would be pleased if my patches will find the way into to official gsl
source code.

	sincerely yours


-- Wer lügt, hat die Wahrheit immerhin gedacht.
-- (Oliver Hassencamp, dt. Schriftsteller, 1921-1987)
-- Cluster Computing @ http://www.clustercomputing.de
--       Heiko Bauke @ http://www.uni-magdeburg.de/bauke
-------------- next part --------------
A non-text attachment was scrubbed...
Name: random_patch.tgz
Type: application/x-gtar
Size: 17015 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gsl-discuss/attachments/20060107/3b439ce3/attachment.gtar>

More information about the Gsl-discuss mailing list