123 SUBROUTINE zlargv( N, X, INCX, Y, INCY, C, INCC )
131 INTEGER INCC, INCX, INCY, N
134 DOUBLE PRECISION C( * )
135 COMPLEX*16 X( * ), Y( * )
141 DOUBLE PRECISION TWO, ONE, ZERO
142 parameter ( two = 2.0d+0, one = 1.0d+0, zero = 0.0d+0 )
144 parameter ( czero = ( 0.0d+0, 0.0d+0 ) )
149 INTEGER COUNT, I, IC, IX, IY, J
150 DOUBLE PRECISION CS, D, DI, DR, EPS, F2, F2S, G2, G2S, SAFMIN,
151 $ safmn2, safmx2, scale
152 COMPLEX*16 F, FF, FS, G, GS, R, SN
155 DOUBLE PRECISION DLAMCH, DLAPY2
156 EXTERNAL dlamch, dlapy2
159 INTRINSIC abs, dble, dcmplx, dconjg, dimag, int, log,
163 DOUBLE PRECISION ABS1, ABSSQ
172 abs1( ff ) = max( abs( dble( ff ) ), abs( dimag( ff ) ) )
173 abssq( ff ) = dble( ff )**2 + dimag( ff )**2
179 safmin = dlamch(
'S' )
181 safmn2 = dlamch(
'B' )**int( log( safmin / eps ) /
182 $ log( dlamch(
'B' ) ) / two )
183 safmx2 = one / safmn2
194 scale = max( abs1( f ), abs1( g ) )
198 IF( scale.GE.safmx2 )
THEN
204 IF( scale.GE.safmx2 )
206 ELSE IF( scale.LE.safmn2 )
THEN
207 IF( g.EQ.czero )
THEN
218 IF( scale.LE.safmn2 )
223 IF( f2.LE.max( g2, one )*safmin )
THEN
227 IF( f.EQ.czero )
THEN
229 r = dlapy2( dble( g ), dimag( g ) )
232 d = dlapy2( dble( gs ), dimag( gs ) )
233 sn = dcmplx( dble( gs ) / d, -dimag( gs ) / d )
236 f2s = dlapy2( dble( fs ), dimag( fs ) )
250 IF( abs1( f ).GT.one )
THEN
251 d = dlapy2( dble( f ), dimag( f ) )
252 ff = dcmplx( dble( f ) / d, dimag( f ) / d )
254 dr = safmx2*dble( f )
255 di = safmx2*dimag( f )
257 ff = dcmplx( dr / d, di / d )
259 sn = ff*dcmplx( dble( gs ) / g2s, -dimag( gs ) / g2s )
267 f2s = sqrt( one+g2 / f2 )
270 r = dcmplx( f2s*dble( fs ), f2s*dimag( fs ) )
274 sn = dcmplx( dble( r ) / d, dimag( r ) / d )
276 IF( count.NE.0 )
THEN
277 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. ...