183 SUBROUTINE zsytf2( UPLO, N, A, LDA, IPIV, INFO )
196 COMPLEX*16 a( lda, * )
202 DOUBLE PRECISION zero, one
203 parameter( zero = 0.0d+0, one = 1.0d+0 )
204 DOUBLE PRECISION eight, sevten
205 parameter( eight = 8.0d+0, sevten = 17.0d+0 )
207 parameter( cone = ( 1.0d+0, 0.0d+0 ) )
211 INTEGER i, imax, j, jmax, k, kk, kp, kstep
212 DOUBLE PRECISION absakk, alpha, colmax, rowmax
213 COMPLEX*16 d11, d12, d21, d22, r1, t, wk, wkm1, wkp1, z
224 INTRINSIC abs, dble, dimag, max, sqrt
227 DOUBLE PRECISION cabs1
230 cabs1( z ) = abs( dble( z ) ) + abs( dimag( 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(
'ZSYTF2', -info )
252 alpha = ( one+sqrt( sevten ) ) / eight
273 absakk = cabs1( a( k, k ) )
279 imax =
izamax( k-1, a( 1, k ), 1 )
280 colmax = cabs1( a( imax, k ) )
285 IF( max( absakk, colmax ).EQ.zero .OR.
disnan(absakk) )
THEN
293 IF( absakk.GE.alpha*colmax )
THEN
303 jmax = imax +
izamax( k-imax, a( imax, imax+1 ), lda )
304 rowmax = cabs1( a( imax, jmax ) )
306 jmax =
izamax( 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
zswap( kp-1, a( 1, kk ), 1, a( 1, kp ), 1 )
338 CALL
zswap( 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
zsyr( uplo, k-1, -r1, a( 1, k ), 1, a, lda )
369 CALL
zscal( 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 +
izamax( n-k, a( k+1, k ), 1 )
448 colmax = cabs1( a( imax, k ) )
453 IF( max( absakk, colmax ).EQ.zero .OR.
disnan(absakk) )
THEN
461 IF( absakk.GE.alpha*colmax )
THEN
471 jmax = k - 1 +
izamax( imax-k, a( imax, k ), lda )
472 rowmax = cabs1( a( imax, jmax ) )
474 jmax = imax +
izamax( 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
zswap( n-kp, a( kp+1, kk ), 1, a( kp+1, kp ), 1 )
507 CALL
zswap( 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
zsyr( uplo, n-k, -r1, a( k+1, k ), 1,
537 $ a( k+1, k+1 ), lda )
541 CALL
zscal( 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