260 SUBROUTINE zlahef_rk( UPLO, N, NB, KB, A, LDA, E, IPIV, W, LDW,
269 INTEGER INFO, KB, LDA, LDW, N, NB
273 COMPLEX*16 A( LDA, * ), W( LDW, * ), E( * )
279 DOUBLE PRECISION ZERO, ONE
280 parameter( zero = 0.0d+0, one = 1.0d+0 )
282 parameter( cone = ( 1.0d+0, 0.0d+0 ) )
283 DOUBLE PRECISION EIGHT, SEVTEN
284 parameter( eight = 8.0d+0, sevten = 17.0d+0 )
286 parameter( czero = ( 0.0d+0, 0.0d+0 ) )
290 INTEGER IMAX, ITEMP, II, J, JB, JJ, JMAX, K, KK, KKW,
292 DOUBLE PRECISION ABSAKK, ALPHA, COLMAX, DTEMP, R1, ROWMAX, T,
294 COMPLEX*16 D11, D21, D22, Z
299 DOUBLE PRECISION DLAMCH
300 EXTERNAL lsame, izamax, dlamch
306 INTRINSIC abs, dble, dconjg, dimag, max, min, sqrt
309 DOUBLE PRECISION CABS1
312 cabs1( z ) = abs( dble( z ) ) + abs( dimag( z ) )
320 alpha = ( one+sqrt( sevten ) ) / eight
324 sfmin = dlamch(
'S' )
326 IF( lsame( uplo,
'U' ) )
THEN
347 IF( ( k.LE.n-nb+1 .AND. nb.LT.n ) .OR. k.LT.1 )
356 $
CALL zcopy( k-1, a( 1, k ), 1, w( 1, kw ), 1 )
357 w( k, kw ) = dble( a( k, k ) )
359 CALL zgemv(
'No transpose', k, n-k, -cone, a( 1, k+1 ), lda,
360 $ w( k, kw+1 ), ldw, cone, w( 1, kw ), 1 )
361 w( k, kw ) = dble( w( k, kw ) )
367 absakk = abs( dble( w( k, kw ) ) )
374 imax = izamax( k-1, w( 1, kw ), 1 )
375 colmax = cabs1( w( imax, kw ) )
380 IF( max( absakk, colmax ).EQ.zero )
THEN
387 a( k, k ) = dble( w( k, kw ) )
389 $
CALL zcopy( k-1, w( 1, kw ), 1, a( 1, k ), 1 )
405 IF( .NOT.( absakk.LT.alpha*colmax ) )
THEN
425 $
CALL zcopy( imax-1, a( 1, imax ), 1, w( 1, kw-1 ),
427 w( imax, kw-1 ) = dble( a( imax, imax ) )
429 CALL zcopy( k-imax, a( imax, imax+1 ), lda,
430 $ w( imax+1, kw-1 ), 1 )
431 CALL zlacgv( k-imax, w( imax+1, kw-1 ), 1 )
434 CALL zgemv(
'No transpose', k, n-k, -cone,
435 $ a( 1, k+1 ), lda, w( imax, kw+1 ), ldw,
436 $ cone, w( 1, kw-1 ), 1 )
437 w( imax, kw-1 ) = dble( w( imax, kw-1 ) )
445 jmax = imax + izamax( k-imax, w( imax+1, kw-1 ),
447 rowmax = cabs1( w( jmax, kw-1 ) )
453 itemp = izamax( imax-1, w( 1, kw-1 ), 1 )
454 dtemp = cabs1( w( itemp, kw-1 ) )
455 IF( dtemp.GT.rowmax )
THEN
466 IF( .NOT.( abs( dble( w( imax,kw-1 ) ) )
467 $ .LT.alpha*rowmax ) )
THEN
476 CALL zcopy( k, w( 1, kw-1 ), 1, w( 1, kw ), 1 )
484 ELSE IF( ( p.EQ.jmax ) .OR. ( rowmax.LE.colmax ) )
505 CALL zcopy( k, w( 1, kw-1 ), 1, w( 1, kw ), 1 )
512 IF( .NOT.done )
GOTO 12
531 IF( ( kstep.EQ.2 ) .AND. ( p.NE.k ) )
THEN
538 a( p, p ) = dble( a( k, k ) )
539 CALL zcopy( k-1-p, a( p+1, k ), 1, a( p, p+1 ),
541 CALL zlacgv( k-1-p, a( p, p+1 ), lda )
543 $
CALL zcopy( p-1, a( 1, k ), 1, a( 1, p ), 1 )
551 $
CALL zswap( n-k, a( k, k+1 ), lda, a( p, k+1 ),
553 CALL zswap( n-kk+1, w( k, kkw ), ldw, w( p, kkw ),
567 a( kp, kp ) = dble( a( kk, kk ) )
568 CALL zcopy( kk-1-kp, a( kp+1, kk ), 1, a( kp, kp+1 ),
570 CALL zlacgv( kk-1-kp, a( kp, kp+1 ), lda )
572 $
CALL zcopy( kp-1, a( 1, kk ), 1, a( 1, kp ), 1 )
580 $
CALL zswap( n-k, a( kk, k+1 ), lda, a( kp, k+1 ),
582 CALL zswap( n-kk+1, w( kk, kkw ), ldw, w( kp, kkw ),
586 IF( kstep.EQ.1 )
THEN
604 CALL zcopy( k, w( 1, kw ), 1, a( 1, k ), 1 )
613 t = dble( a( k, k ) )
614 IF( abs( t ).GE.sfmin )
THEN
616 CALL zdscal( k-1, r1, a( 1, k ), 1 )
619 a( ii, k ) = a( ii, k ) / t
625 CALL zlacgv( k-1, w( 1, kw ), 1 )
698 d11 = w( k, kw ) / dconjg( d21 )
699 d22 = w( k-1, kw-1 ) / d21
700 t = one / ( dble( d11*d22 )-one )
707 a( j, k-1 ) = t*( ( d11*w( j, kw-1 )-w( j, kw ) ) /
709 a( j, k ) = t*( ( d22*w( j, kw )-w( j, kw-1 ) ) /
718 a( k-1, k-1 ) = w( k-1, kw-1 )
720 a( k, k ) = w( k, kw )
721 e( k ) = w( k-1, kw )
726 CALL zlacgv( k-1, w( 1, kw ), 1 )
727 CALL zlacgv( k-2, w( 1, kw-1 ), 1 )
737 IF( kstep.EQ.1 )
THEN
758 DO 50 j = ( ( k-1 ) / nb )*nb + 1, 1, -nb
759 jb = min( nb, k-j+1 )
763 DO 40 jj = j, j + jb - 1
764 a( jj, jj ) = dble( a( jj, jj ) )
765 CALL zgemv(
'No transpose', jj-j+1, n-k, -cone,
766 $ a( j, k+1 ), lda, w( jj, kw+1 ), ldw, cone,
768 a( jj, jj ) = dble( a( jj, jj ) )
774 $
CALL zgemm(
'No transpose',
'Transpose', j-1, jb, n-k,
775 $ -cone, a( 1, k+1 ), lda, w( j, kw+1 ), ldw,
776 $ cone, a( 1, j ), lda )
800 IF( ( k.GE.nb .AND. nb.LT.n ) .OR. k.GT.n )
808 w( k, k ) = dble( a( k, k ) )
810 $
CALL zcopy( n-k, a( k+1, k ), 1, w( k+1, k ), 1 )
812 CALL zgemv(
'No transpose', n-k+1, k-1, -cone, a( k, 1 ),
813 $ lda, w( k, 1 ), ldw, cone, w( k, k ), 1 )
814 w( k, k ) = dble( w( k, k ) )
820 absakk = abs( dble( w( k, k ) ) )
827 imax = k + izamax( n-k, w( k+1, k ), 1 )
828 colmax = cabs1( w( imax, k ) )
833 IF( max( absakk, colmax ).EQ.zero )
THEN
840 a( k, k ) = dble( w( k, k ) )
842 $
CALL zcopy( n-k, w( k+1, k ), 1, a( k+1, k ), 1 )
859 IF( .NOT.( absakk.LT.alpha*colmax ) )
THEN
878 CALL zcopy( imax-k, a( imax, k ), lda, w( k, k+1 ), 1)
879 CALL zlacgv( imax-k, w( k, k+1 ), 1 )
880 w( imax, k+1 ) = dble( a( imax, imax ) )
883 $
CALL zcopy( n-imax, a( imax+1, imax ), 1,
884 $ w( imax+1, k+1 ), 1 )
887 CALL zgemv(
'No transpose', n-k+1, k-1, -cone,
888 $ a( k, 1 ), lda, w( imax, 1 ), ldw,
889 $ cone, w( k, k+1 ), 1 )
890 w( imax, k+1 ) = dble( w( imax, k+1 ) )
898 jmax = k - 1 + izamax( imax-k, w( k, k+1 ), 1 )
899 rowmax = cabs1( w( jmax, k+1 ) )
905 itemp = imax + izamax( n-imax, w( imax+1, k+1 ), 1)
906 dtemp = cabs1( w( itemp, k+1 ) )
907 IF( dtemp.GT.rowmax )
THEN
918 IF( .NOT.( abs( dble( w( imax,k+1 ) ) )
919 $ .LT.alpha*rowmax ) )
THEN
928 CALL zcopy( n-k+1, w( k, k+1 ), 1, w( k, k ), 1 )
936 ELSE IF( ( p.EQ.jmax ) .OR. ( rowmax.LE.colmax ) )
957 CALL zcopy( n-k+1, w( k, k+1 ), 1, w( k, k ), 1 )
964 IF( .NOT.done )
GOTO 72
979 IF( ( kstep.EQ.2 ) .AND. ( p.NE.k ) )
THEN
986 a( p, p ) = dble( a( k, k ) )
987 CALL zcopy( p-k-1, a( k+1, k ), 1, a( p, k+1 ), lda )
988 CALL zlacgv( p-k-1, a( p, k+1 ), lda )
990 $
CALL zcopy( n-p, a( p+1, k ), 1, a( p+1, p ), 1 )
998 $
CALL zswap( k-1, a( k, 1 ), lda, a( p, 1 ), lda )
999 CALL zswap( kk, w( k, 1 ), ldw, w( p, 1 ), ldw )
1012 a( kp, kp ) = dble( a( kk, kk ) )
1013 CALL zcopy( kp-kk-1, a( kk+1, kk ), 1, a( kp, kk+1 ),
1015 CALL zlacgv( kp-kk-1, a( kp, kk+1 ), lda )
1017 $
CALL zcopy( n-kp, a( kp+1, kk ), 1, a( kp+1, kp ), 1 )
1025 $
CALL zswap( k-1, a( kk, 1 ), lda, a( kp, 1 ), lda )
1026 CALL zswap( kk, w( kk, 1 ), ldw, w( kp, 1 ), ldw )
1029 IF( kstep.EQ.1 )
THEN
1047 CALL zcopy( n-k+1, w( k, k ), 1, a( k, k ), 1 )
1056 t = dble( a( k, k ) )
1057 IF( abs( t ).GE.sfmin )
THEN
1059 CALL zdscal( n-k, r1, a( k+1, k ), 1 )
1062 a( ii, k ) = a( ii, k ) / t
1068 CALL zlacgv( n-k, w( k+1, k ), 1 )
1141 d11 = w( k+1, k+1 ) / d21
1142 d22 = w( k, k ) / dconjg( d21 )
1143 t = one / ( dble( d11*d22 )-one )
1150 a( j, k ) = t*( ( d11*w( j, k )-w( j, k+1 ) ) /
1152 a( j, k+1 ) = t*( ( d22*w( j, k+1 )-w( j, k ) ) /
1161 a( k, k ) = w( k, k )
1163 a( k+1, k+1 ) = w( k+1, k+1 )
1164 e( k ) = w( k+1, k )
1169 CALL zlacgv( n-k, w( k+1, k ), 1 )
1170 CALL zlacgv( n-k-1, w( k+2, k+1 ), 1 )
1180 IF( kstep.EQ.1 )
THEN
1202 jb = min( nb, n-j+1 )
1206 DO 100 jj = j, j + jb - 1
1207 a( jj, jj ) = dble( a( jj, jj ) )
1208 CALL zgemv(
'No transpose', j+jb-jj, k-1, -cone,
1209 $ a( jj, 1 ), lda, w( jj, 1 ), ldw, cone,
1211 a( jj, jj ) = dble( a( jj, jj ) )
1217 $
CALL zgemm(
'No transpose',
'Transpose', n-j-jb+1, jb,
1218 $ k-1, -cone, a( j+jb, 1 ), lda, w( j, 1 ),
1219 $ ldw, cone, a( j+jb, j ), lda )
subroutine zcopy(n, zx, incx, zy, incy)
ZCOPY
subroutine zgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
ZGEMM
subroutine zgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
ZGEMV
subroutine zlacgv(n, x, incx)
ZLACGV conjugates a complex vector.
subroutine zlahef_rk(uplo, n, nb, kb, a, lda, e, ipiv, w, ldw, info)
ZLAHEF_RK computes a partial factorization of a complex Hermitian indefinite matrix using bounded Bun...
subroutine zdscal(n, da, zx, incx)
ZDSCAL
subroutine zswap(n, zx, incx, zy, incy)
ZSWAP