183 SUBROUTINE csytf2( UPLO, N, A, LDA, IPIV, INFO )
203 parameter( zero = 0.0e+0, one = 1.0e+0 )
205 parameter( eight = 8.0e+0, sevten = 17.0e+0 )
207 parameter( cone = ( 1.0e+0, 0.0e+0 ) )
211 INTEGER i, imax, j, jmax, k, kk, kp, kstep
212 REAL absakk, alpha, colmax, rowmax
213 COMPLEX d11, d12, d21, d22, r1, t, wk, wkm1, wkp1, z
224 INTRINSIC abs, aimag, max,
REAL, sqrt
230 cabs1( z ) = abs(
REAL( Z ) ) + abs( aimag( z ) )
237 upper =
lsame( uplo,
'U' )
238 IF( .NOT.upper .AND. .NOT.
lsame( uplo,
'L' ) )
THEN
240 ELSE IF( n.LT.0 )
THEN
242 ELSE IF( lda.LT.max( 1, n ) )
THEN
246 CALL
xerbla(
'CSYTF2', -info )
252 alpha = ( one+sqrt( sevten ) ) / eight
273 absakk = cabs1( a( k, k ) )
279 imax =
icamax( k-1, a( 1, k ), 1 )
280 colmax = cabs1( a( imax, k ) )
285 IF( max( absakk, colmax ).EQ.zero .OR.
sisnan(absakk) )
THEN
293 IF( absakk.GE.alpha*colmax )
THEN
303 jmax = imax +
icamax( k-imax, a( imax, imax+1 ), lda )
304 rowmax = cabs1( a( imax, jmax ) )
306 jmax =
icamax( imax-1, a( 1, imax ), 1 )
307 rowmax = max( rowmax, cabs1( a( jmax, imax ) ) )
310 IF( absakk.GE.alpha*colmax*( colmax / rowmax ) )
THEN
315 ELSE IF( cabs1( a( imax, imax ) ).GE.alpha*rowmax )
THEN
337 CALL
cswap( kp-1, a( 1, kk ), 1, a( 1, kp ), 1 )
338 CALL
cswap( kk-kp-1, a( kp+1, kk ), 1, a( kp, kp+1 ),
341 a( kk, kk ) = a( kp, kp )
343 IF( kstep.EQ.2 )
THEN
345 a( k-1, k ) = a( kp, k )
352 IF( kstep.EQ.1 )
THEN
364 r1 = cone / a( k, k )
365 CALL
csyr( uplo, k-1, -r1, a( 1, k ), 1, a, lda )
369 CALL
cscal( k-1, r1, a( 1, k ), 1 )
387 d22 = a( k-1, k-1 ) / d12
388 d11 = a( k, k ) / d12
389 t = cone / ( d11*d22-cone )
392 DO 30 j = k - 2, 1, -1
393 wkm1 = d12*( d11*a( j, k-1 )-a( j, k ) )
394 wk = d12*( d22*a( j, k )-a( j, k-1 ) )
396 a( i, j ) = a( i, j ) - a( i, k )*wk -
410 IF( kstep.EQ.1 )
THEN
441 absakk = cabs1( a( k, k ) )
447 imax = k +
icamax( n-k, a( k+1, k ), 1 )
448 colmax = cabs1( a( imax, k ) )
453 IF( max( absakk, colmax ).EQ.zero .OR.
sisnan(absakk) )
THEN
461 IF( absakk.GE.alpha*colmax )
THEN
471 jmax = k - 1 +
icamax( imax-k, a( imax, k ), lda )
472 rowmax = cabs1( a( imax, jmax ) )
474 jmax = imax +
icamax( n-imax, a( imax+1, imax ), 1 )
475 rowmax = max( rowmax, cabs1( a( jmax, imax ) ) )
478 IF( absakk.GE.alpha*colmax*( colmax / rowmax ) )
THEN
483 ELSE IF( cabs1( a( imax, imax ) ).GE.alpha*rowmax )
THEN
506 $ CALL
cswap( n-kp, a( kp+1, kk ), 1, a( kp+1, kp ), 1 )
507 CALL
cswap( kp-kk-1, a( kk+1, kk ), 1, a( kp, kk+1 ),
510 a( kk, kk ) = a( kp, kp )
512 IF( kstep.EQ.2 )
THEN
514 a( k+1, k ) = a( kp, k )
521 IF( kstep.EQ.1 )
THEN
535 r1 = cone / a( k, k )
536 CALL
csyr( uplo, n-k, -r1, a( k+1, k ), 1,
537 $ a( k+1, k+1 ), lda )
541 CALL
cscal( n-k, r1, a( k+1, k ), 1 )
558 d11 = a( k+1, k+1 ) / d21
559 d22 = a( k, k ) / d21
560 t = cone / ( d11*d22-cone )
564 wk = d21*( d11*a( j, k )-a( j, k+1 ) )
565 wkp1 = d21*( d22*a( j, k+1 )-a( j, k ) )
567 a( i, j ) = a( i, j ) - a( i, k )*wk -
579 IF( kstep.EQ.1 )
THEN