slarnv(3S)
SLARNV - return a vector of n random real numbers from a uniform or normal distribution
As shipped in IRIX 6.5.19. Added in IRIX 6.5.15.
NAME SLARNV - return a vector of n random real numbers from a uniform or normal distribution SYNOPSIS SUBROUTINE SLARNV( IDIST, ISEED, N, X ) INTEGER IDIST, N INTEGER ISEED( 4 ) REAL X( * ) IMPLEMENTATION These routines are part of the SCSL Scientific Library and can be loaded using either the -lscs or the -lscs_mp option. The -lscs_mp option directs the linker to use the multi-processor version of the library. When linking to SCSL with -lscs or -lscs_mp, the default integer size is 4 bytes (32 bits). Another version of SCSL is available in which integers are 8 bytes (64 bits). This version allows the user access to larger memory sizes and helps when porting legacy Cray codes. It can be loaded by using the -lscs_i8 option or the -lscs_i8_mp option. A program may use only one of the two versions; 4-byte integer and 8-byte integer library calls cannot be mixed. PURPOSE SLARNV returns a vector of n random real numbers from a uniform or normal distribution. ARGUMENTS IDIST (input) INTEGER Specifies the distribution of the random numbers: = 1: uniform (0,1) = 2: uniform (-1,1) = 3: normal (0,1) ISEED (input/output) INTEGER array, dimension (4) On entry, the seed of the random number generator; the array elements must be between 0 and 4095, and ISEED(4) must be odd. On exit, the seed is updated. N (input) INTEGER The number of random numbers to be generated. X (output) REAL array, dimension (N) The generated random numbers. FURTHER DETAILS This routine calls the auxiliary routine SLARUV to generate random real numbers from a uniform (0,1) distribution, in batches of up to 128 using vectorisable code. The Box-Muller method is used to transform numbers from a uniform to a normal distribution. SEE ALSO INTRO_LAPACK(3S), INTRO_SCSL(3S) This man page is available only online.