123 SUBROUTINE clargv( N, X, INCX, Y, INCY, C, INCC )
131 INTEGER INCC, INCX, INCY, N
135 COMPLEX X( * ), Y( * )
142 parameter ( two = 2.0e+0, one = 1.0e+0, zero = 0.0e+0 )
144 parameter ( czero = ( 0.0e+0, 0.0e+0 ) )
148 INTEGER COUNT, I, IC, IX, IY, J
149 REAL CS, D, DI, DR, EPS, F2, F2S, G2, G2S, SAFMIN,
150 $ safmn2, safmx2, scale
151 COMPLEX F, FF, FS, G, GS, R, SN
155 EXTERNAL slamch, slapy2
158 INTRINSIC abs, aimag, cmplx, conjg, int, log, max,
REAL,
171 abs1( ff ) = max( abs(
REAL( FF ) ), abs( AIMAG( ff ) ) )
172 abssq( ff ) =
REAL( ff )**2 + AIMAG( ff )**2
178 safmin = slamch(
'S' )
180 safmn2 = slamch(
'B' )**int( log( safmin / eps ) /
181 $ log( slamch(
'B' ) ) / two )
182 safmx2 = one / safmn2
193 scale = max( abs1( f ), abs1( g ) )
197 IF( scale.GE.safmx2 )
THEN
203 IF( scale.GE.safmx2 )
205 ELSE IF( scale.LE.safmn2 )
THEN
206 IF( g.EQ.czero )
THEN
217 IF( scale.LE.safmn2 )
222 IF( f2.LE.max( g2, one )*safmin )
THEN
226 IF( f.EQ.czero )
THEN
228 r = slapy2(
REAL( G ), AIMAG( g ) )
231 d = slapy2(
REAL( GS ), AIMAG( gs ) )
232 sn = cmplx(
REAL( GS ) / D, -AIMAG( gs ) / D )
235 f2s = slapy2(
REAL( FS ), AIMAG( fs ) )
249 IF( abs1( f ).GT.one )
THEN
250 d = slapy2(
REAL( F ), AIMAG( f ) )
251 ff = cmplx(
REAL( F ) / D, AIMAG( f ) / D )
253 dr = safmx2*
REAL( f )
254 di = safmx2*aimag( f )
256 ff = cmplx( dr / d, di / d )
258 sn = ff*cmplx(
REAL( GS ) / G2S, -AIMAG( gs ) / G2S )
266 f2s = sqrt( one+g2 / f2 )
269 r = cmplx( f2s*
REAL( FS ), F2S*AIMAG( fs ) )
273 sn = cmplx(
REAL( R ) / D, AIMAG( r ) / D )
275 IF( count.NE.0 )
THEN
276 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. ...