121 SUBROUTINE clargv( N, X, INCX, Y, INCY, C, INCC )
128 INTEGER INCC, INCX, INCY, N
132 COMPLEX X( * ), Y( * )
139 parameter( two = 2.0e+0, one = 1.0e+0, zero = 0.0e+0 )
141 parameter( czero = ( 0.0e+0, 0.0e+0 ) )
145 INTEGER COUNT, I, IC, IX, IY, J
146 REAL CS, D, DI, DR, EPS, F2, F2S, G2, G2S, SAFMIN,
147 $ SAFMN2, SAFMX2, SCALE
148 COMPLEX F, FF, FS, G, GS, R, SN
152 EXTERNAL slamch, slapy2
155 INTRINSIC abs, aimag, cmplx, conjg, int, log, max, real,
168 abs1( ff ) = max( abs( real( ff ) ), abs( aimag( ff ) ) )
169 abssq( ff ) = real( ff )**2 + aimag( ff )**2
175 safmin = slamch(
'S' )
177 safmn2 = slamch(
'B' )**int( log( safmin / eps ) /
178 $ log( slamch(
'B' ) ) / two )
179 safmx2 = one / safmn2
190 scale = max( abs1( f ), abs1( g ) )
194 IF( scale.GE.safmx2 )
THEN
200 IF( scale.GE.safmx2 .AND. count .LT. 20 )
202 ELSE IF( scale.LE.safmn2 )
THEN
203 IF( g.EQ.czero )
THEN
214 IF( scale.LE.safmn2 )
219 IF( f2.LE.max( g2, one )*safmin )
THEN
223 IF( f.EQ.czero )
THEN
225 r = slapy2( real( g ), aimag( g ) )
228 d = slapy2( real( gs ), aimag( gs ) )
229 sn = cmplx( real( gs ) / d, -aimag( gs ) / d )
232 f2s = slapy2( real( fs ), aimag( fs ) )
246 IF( abs1( f ).GT.one )
THEN
247 d = slapy2( real( f ), aimag( f ) )
248 ff = cmplx( real( f ) / d, aimag( f ) / d )
250 dr = safmx2*real( f )
251 di = safmx2*aimag( f )
253 ff = cmplx( dr / d, di / d )
255 sn = ff*cmplx( real( gs ) / g2s, -aimag( gs ) / g2s )
263 f2s = sqrt( one+g2 / f2 )
266 r = cmplx( f2s*real( fs ), f2s*aimag( fs ) )
270 sn = cmplx( real( r ) / d, aimag( r ) / d )
272 IF( count.NE.0 )
THEN
273 IF( count.GT.0 )
THEN
subroutine clargv(n, x, incx, y, incy, c, incc)
CLARGV generates a vector of plane rotations with real cosines and complex sines.