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 )
203 DOUBLE PRECISION EIGHT, SEVTEN
204 parameter( eight = 8.0d+0, sevten = 17.0d+0 )
205 COMPLEX*16 CONE, CZERO
206 parameter( cone = ( 1.0d+0, 0.0d+0 ),
207 $ czero = ( 0.0d+0, 0.0d+0 ) )
211 INTEGER IMAX, ITEMP, J, JB, JJ, JMAX, JP1, JP2, K, KK,
212 $ kw, kkw, kp, kstep, p, ii
213 DOUBLE PRECISION ABSAKK, ALPHA, COLMAX, ROWMAX, DTEMP, SFMIN
214 COMPLEX*16 D11, D12, D21, D22, R1, T, Z
219 DOUBLE PRECISION DLAMCH
220 EXTERNAL lsame, izamax, dlamch
226 INTRINSIC abs, max, min, sqrt, dimag, dble
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 )
271 CALL zcopy( k, a( 1, k ), 1, w( 1, kw ), 1 )
273 $
CALL zgemv(
'No transpose', k, n-k, -cone, a( 1, k+1 ),
274 $ lda, w( k, kw+1 ), ldw, cone, w( 1, kw ), 1 )
279 absakk = cabs1( w( k, kw ) )
286 imax = izamax( k-1, w( 1, kw ), 1 )
287 colmax = cabs1( w( imax, kw ) )
292 IF( max( absakk, colmax ).EQ.zero )
THEN
299 CALL zcopy( k, w( 1, kw ), 1, a( 1, k ), 1 )
309 IF( .NOT.( absakk.LT.alpha*colmax ) )
THEN
328 CALL zcopy( imax, a( 1, imax ), 1, w( 1, kw-1 ), 1 )
329 CALL zcopy( k-imax, a( imax, imax+1 ), lda,
330 $ w( imax+1, kw-1 ), 1 )
333 $
CALL zgemv(
'No transpose', k, n-k, -cone,
334 $ a( 1, k+1 ), lda, w( imax, kw+1 ), ldw,
335 $ cone, w( 1, kw-1 ), 1 )
342 jmax = imax + izamax( k-imax, w( imax+1, kw-1 ),
344 rowmax = cabs1( w( jmax, kw-1 ) )
350 itemp = izamax( imax-1, w( 1, kw-1 ), 1 )
351 dtemp = cabs1( w( itemp, kw-1 ) )
352 IF( dtemp.GT.rowmax )
THEN
362 IF( .NOT.(cabs1( w( imax, kw-1 ) ).LT.alpha*rowmax ) )
372 CALL zcopy( k, w( 1, kw-1 ), 1, w( 1, kw ), 1 )
379 ELSE IF( ( p.EQ.jmax ) .OR. ( rowmax.LE.colmax ) )
398 CALL zcopy( k, w( 1, kw-1 ), 1, w( 1, kw ), 1 )
404 IF( .NOT. done )
GOTO 12
416 IF( ( kstep.EQ.2 ) .AND. ( p.NE.k ) )
THEN
420 CALL zcopy( k-p, a( p+1, k ), 1, a( p, p+1 ), lda )
421 CALL zcopy( p, a( 1, k ), 1, a( 1, p ), 1 )
426 CALL zswap( n-k+1, a( k, k ), lda, a( p, k ), lda )
427 CALL zswap( n-kk+1, w( k, kkw ), ldw, w( p, kkw ), ldw )
436 a( kp, k ) = a( kk, k )
437 CALL zcopy( k-1-kp, a( kp+1, kk ), 1, a( kp, kp+1 ),
439 CALL zcopy( kp, a( 1, kk ), 1, a( 1, kp ), 1 )
444 CALL zswap( n-kk+1, a( kk, kk ), lda, a( kp, kk ), lda )
445 CALL zswap( n-kk+1, w( kk, kkw ), ldw, w( kp, kkw ),
449 IF( kstep.EQ.1 )
THEN
459 CALL zcopy( k, w( 1, kw ), 1, a( 1, k ), 1 )
461 IF( cabs1( a( k, k ) ).GE.sfmin )
THEN
462 r1 = cone / a( k, k )
463 CALL zscal( k-1, r1, a( 1, k ), 1 )
464 ELSE IF( a( k, k ).NE.czero )
THEN
466 a( ii, k ) = a( ii, k ) / a( k, k )
486 d11 = w( k, kw ) / d12
487 d22 = w( k-1, kw-1 ) / d12
488 t = cone / ( d11*d22-cone )
490 a( j, k-1 ) = t*( (d11*w( j, kw-1 )-w( j, kw ) ) /
492 a( j, k ) = t*( ( d22*w( j, kw )-w( j, kw-1 ) ) /
499 a( k-1, k-1 ) = w( k-1, kw-1 )
500 a( k-1, k ) = w( k-1, kw )
501 a( k, k ) = w( k, kw )
507 IF( kstep.EQ.1 )
THEN
527 DO 50 j = ( ( k-1 ) / nb )*nb + 1, 1, -nb
528 jb = min( nb, k-j+1 )
532 DO 40 jj = j, j + jb - 1
533 CALL zgemv(
'No transpose', jj-j+1, n-k, -cone,
534 $ a( j, k+1 ), lda, w( jj, kw+1 ), ldw, cone,
541 $
CALL zgemm(
'No transpose',
'Transpose', j-1, jb,
542 $ n-k, -cone, a( 1, k+1 ), lda, w( j, kw+1 ), ldw,
543 $ cone, a( 1, j ), lda )
564 IF( jp2.NE.jj .AND. j.LE.n )
565 $
CALL zswap( n-j+1, a( jp2, j ), lda, a( jj, j ), lda )
567 IF( jp1.NE.jj .AND. kstep.EQ.2 )
568 $
CALL zswap( n-j+1, a( jp1, j ), lda, a( jj, j ), lda )
589 IF( ( k.GE.nb .AND. nb.LT.n ) .OR. k.GT.n )
597 CALL zcopy( n-k+1, a( k, k ), 1, w( k, k ), 1 )
599 $
CALL zgemv(
'No transpose', n-k+1, k-1, -cone, a( k, 1 ),
600 $ lda, w( k, 1 ), ldw, cone, w( k, k ), 1 )
605 absakk = cabs1( w( k, k ) )
612 imax = k + izamax( n-k, w( k+1, k ), 1 )
613 colmax = cabs1( w( imax, k ) )
618 IF( max( absakk, colmax ).EQ.zero )
THEN
625 CALL zcopy( n-k+1, w( k, k ), 1, a( k, k ), 1 )
635 IF( .NOT.( absakk.LT.alpha*colmax ) )
THEN
654 CALL zcopy( imax-k, a( imax, k ), lda, w( k, k+1 ), 1)
655 CALL zcopy( n-imax+1, a( imax, imax ), 1,
656 $ w( imax, k+1 ), 1 )
658 $
CALL zgemv(
'No transpose', n-k+1, k-1, -cone,
659 $ a( k, 1 ), lda, w( imax, 1 ), ldw,
660 $ cone, w( k, k+1 ), 1 )
667 jmax = k - 1 + izamax( imax-k, w( k, k+1 ), 1 )
668 rowmax = cabs1( w( jmax, k+1 ) )
674 itemp = imax + izamax( n-imax, w( imax+1, k+1 ), 1)
675 dtemp = cabs1( w( itemp, k+1 ) )
676 IF( dtemp.GT.rowmax )
THEN
686 IF( .NOT.( cabs1( w( imax, k+1 ) ).LT.alpha*rowmax ) )
696 CALL zcopy( n-k+1, w( k, k+1 ), 1, w( k, k ), 1 )
703 ELSE IF( ( p.EQ.jmax ) .OR. ( rowmax.LE.colmax ) )
722 CALL zcopy( n-k+1, w( k, k+1 ), 1, w( k, k ), 1 )
728 IF( .NOT. done )
GOTO 72
736 IF( ( kstep.EQ.2 ) .AND. ( p.NE.k ) )
THEN
740 CALL zcopy( p-k, a( k, k ), 1, a( p, k ), lda )
741 CALL zcopy( n-p+1, a( p, k ), 1, a( p, p ), 1 )
746 CALL zswap( k, a( k, 1 ), lda, a( p, 1 ), lda )
747 CALL zswap( kk, w( k, 1 ), ldw, w( p, 1 ), ldw )
756 a( kp, k ) = a( kk, k )
757 CALL zcopy( kp-k-1, a( k+1, kk ), 1, a( kp, k+1 ), lda )
758 CALL zcopy( n-kp+1, a( kp, kk ), 1, a( kp, kp ), 1 )
762 CALL zswap( kk, a( kk, 1 ), lda, a( kp, 1 ), lda )
763 CALL zswap( kk, w( kk, 1 ), ldw, w( kp, 1 ), ldw )
766 IF( kstep.EQ.1 )
THEN
776 CALL zcopy( n-k+1, w( k, k ), 1, a( k, k ), 1 )
778 IF( cabs1( a( k, k ) ).GE.sfmin )
THEN
779 r1 = cone / a( k, k )
780 CALL zscal( n-k, r1, a( k+1, k ), 1 )
781 ELSE IF( a( k, k ).NE.czero )
THEN
783 a( ii, k ) = a( ii, k ) / a( k, k )
802 d11 = w( k+1, k+1 ) / d21
803 d22 = w( k, k ) / d21
804 t = cone / ( d11*d22-cone )
806 a( j, k ) = t*( ( d11*w( j, k )-w( j, k+1 ) ) /
808 a( j, k+1 ) = t*( ( d22*w( j, k+1 )-w( j, k ) ) /
815 a( k, k ) = w( k, k )
816 a( k+1, k ) = w( k+1, k )
817 a( k+1, k+1 ) = w( k+1, k+1 )
823 IF( kstep.EQ.1 )
THEN
844 jb = min( nb, n-j+1 )
848 DO 100 jj = j, j + jb - 1
849 CALL zgemv(
'No transpose', j+jb-jj, k-1, -cone,
850 $ a( jj, 1 ), lda, w( jj, 1 ), ldw, cone,
857 $
CALL zgemm(
'No transpose',
'Transpose', n-j-jb+1, jb,
858 $ k-1, -cone, a( j+jb, 1 ), lda, w( j, 1 ), ldw,
859 $ cone, a( j+jb, j ), lda )
880 IF( jp2.NE.jj .AND. j.GE.1 )
881 $
CALL zswap( j, a( jp2, 1 ), lda, a( jj, 1 ), lda )
883 IF( jp1.NE.jj .AND. kstep.EQ.2 )
884 $
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 zlasyf_rook(uplo, n, nb, kb, a, lda, ipiv, w, ldw, info)
ZLASYF_ROOK computes a partial factorization of a complex symmetric matrix using the bounded Bunch-Ka...
subroutine zscal(n, za, zx, incx)
ZSCAL
subroutine zswap(n, zx, incx, zy, incy)
ZSWAP