191 INTEGER INFO, KB, LDA, LDW, N, NB
195 COMPLEX*16 A( LDA, * ), W( LDW, * )
201 DOUBLE PRECISION ZERO, ONE
202 parameter( zero = 0.0d+0, one = 1.0d+0 )
204 parameter( cone = ( 1.0d+0, 0.0d+0 ) )
205 DOUBLE PRECISION EIGHT, SEVTEN
206 parameter( eight = 8.0d+0, sevten = 17.0d+0 )
210 INTEGER IMAX, ITEMP, II, J, JB, JJ, JMAX, JP1, JP2, K,
211 $ kk, kkw, kp, kstep, kw, p
212 DOUBLE PRECISION ABSAKK, ALPHA, COLMAX, DTEMP, R1, ROWMAX, T,
214 COMPLEX*16 D11, D21, D22, Z
219 DOUBLE PRECISION DLAMCH
220 EXTERNAL lsame, izamax, dlamch
226 INTRINSIC abs, dble, dconjg, dimag, max, min, sqrt
229 DOUBLE PRECISION CABS1
232 cabs1( z ) = abs( dble( z ) ) + abs( dimag( z ) )
240 alpha = ( one+sqrt( sevten ) ) / eight
244 sfmin = dlamch(
'S' )
246 IF( lsame( uplo,
'U' ) )
THEN
263 IF( ( k.LE.n-nb+1 .AND. nb.LT.n ) .OR. k.LT.1 )
272 $
CALL zcopy( k-1, a( 1, k ), 1, w( 1, kw ), 1 )
273 w( k, kw ) = dble( a( k, k ) )
275 CALL zgemv(
'No transpose', k, n-k, -cone, a( 1, k+1 ), lda,
276 $ w( k, kw+1 ), ldw, cone, w( 1, kw ), 1 )
277 w( k, kw ) = dble( w( k, kw ) )
283 absakk = abs( dble( w( k, kw ) ) )
290 imax = izamax( k-1, w( 1, kw ), 1 )
291 colmax = cabs1( w( imax, kw ) )
296 IF( max( absakk, colmax ).EQ.zero )
THEN
303 a( k, k ) = dble( w( k, kw ) )
305 $
CALL zcopy( k-1, w( 1, kw ), 1, a( 1, k ), 1 )
315 IF( .NOT.( absakk.LT.alpha*colmax ) )
THEN
335 $
CALL zcopy( imax-1, a( 1, imax ), 1, w( 1, kw-1 ),
337 w( imax, kw-1 ) = dble( a( imax, imax ) )
339 CALL zcopy( k-imax, a( imax, imax+1 ), lda,
340 $ w( imax+1, kw-1 ), 1 )
341 CALL zlacgv( k-imax, w( imax+1, kw-1 ), 1 )
344 CALL zgemv(
'No transpose', k, n-k, -cone,
345 $ a( 1, k+1 ), lda, w( imax, kw+1 ), ldw,
346 $ cone, w( 1, kw-1 ), 1 )
347 w( imax, kw-1 ) = dble( w( imax, kw-1 ) )
355 jmax = imax + izamax( k-imax, w( imax+1, kw-1 ),
357 rowmax = cabs1( w( jmax, kw-1 ) )
363 itemp = izamax( imax-1, w( 1, kw-1 ), 1 )
364 dtemp = cabs1( w( itemp, kw-1 ) )
365 IF( dtemp.GT.rowmax )
THEN
376 IF( .NOT.( abs( dble( w( imax,kw-1 ) ) )
377 $ .LT.alpha*rowmax ) )
THEN
386 CALL zcopy( k, w( 1, kw-1 ), 1, w( 1, kw ), 1 )
394 ELSE IF( ( p.EQ.jmax ) .OR. ( rowmax.LE.colmax ) )
415 CALL zcopy( k, w( 1, kw-1 ), 1, w( 1, kw ), 1 )
422 IF( .NOT.done )
GOTO 12
441 IF( ( kstep.EQ.2 ) .AND. ( p.NE.k ) )
THEN
448 a( p, p ) = dble( a( k, k ) )
449 CALL zcopy( k-1-p, a( p+1, k ), 1, a( p, p+1 ),
451 CALL zlacgv( k-1-p, a( p, p+1 ), lda )
453 $
CALL zcopy( p-1, a( 1, k ), 1, a( 1, p ), 1 )
461 $
CALL zswap( n-k, a( k, k+1 ), lda, a( p, k+1 ),
463 CALL zswap( n-kk+1, w( k, kkw ), ldw, w( p, kkw ),
477 a( kp, kp ) = dble( a( kk, kk ) )
478 CALL zcopy( kk-1-kp, a( kp+1, kk ), 1, a( kp, kp+1 ),
480 CALL zlacgv( kk-1-kp, a( kp, kp+1 ), lda )
482 $
CALL zcopy( kp-1, a( 1, kk ), 1, a( 1, kp ), 1 )
490 $
CALL zswap( n-k, a( kk, k+1 ), lda, a( kp, k+1 ),
492 CALL zswap( n-kk+1, w( kk, kkw ), ldw, w( kp, kkw ),
496 IF( kstep.EQ.1 )
THEN
514 CALL zcopy( k, w( 1, kw ), 1, a( 1, k ), 1 )
523 t = dble( a( k, k ) )
524 IF( abs( t ).GE.sfmin )
THEN
526 CALL zdscal( k-1, r1, a( 1, k ), 1 )
529 a( ii, k ) = a( ii, k ) / t
535 CALL zlacgv( k-1, w( 1, kw ), 1 )
603 d11 = w( k, kw ) / dconjg( d21 )
604 d22 = w( k-1, kw-1 ) / d21
605 t = one / ( dble( d11*d22 )-one )
612 a( j, k-1 ) = t*( ( d11*w( j, kw-1 )-w( j, kw ) ) /
614 a( j, k ) = t*( ( d22*w( j, kw )-w( j, kw-1 ) ) /
621 a( k-1, k-1 ) = w( k-1, kw-1 )
622 a( k-1, k ) = w( k-1, kw )
623 a( k, k ) = w( k, kw )
627 CALL zlacgv( k-1, w( 1, kw ), 1 )
628 CALL zlacgv( k-2, w( 1, kw-1 ), 1 )
636 IF( kstep.EQ.1 )
THEN
657 DO 50 j = ( ( k-1 ) / nb )*nb + 1, 1, -nb
658 jb = min( nb, k-j+1 )
662 DO 40 jj = j, j + jb - 1
663 a( jj, jj ) = dble( a( jj, jj ) )
664 CALL zgemv(
'No transpose', jj-j+1, n-k, -cone,
665 $ a( j, k+1 ), lda, w( jj, kw+1 ), ldw, cone,
667 a( jj, jj ) = dble( a( jj, jj ) )
673 $
CALL zgemm(
'No transpose',
'Transpose', j-1, jb, n-k,
674 $ -cone, a( 1, k+1 ), lda, w( j, kw+1 ), ldw,
675 $ cone, a( 1, j ), lda )
702 IF( jp2.NE.jj .AND. j.LE.n )
703 $
CALL zswap( n-j+1, a( jp2, j ), lda, a( jj, j ), lda )
705 IF( kstep.EQ.2 .AND. jp1.NE.jj .AND. j.LE.n )
706 $
CALL zswap( n-j+1, a( jp1, j ), lda, a( jj, j ), lda )
727 IF( ( k.GE.nb .AND. nb.LT.n ) .OR. k.GT.n )
735 w( k, k ) = dble( a( k, k ) )
737 $
CALL zcopy( n-k, a( k+1, k ), 1, w( k+1, k ), 1 )
739 CALL zgemv(
'No transpose', n-k+1, k-1, -cone, a( k, 1 ),
740 $ lda, w( k, 1 ), ldw, cone, w( k, k ), 1 )
741 w( k, k ) = dble( w( k, k ) )
747 absakk = abs( dble( w( k, k ) ) )
754 imax = k + izamax( n-k, w( k+1, k ), 1 )
755 colmax = cabs1( w( imax, k ) )
760 IF( max( absakk, colmax ).EQ.zero )
THEN
767 a( k, k ) = dble( w( k, k ) )
769 $
CALL zcopy( n-k, w( k+1, k ), 1, a( k+1, k ), 1 )
780 IF( .NOT.( absakk.LT.alpha*colmax ) )
THEN
799 CALL zcopy( imax-k, a( imax, k ), lda, w( k, k+1 ), 1)
800 CALL zlacgv( imax-k, w( k, k+1 ), 1 )
801 w( imax, k+1 ) = dble( a( imax, imax ) )
804 $
CALL zcopy( n-imax, a( imax+1, imax ), 1,
805 $ w( imax+1, k+1 ), 1 )
808 CALL zgemv(
'No transpose', n-k+1, k-1, -cone,
809 $ a( k, 1 ), lda, w( imax, 1 ), ldw,
810 $ cone, w( k, k+1 ), 1 )
811 w( imax, k+1 ) = dble( w( imax, k+1 ) )
819 jmax = k - 1 + izamax( imax-k, w( k, k+1 ), 1 )
820 rowmax = cabs1( w( jmax, k+1 ) )
826 itemp = imax + izamax( n-imax, w( imax+1, k+1 ), 1)
827 dtemp = cabs1( w( itemp, k+1 ) )
828 IF( dtemp.GT.rowmax )
THEN
839 IF( .NOT.( abs( dble( w( imax,k+1 ) ) )
840 $ .LT.alpha*rowmax ) )
THEN
849 CALL zcopy( n-k+1, w( k, k+1 ), 1, w( k, k ), 1 )
857 ELSE IF( ( p.EQ.jmax ) .OR. ( rowmax.LE.colmax ) )
878 CALL zcopy( n-k+1, w( k, k+1 ), 1, w( k, k ), 1 )
885 IF( .NOT.done )
GOTO 72
900 IF( ( kstep.EQ.2 ) .AND. ( p.NE.k ) )
THEN
907 a( p, p ) = dble( a( k, k ) )
908 CALL zcopy( p-k-1, a( k+1, k ), 1, a( p, k+1 ), lda )
909 CALL zlacgv( p-k-1, a( p, k+1 ), lda )
911 $
CALL zcopy( n-p, a( p+1, k ), 1, a( p+1, p ), 1 )
919 $
CALL zswap( k-1, a( k, 1 ), lda, a( p, 1 ), lda )
920 CALL zswap( kk, w( k, 1 ), ldw, w( p, 1 ), ldw )
933 a( kp, kp ) = dble( a( kk, kk ) )
934 CALL zcopy( kp-kk-1, a( kk+1, kk ), 1, a( kp, kk+1 ),
936 CALL zlacgv( kp-kk-1, a( kp, kk+1 ), lda )
938 $
CALL zcopy( n-kp, a( kp+1, kk ), 1, a( kp+1, kp ), 1 )
946 $
CALL zswap( k-1, a( kk, 1 ), lda, a( kp, 1 ), lda )
947 CALL zswap( kk, w( kk, 1 ), ldw, w( kp, 1 ), ldw )
950 IF( kstep.EQ.1 )
THEN
968 CALL zcopy( n-k+1, w( k, k ), 1, a( k, k ), 1 )
977 t = dble( a( k, k ) )
978 IF( abs( t ).GE.sfmin )
THEN
980 CALL zdscal( n-k, r1, a( k+1, k ), 1 )
983 a( ii, k ) = a( ii, k ) / t
989 CALL zlacgv( n-k, w( k+1, k ), 1 )
1057 d11 = w( k+1, k+1 ) / d21
1058 d22 = w( k, k ) / dconjg( d21 )
1059 t = one / ( dble( d11*d22 )-one )
1066 a( j, k ) = t*( ( d11*w( j, k )-w( j, k+1 ) ) /
1068 a( j, k+1 ) = t*( ( d22*w( j, k+1 )-w( j, k ) ) /
1075 a( k, k ) = w( k, k )
1076 a( k+1, k ) = w( k+1, k )
1077 a( k+1, k+1 ) = w( k+1, k+1 )
1081 CALL zlacgv( n-k, w( k+1, k ), 1 )
1082 CALL zlacgv( n-k-1, w( k+2, k+1 ), 1 )
1090 IF( kstep.EQ.1 )
THEN
1112 jb = min( nb, n-j+1 )
1116 DO 100 jj = j, j + jb - 1
1117 a( jj, jj ) = dble( a( jj, jj ) )
1118 CALL zgemv(
'No transpose', j+jb-jj, k-1, -cone,
1119 $ a( jj, 1 ), lda, w( jj, 1 ), ldw, cone,
1121 a( jj, jj ) = dble( a( jj, jj ) )
1127 $
CALL zgemm(
'No transpose',
'Transpose', n-j-jb+1, jb,
1128 $ k-1, -cone, a( j+jb, 1 ), lda, w( j, 1 ),
1129 $ ldw, cone, a( j+jb, j ), lda )
1156 IF( jp2.NE.jj .AND. j.GE.1 )
1157 $
CALL zswap( j, a( jp2, 1 ), lda, a( jj, 1 ), lda )
1159 IF( kstep.EQ.2 .AND. jp1.NE.jj .AND. j.GE.1 )
1160 $
CALL zswap( j, a( jp1, 1 ), lda, a( jj, 1 ), 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_rook(uplo, n, nb, kb, a, lda, ipiv, w, ldw, info)
Download ZLAHEF_ROOK + dependencies <a href="http://www.netlib.org/cgi-bin/netlibfiles....
subroutine zdscal(n, da, zx, incx)
ZDSCAL
subroutine zswap(n, zx, incx, zy, incy)
ZSWAP