212 parameter( zero = 0.0e+0, one = 1.0e+0 )
214 parameter( eight = 8.0e+0, sevten = 17.0e+0 )
216 parameter( cone = ( 1.0e+0, 0.0e+0 ) )
220 INTEGER I, IMAX, J, JMAX, ITEMP, K, KK, KP, KSTEP,
222 REAL ABSAKK, ALPHA, COLMAX, ROWMAX, STEMP, SFMIN
223 COMPLEX D11, D12, D21, D22, T, WK, WKM1, WKP1, Z
229 EXTERNAL lsame, icamax, slamch
235 INTRINSIC abs, max, sqrt, aimag, real
241 cabs1( z ) = abs( real( z ) ) + abs( aimag( 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(
'CSYTF2_ROOK', -info )
263 alpha = ( one+sqrt( sevten ) ) / eight
267 sfmin = slamch(
'S' )
289 absakk = cabs1( a( k, k ) )
296 imax = icamax( 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 + icamax( k-imax, a( imax, imax+1 ),
339 rowmax = cabs1( a( imax, jmax ) )
345 itemp = icamax( imax-1, a( 1, imax ), 1 )
346 stemp = cabs1( a( itemp, imax ) )
347 IF( stemp.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 cswap( p-1, a( 1, k ), 1, a( 1, p ), 1 )
403 $
CALL cswap( k-p-1, a( p+1, k ), 1, a( p, p+1 ),
406 a( k, k ) = a( p, p )
419 $
CALL cswap( kp-1, a( 1, kk ), 1, a( 1, kp ), 1 )
420 IF( ( kk.GT.1 ) .AND. ( kp.LT.(kk-1) ) )
421 $
CALL cswap( 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 csyr( uplo, k-1, -d11, a( 1, k ), 1, a, lda )
459 CALL cscal( k-1, d11, a( 1, k ), 1 )
466 a( ii, k ) = a( ii, k ) / d11
474 CALL csyr( 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 + icamax( 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 + icamax( imax-k, a( imax, k ), lda )
605 rowmax = cabs1( a( imax, jmax ) )
611 itemp = imax + icamax( n-imax, a( imax+1, imax ),
613 stemp = cabs1( a( itemp, imax ) )
614 IF( stemp.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 cswap( n-p, a( p+1, k ), 1, a( p+1, p ), 1 )
670 $
CALL cswap( p-k-1, a( k+1, k ), 1, a( p, k+1 ), lda )
672 a( k, k ) = a( p, p )
685 $
CALL cswap( n-kp, a( kp+1, kk ), 1, a( kp+1, kp ), 1 )
686 IF( ( kk.LT.n ) .AND. ( kp.GT.(kk+1) ) )
687 $
CALL cswap( 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 csyr( uplo, n-k, -d11, a( k+1, k ), 1,
722 $ a( k+1, k+1 ), lda )
726 CALL cscal( n-k, d11, a( k+1, k ), 1 )
733 a( ii, k ) = a( ii, k ) / d11
741 CALL csyr( 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 csyr(uplo, n, alpha, x, incx, a, lda)
CSYR performs the symmetric rank-1 update of a complex symmetric matrix.
subroutine csytf2_rook(uplo, n, a, lda, ipiv, info)
CSYTF2_ROOK computes the factorization of a complex symmetric indefinite matrix using the bounded Bun...
subroutine cscal(n, ca, cx, incx)
CSCAL
subroutine cswap(n, cx, incx, cy, incy)
CSWAP