1SLARNV(1) LAPACK auxiliary routine (version 3.2) SLARNV(1)
2
3
4
6 SLARNV - returns a vector of n random real numbers from a uniform or
7 normal distribution
8
10 SUBROUTINE SLARNV( IDIST, ISEED, N, X )
11
12 INTEGER IDIST, N
13
14 INTEGER ISEED( 4 )
15
16 REAL X( * )
17
19 SLARNV returns a vector of n random real numbers from a uniform or nor‐
20 mal distribution.
21
23 IDIST (input) INTEGER
24 Specifies the distribution of the random numbers:
25 = 1: uniform (0,1)
26 = 2: uniform (-1,1)
27 = 3: normal (0,1)
28
29 ISEED (input/output) INTEGER array, dimension (4)
30 On entry, the seed of the random number generator; the array
31 elements must be between 0 and 4095, and ISEED(4) must be odd.
32 On exit, the seed is updated.
33
34 N (input) INTEGER
35 The number of random numbers to be generated.
36
37 X (output) REAL array, dimension (N)
38 The generated random numbers.
39
41 This routine calls the auxiliary routine SLARUV to generate random real
42 numbers from a uniform (0,1) distribution, in batches of up to 128
43 using vectorisable code. The Box-Muller method is used to transform
44 numbers from a uniform to a normal distribution.
45
46
47
48 LAPACK auxiliary routine (versionNo3v.e2m)ber 2008 SLARNV(1)