HP MLIB User's Guide Vol. 2 7th Ed.
618 HP MLIB User’s Guide
SRANV/DRANV Vector long period random number generator
incx Increment for the array x:
incx ≥ 0 x is stored forward in array x; that is,
x
i
is stored in x((i−1)×incx+1).
incx < 0 x is stored backward in array x; that
is, x
i
is stored in x((i−n)×incx+1).
Use incx = 1 if the vector x is stored contiguously in
array x, that is, if x
i
is stored in x(i). Refer to “BLAS
Indexing Conventions” in the introduction to
Chapter 2.
Output iseed The seed that produces the next pseudorandom
number in the sequence replaces the input seed.
x Array of length lenx = (n−1)×|incx|+1 containing the
n-vector X. If n ≤ 0, then x is not referenced. Otherwise,
the next n pseudorandom numbers in the sequence
replaces the input.
Notes CALL SRANV (iseed, n, x, incx) produces the same n pseudorandom numbers
as returned by n successive references to SRAN(iseed).
CALL SRANV (iseed, n, x, incx) produces the same value of iseed that would
have resulted from the last of n successive references to SRAN(iseed).
Starting a sequence twice with the same value of iseed will produce the same
pseudorandom sequence.
You may have as many independent sequences going at a time as you desire by
having a different iseed for each one.
The subprograms treat iseed as an unsigned 48-bit quantity. To write it out for
later continuation of the same sequence, either use unformatted I/O statements
or write it out with an octal, unsigned integer, or hexadecimal format descriptor
of the form O16, SU,I15, or Z12, respectively. Alternatively, in the absence of
INTEGER*8, use 2O12, SU, 2I/O or 2Z8, respectively