1 SUBROUTINE zlarnv( IDIST, ISEED, N, X )
56 DOUBLE PRECISION ZERO, ONE, TWO
57 parameter( zero = 0.0d+0, one = 1.0d+0, two = 2.0d+0 )
60 DOUBLE PRECISION TWOPI
61 parameter( twopi = 6.2831853071795864769252867663d+0 )
67 DOUBLE PRECISION U( LV )
70 INTRINSIC dcmplx, exp, log,
min, sqrt
77 DO 60 iv = 1, n, lv / 2
78 il =
min( lv / 2, n-iv+1 )
83 CALL dlaruv( iseed, 2*il, u )
90 x( iv+i-1 ) = dcmplx( u( 2*i-1 ), u( 2*i ) )
92 ELSE IF( idist.EQ.2 )
THEN
97 x( iv+i-1 ) = dcmplx( two*u( 2*i-1 )-one,
100 ELSE IF( idist.EQ.3 )
THEN
105 x( iv+i-1 ) = sqrt( -two*log( u( 2*i-1 ) ) )*
106 $ exp( dcmplx( zero, twopi*u( 2*i ) ) )
108 ELSE IF( idist.EQ.4 )
THEN
114 x( iv+i-1 ) = sqrt( u( 2*i-1 ) )*
115 $ exp( dcmplx( zero, twopi*u( 2*i ) ) )
117 ELSE IF( idist.EQ.5 )
THEN
123 x( iv+i-1 ) = exp( dcmplx( zero, twopi*u( 2*i ) ) )