119 SUBROUTINE zlargv( N, X, INCX, Y, INCY, C, INCC )
126 INTEGER INCC, INCX, INCY, N
129 DOUBLE PRECISION C( * )
130 COMPLEX*16 X( * ), Y( * )
136 DOUBLE PRECISION TWO, ONE, ZERO
137 parameter( two = 2.0d+0, one = 1.0d+0, zero = 0.0d+0 )
139 parameter( czero = ( 0.0d+0, 0.0d+0 ) )
144 INTEGER COUNT, I, IC, IX, IY, J
145 DOUBLE PRECISION CS, D, DI, DR, EPS, F2, F2S, G2, G2S, SAFMIN,
146 $ SAFMN2, SAFMX2, SCALE
147 COMPLEX*16 F, FF, FS, G, GS, R, SN
150 DOUBLE PRECISION DLAMCH, DLAPY2
151 EXTERNAL dlamch, dlapy2
154 INTRINSIC abs, dble, dcmplx, dconjg, dimag, int, log,
158 DOUBLE PRECISION ABS1, ABSSQ
167 abs1( ff ) = max( abs( dble( ff ) ), abs( dimag( ff ) ) )
168 abssq( ff ) = dble( ff )**2 + dimag( ff )**2
174 safmin = dlamch(
'S' )
176 safmn2 = dlamch(
'B' )**int( log( safmin / eps ) /
177 $ log( dlamch(
'B' ) ) / two )
178 safmx2 = one / safmn2
189 scale = max( abs1( f ), abs1( g ) )
193 IF( scale.GE.safmx2 )
THEN
199 IF( scale.GE.safmx2 .AND. count .LT. 20 )
201 ELSE IF( scale.LE.safmn2 )
THEN
202 IF( g.EQ.czero )
THEN
213 IF( scale.LE.safmn2 )
218 IF( f2.LE.max( g2, one )*safmin )
THEN
222 IF( f.EQ.czero )
THEN
224 r = dlapy2( dble( g ), dimag( g ) )
227 d = dlapy2( dble( gs ), dimag( gs ) )
228 sn = dcmplx( dble( gs ) / d, -dimag( gs ) / d )
231 f2s = dlapy2( dble( fs ), dimag( fs ) )
245 IF( abs1( f ).GT.one )
THEN
246 d = dlapy2( dble( f ), dimag( f ) )
247 ff = dcmplx( dble( f ) / d, dimag( f ) / d )
249 dr = safmx2*dble( f )
250 di = safmx2*dimag( f )
252 ff = dcmplx( dr / d, di / d )
254 sn = ff*dcmplx( dble( gs ) / g2s, -dimag( gs ) / g2s )
262 f2s = sqrt( one+g2 / f2 )
265 r = dcmplx( f2s*dble( fs ), f2s*dimag( fs ) )
269 sn = dcmplx( dble( r ) / d, dimag( r ) / d )
271 IF( count.NE.0 )
THEN
272 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.