Author(s): F. James | Library: MATHLIB |
Submitter: | Submitted: 15.03.1994 |
Language: Fortran | Revised: |
RANLUX generates pseudorandom numbers uniformly distributed in the interval (0,1), the end points excluded. Each call produces an array of single-precision real numbers of which 24 bits of mantissa are random. The user can choose a luxury level which guarantees the quality required for his application. The lowest luxury level (zero) gives a fast generator which will fail some sophisticated tests of randomness; The highest level (four) is about five times slower but guarantees complete randomness. In all cases the period is greater than . Independent subsequences can be generated. Entries are provided for initialization and checkpointing.
Structure:
SUBROUTINE Subprograms
User Entry Names: RANLUX, RLUXGO, RLUXAT,
RLUXIN, RLUXUT
Usage:
CALL RANLUX(RVEC,LEN)returns a vector RVEC of LEN 32-bit random floating point numbers in the interval (0,1), the end points excluded. RVEC is an array of type REAL and of length LEN at least.
Luxury levels:
For simplicity, five standard luxury levels may be chosen (t is the time factor relative to level zero; for the definition of p, see References). Ref. 1. explains the method, Ref. 2. describes the Fortran implementation in more detail.
Level | p | t | |
0 | 24 | 1 | |
1 | 48 | 1.5 | |
2 | 97 | 2 | |
3 | 223 | 3 | |
4 | 389 | 5 |
No initialization is necessary if the user wants default values. Otherwise the following are available:
CALL RLUXGO(LUX,INT,K1,K2)When , this call initializes the RANLUX generator from one 32-bit integer INT and sets the Luxury Level. If LUX is an integer between 0 and 4, it sets the luxury level as defined above. If , it is taken as the value of p, which then can take on other values than those given in the table. If , default initialization is used and only the luxury level is set by LUX. Otherwise, every possible value of INT gives rise to a valid, independent sequence which will not overlap any sequence initialized with any other value of INT. The integers K1 and K2 are used for restarting the generator from a break point saved by RLUXAT.
CALL RLUXAT(LUX,INT,K1,K2)dumps the four integers which can be used to restart the generator at this point by calling RLUXGO. RANLUX will then skip over numbers to reach the break point. A more efficient but less convenient method for restarting is offered by RLUXIN and RLUXUT.
CALL RLUXIN(IVEC)restarts the generator from vector IVEC of 25 32-bit integers (see RLUXUT). IVEC is an array of type INTEGER and of length 25 at least.
CALL RLUXUT(IVEC)outputs the current values of the 25 32-bit integer seeds, to be used for restarting.
References: