121 SUBROUTINE zlargv( N, X, INCX, Y, INCY, C, INCC )
128 INTEGER INCC, INCX, INCY, N
131 DOUBLE PRECISION C( * )
132 COMPLEX*16 X( * ), Y( * )
138 DOUBLE PRECISION TWO, ONE, ZERO
139 parameter( two = 2.0d+0, one = 1.0d+0, zero = 0.0d+0 )
141 parameter( czero = ( 0.0d+0, 0.0d+0 ) )
146 INTEGER COUNT, I, IC, IX, IY, J
147 DOUBLE PRECISION CS, D, DI, DR, EPS, F2, F2S, G2, G2S, SAFMIN,
148 $ SAFMN2, SAFMX2, SCALE
149 COMPLEX*16 F, FF, FS, G, GS, R, SN
152 DOUBLE PRECISION DLAMCH, DLAPY2
153 EXTERNAL dlamch, dlapy2
156 INTRINSIC abs, dble, dcmplx, dconjg, dimag, int, log,
160 DOUBLE PRECISION ABS1, ABSSQ
169 abs1( ff ) = max( abs( dble( ff ) ), abs( dimag( ff ) ) )
170 abssq( ff ) = dble( ff )**2 + dimag( ff )**2
176 safmin = dlamch(
'S' )
178 safmn2 = dlamch(
'B' )**int( log( safmin / eps ) /
179 $ log( dlamch(
'B' ) ) / two )
180 safmx2 = one / safmn2
191 scale = max( abs1( f ), abs1( g ) )
195 IF( scale.GE.safmx2 )
THEN
201 IF( scale.GE.safmx2 .AND. count .LT. 20 )
203 ELSE IF( scale.LE.safmn2 )
THEN
204 IF( g.EQ.czero )
THEN
215 IF( scale.LE.safmn2 )
220 IF( f2.LE.max( g2, one )*safmin )
THEN
224 IF( f.EQ.czero )
THEN
226 r = dlapy2( dble( g ), dimag( g ) )
229 d = dlapy2( dble( gs ), dimag( gs ) )
230 sn = dcmplx( dble( gs ) / d, -dimag( gs ) / d )
233 f2s = dlapy2( dble( fs ), dimag( fs ) )
247 IF( abs1( f ).GT.one )
THEN
248 d = dlapy2( dble( f ), dimag( f ) )
249 ff = dcmplx( dble( f ) / d, dimag( f ) / d )
251 dr = safmx2*dble( f )
252 di = safmx2*dimag( f )
254 ff = dcmplx( dr / d, di / d )
256 sn = ff*dcmplx( dble( gs ) / g2s, -dimag( gs ) / g2s )
264 f2s = sqrt( one+g2 / f2 )
267 r = dcmplx( f2s*dble( fs ), f2s*dimag( fs ) )
271 sn = dcmplx( dble( r ) / d, dimag( r ) / d )
273 IF( count.NE.0 )
THEN
274 IF( count.GT.0 )
THEN
subroutine zlargv(n, x, incx, y, incy, c, incc)
ZLARGV generates a vector of plane rotations with real cosines and complex sines.