![]() |
programmer's documentation
|
This package downloaded at http://www.netlib.org/random/zufall.f. It generates random numbers. More...
Functions/Subroutines | |
subroutine | zufall (n, a) |
subroutine | zufalli (seed) |
Generates initial seed buffer by linear congruential method. Taken from Marsaglia, FSU report FSU-SCRI-87-50 variable seed should be 0 < seed <31328. More... | |
subroutine | normalen (n, x) |
Box-Muller method for Gaussian random numbers. More... | |
subroutine | normal00 |
subroutine | fische (n, mu, p) |
Poisson generator for distribution function of p's: ![]() | |
This package downloaded at http://www.netlib.org/random/zufall.f. It generates random numbers.
This package contains a portable random number generator set for: uniform (u in [0,1)), normal (<g> = 0, <g^2> = 1), and Poisson distributions. The basic module, the uniform generator, uses a lagged Fibonacci series generator:
where each number generated, u(k), is floating point. Since the numbers are floating point, the left end boundary of the range contains zero. This package is nearly portable except for the following. (1) It is written in lower case, (2) the test package contains a timer (second) which is not portable, and (3) there are cycle times (in seconds) in data statements for NEC SX-3, Fujitsu VP2200, and Cray Y-MP. Select your favorite and comment out the others. Replacement functions for 'second' are included - comment out the others. Otherwise the package is portable and returns the same set of floating point numbers up to word precision on any machine. There are compiler directives ($cdir for Cray, *vdir for SX-3, and VOCL for Fujitsu VP2200) which should be otherwise ignored.
To compile this beast, note that all floating point numbers are declared 'double precision'. On Cray X-MP, Y-MP, and C-90 machines, use the cft77 (cf77) option -dp to run this in 64 bit mode (not 128 bit double).
External documentation, "Lagged Fibonacci Random Number Generators for the NEC SX-3," is to be published in the International Journal of High Speed Computing (1994). Otherwise, ask the author:
W. P. Petersen IPS, RZ F-5 ETHZ CH 8092, Zurich Switzerland
e-mail: wpp@i. ps.e thz.c h
subroutine fische | ( | integer | n, |
double precision | mu, | ||
integer, dimension(*) | p | ||
) |
Poisson generator for distribution function of p's: .
[in] | n | seed |
[in] | mu | parameter |
[out] | p | random number |
subroutine normal00 | ( | ) |
subroutine normalen | ( | integer | n, |
double precision, dimension(*) | x | ||
) |
Box-Muller method for Gaussian random numbers.
[in] | n | seed |
[out] | x | random number |
subroutine zufall | ( | integer | n, |
double precision, dimension(*) | a | ||
) |
[in] | n | seed |
[in] | a | random number |
subroutine zufalli | ( | integer | seed | ) |
Generates initial seed buffer by linear congruential method. Taken from Marsaglia, FSU report FSU-SCRI-87-50 variable seed should be 0 < seed <31328.
[in] | seed | seed |