FNLMath : Utilities : RNOPT
RNOPT
Selects the uniform (0, 1) multiplicative congruential pseudorandom number generator.
Required Arguments
IOPT — Indicator of the generator. (Input)
The random number generator is either a multiplicative congruential generator with modulus 231 1 or a GFSR generator. IOPT is used to choose the multiplier and whether or not shuffling is done, or is used to choose the GFSR method, or is used to choose the Mersenne Twister generator.
IOPT
Generator
1
The multiplier 16807 is used.
2
The multiplier 16807 is used with shuffling.
3
The multiplier 397204094 is used.
4
The multiplier 397204094 is used with shuffling.
5
The multiplier 950706376 is used.
6
The multiplier 950706376 is used with shuffling.
7
GFSR, with the recursion Xt = Xt1563 Xt96 is used.
8
A 32-bit Mersenne Twister generator is used. The real and double random numbers are generated from 32-bit integers.
9
A 64-bit Mersenne Twister generator is used. The real and double random numbers are generated from 64-bit integers. This ensures that all bits of both float and double are random.
FORTRAN 90 Interface
Generic: CALL RNOPT (IOPT)
Specific: The specific interface name is RNOPT.
FORTRAN 77 Interface
Single: CALL RNOPT (IOPT)
Description
The uniform pseudorandom number generators use a multiplicative congruential method, with or without shuffling or a GFSR method, or the Mersenne Twister method. Routine RNOPT determines which method is used; and in the case of a multiplicative congruential method, it determines the value of the multiplier and whether or not to use shuffling. The description of RNUN may provide some guidance in the choice of the form of the generator. If no selection is made explicitly, the generators use the multiplier 16807 without shuffling. This form of the generator has been in use for some time (see Lewis, Goodman, and Miller, 1969). This is the generator formerly known as GGUBS in the IMSL Library. It is the “minimal standard generator” discussed by Park and Miller (1988).
Both of the Mersenne Twister generators have a period of 219937 -1 and a 624-dimensional equi-distribution property. See Matsumoto et al. 1998 for details.
The IMSL Mersenne Twister generators are derived from code copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, All rights reserved. It is subject to the following notice:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The IMSL 32-bit Mersenne Twister generator is based on the Matsumoto and Nishimura code ‘mt19937ar’ and the 64-bit code is based on ‘mt19937-64’.
Example
The FORTRAN statement
CALL RNOPT(1)
would select the simple multiplicative congruential generator with multiplier 16807. Since this is the same as the default, this statement would have no effect unless RNOPT had previously been called in the same program to select a different generator.