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
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
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