205 COMPLEX*16 A( LDA, * )
211 DOUBLE PRECISION ZERO, ONE
212 parameter( zero = 0.0d+0, one = 1.0d+0 )
213 DOUBLE PRECISION EIGHT, SEVTEN
214 parameter( eight = 8.0d+0, sevten = 17.0d+0 )
216 parameter( cone = ( 1.0d+0, 0.0d+0 ) )
220 INTEGER I, IMAX, J, JMAX, ITEMP, K, KK, KP, KSTEP,
222 DOUBLE PRECISION ABSAKK, ALPHA, COLMAX, ROWMAX, DTEMP, SFMIN
223 COMPLEX*16 D11, D12, D21, D22, T, WK, WKM1, WKP1, Z
228 DOUBLE PRECISION DLAMCH
229 EXTERNAL lsame, izamax, dlamch
235 INTRINSIC abs, max, sqrt, dimag, dble
238 DOUBLE PRECISION CABS1
241 cabs1( z ) = abs( dble( z ) ) + abs( dimag( z ) )
248 upper = lsame( uplo,
'U' )
249 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
251 ELSE IF( n.LT.0 )
THEN
253 ELSE IF( lda.LT.max( 1, n ) )
THEN
257 CALL xerbla(
'ZSYTF2_ROOK', -info )
263 alpha = ( one+sqrt( sevten ) ) / eight
267 sfmin = dlamch(
'S' )
289 absakk = cabs1( a( k, k ) )
296 imax = izamax( k-1, a( 1, k ), 1 )
297 colmax = cabs1( a( imax, k ) )
302 IF( (max( absakk, colmax ).EQ.zero) )
THEN
316 IF( .NOT.( absakk.LT.alpha*colmax ) )
THEN
337 jmax = imax + izamax( k-imax, a( imax, imax+1 ),
339 rowmax = cabs1( a( imax, jmax ) )
345 itemp = izamax( imax-1, a( 1, imax ), 1 )
346 dtemp = cabs1( a( itemp, imax ) )
347 IF( dtemp.GT.rowmax )
THEN
356 IF( .NOT.( cabs1(a( imax, imax )).LT.alpha*rowmax ) )
368 ELSE IF( ( p.EQ.jmax ).OR.( rowmax.LE.colmax ) )
THEN
387 IF( .NOT. done )
GOTO 12
395 IF( ( kstep.EQ.2 ) .AND. ( p.NE.k ) )
THEN
401 $
CALL zswap( p-1, a( 1, k ), 1, a( 1, p ), 1 )
403 $
CALL zswap( k-p-1, a( p+1, k ), 1, a( p, p+1 ),
406 a( k, k ) = a( p, p )
419 $
CALL zswap( kp-1, a( 1, kk ), 1, a( 1, kp ), 1 )
420 IF( ( kk.GT.1 ) .AND. ( kp.LT.(kk-1) ) )
421 $
CALL zswap( kk-kp-1, a( kp+1, kk ), 1, a( kp, kp+1 ),
424 a( kk, kk ) = a( kp, kp )
426 IF( kstep.EQ.2 )
THEN
428 a( k-1, k ) = a( kp, k )
435 IF( kstep.EQ.1 )
THEN
448 IF( cabs1( a( k, k ) ).GE.sfmin )
THEN
454 d11 = cone / a( k, k )
455 CALL zsyr( uplo, k-1, -d11, a( 1, k ), 1, a, lda )
459 CALL zscal( k-1, d11, a( 1, k ), 1 )
466 a( ii, k ) = a( ii, k ) / d11
474 CALL zsyr( uplo, k-1, -d11, a( 1, k ), 1, a, lda )
497 d22 = a( k-1, k-1 ) / d12
498 d11 = a( k, k ) / d12
499 t = cone / ( d11*d22-cone )
501 DO 30 j = k - 2, 1, -1
503 wkm1 = t*( d11*a( j, k-1 )-a( j, k ) )
504 wk = t*( d22*a( j, k )-a( j, k-1 ) )
507 a( i, j ) = a( i, j ) - (a( i, k ) / d12 )*wk -
508 $ ( a( i, k-1 ) / d12 )*wkm1
514 a( j, k-1 ) = wkm1 / d12
525 IF( kstep.EQ.1 )
THEN
557 absakk = cabs1( a( k, k ) )
564 imax = k + izamax( n-k, a( k+1, k ), 1 )
565 colmax = cabs1( a( imax, k ) )
570 IF( ( max( absakk, colmax ).EQ.zero ) )
THEN
584 IF( .NOT.( absakk.LT.alpha*colmax ) )
THEN
604 jmax = k - 1 + izamax( imax-k, a( imax, k ), lda )
605 rowmax = cabs1( a( imax, jmax ) )
611 itemp = imax + izamax( n-imax, a( imax+1, imax ),
613 dtemp = cabs1( a( itemp, imax ) )
614 IF( dtemp.GT.rowmax )
THEN
623 IF( .NOT.( cabs1(a( imax, imax )).LT.alpha*rowmax ) )
635 ELSE IF( ( p.EQ.jmax ).OR.( rowmax.LE.colmax ) )
THEN
654 IF( .NOT. done )
GOTO 42
662 IF( ( kstep.EQ.2 ) .AND. ( p.NE.k ) )
THEN
668 $
CALL zswap( n-p, a( p+1, k ), 1, a( p+1, p ), 1 )
670 $
CALL zswap( p-k-1, a( k+1, k ), 1, a( p, k+1 ), lda )
672 a( k, k ) = a( p, p )
685 $
CALL zswap( n-kp, a( kp+1, kk ), 1, a( kp+1, kp ), 1 )
686 IF( ( kk.LT.n ) .AND. ( kp.GT.(kk+1) ) )
687 $
CALL zswap( kp-kk-1, a( kk+1, kk ), 1, a( kp, kk+1 ),
690 a( kk, kk ) = a( kp, kp )
692 IF( kstep.EQ.2 )
THEN
694 a( k+1, k ) = a( kp, k )
701 IF( kstep.EQ.1 )
THEN
714 IF( cabs1( a( k, k ) ).GE.sfmin )
THEN
720 d11 = cone / a( k, k )
721 CALL zsyr( uplo, n-k, -d11, a( k+1, k ), 1,
722 $ a( k+1, k+1 ), lda )
726 CALL zscal( n-k, d11, a( k+1, k ), 1 )
733 a( ii, k ) = a( ii, k ) / d11
741 CALL zsyr( uplo, n-k, -d11, a( k+1, k ), 1,
742 $ a( k+1, k+1 ), lda )
766 d11 = a( k+1, k+1 ) / d21
767 d22 = a( k, k ) / d21
768 t = cone / ( d11*d22-cone )
774 wk = t*( d11*a( j, k )-a( j, k+1 ) )
775 wkp1 = t*( d22*a( j, k+1 )-a( j, k ) )
780 a( i, j ) = a( i, j ) - ( a( i, k ) / d21 )*wk -
781 $ ( a( i, k+1 ) / d21 )*wkp1
787 a( j, k+1 ) = wkp1 / d21
798 IF( kstep.EQ.1 )
THEN
subroutine xerbla(srname, info)
subroutine zsyr(uplo, n, alpha, x, incx, a, lda)
ZSYR performs the symmetric rank-1 update of a complex symmetric matrix.
subroutine zsytf2_rook(uplo, n, a, lda, ipiv, info)
ZSYTF2_ROOK computes the factorization of a complex symmetric indefinite matrix using the bounded Bun...
subroutine zscal(n, za, zx, incx)
ZSCAL
subroutine zswap(n, zx, incx, zy, incy)
ZSWAP