176 SUBROUTINE zlasyf( UPLO, N, NB, KB, A, LDA, IPIV, W, LDW, INFO )
184 INTEGER INFO, KB, LDA, LDW, N, NB
188 COMPLEX*16 A( LDA, * ), W( LDW, * )
194 DOUBLE PRECISION ZERO, ONE
195 parameter( zero = 0.0d+0, one = 1.0d+0 )
196 DOUBLE PRECISION EIGHT, SEVTEN
197 parameter( eight = 8.0d+0, sevten = 17.0d+0 )
199 parameter( cone = ( 1.0d+0, 0.0d+0 ) )
202 INTEGER IMAX, J, JB, JJ, JMAX, JP, K, KK, KKW, KP,
204 DOUBLE PRECISION ABSAKK, ALPHA, COLMAX, ROWMAX
205 COMPLEX*16 D11, D21, D22, R1, T, Z
210 EXTERNAL lsame, izamax
216 INTRINSIC abs, dble, dimag, max, min, sqrt
219 DOUBLE PRECISION CABS1
222 cabs1( z ) = abs( dble( z ) ) + abs( dimag( z ) )
230 alpha = ( one+sqrt( sevten ) ) / eight
232 IF( lsame( uplo,
'U' ) )
THEN
248 IF( ( k.LE.n-nb+1 .AND. nb.LT.n ) .OR. k.LT.1 )
253 CALL zcopy( k, a( 1, k ), 1, w( 1, kw ), 1 )
255 $
CALL zgemv(
'No transpose', k, n-k, -cone, a( 1, k+1 ), lda,
256 $ w( k, kw+1 ), ldw, cone, w( 1, kw ), 1 )
263 absakk = cabs1( w( k, kw ) )
269 imax = izamax( k-1, w( 1, kw ), 1 )
270 colmax = cabs1( w( imax, kw ) )
275 IF( max( absakk, colmax ).EQ.zero )
THEN
283 IF( absakk.GE.alpha*colmax )
THEN
292 CALL zcopy( imax, a( 1, imax ), 1, w( 1, kw-1 ), 1 )
293 CALL zcopy( k-imax, a( imax, imax+1 ), lda,
294 $ w( imax+1, kw-1 ), 1 )
296 $
CALL zgemv(
'No transpose', k, n-k, -cone,
297 $ a( 1, k+1 ), lda, w( imax, kw+1 ), ldw,
298 $ cone, w( 1, kw-1 ), 1 )
303 jmax = imax + izamax( k-imax, w( imax+1, kw-1 ), 1 )
304 rowmax = cabs1( w( jmax, kw-1 ) )
306 jmax = izamax( imax-1, w( 1, kw-1 ), 1 )
307 rowmax = max( rowmax, cabs1( w( jmax, kw-1 ) ) )
310 IF( absakk.GE.alpha*colmax*( colmax / rowmax ) )
THEN
315 ELSE IF( cabs1( w( imax, kw-1 ) ).GE.alpha*rowmax )
THEN
324 CALL zcopy( k, w( 1, kw-1 ), 1, w( 1, kw ), 1 )
355 a( kp, kp ) = a( kk, kk )
356 CALL zcopy( kk-1-kp, a( kp+1, kk ), 1, a( kp, kp+1 ),
359 $
CALL zcopy( kp-1, a( 1, kk ), 1, a( 1, kp ), 1 )
367 $
CALL zswap( n-k, a( kk, k+1 ), lda, a( kp, k+1 ),
369 CALL zswap( n-kk+1, w( kk, kkw ), ldw, w( kp, kkw ),
373 IF( kstep.EQ.1 )
THEN
388 CALL zcopy( k, w( 1, kw ), 1, a( 1, k ), 1 )
389 r1 = cone / a( k, k )
390 CALL zscal( k-1, r1, a( 1, k ), 1 )
437 d11 = w( k, kw ) / d21
438 d22 = w( k-1, kw-1 ) / d21
439 t = cone / ( d11*d22-cone )
447 a( j, k-1 ) = d21*( d11*w( j, kw-1 )-w( j, kw ) )
448 a( j, k ) = d21*( d22*w( j, kw )-w( j, kw-1 ) )
454 a( k-1, k-1 ) = w( k-1, kw-1 )
455 a( k-1, k ) = w( k-1, kw )
456 a( k, k ) = w( k, kw )
464 IF( kstep.EQ.1 )
THEN
484 DO 50 j = ( ( k-1 ) / nb )*nb + 1, 1, -nb
485 jb = min( nb, k-j+1 )
489 DO 40 jj = j, j + jb - 1
490 CALL zgemv(
'No transpose', jj-j+1, n-k, -cone,
491 $ a( j, k+1 ), lda, w( jj, kw+1 ), ldw, cone,
497 CALL zgemm(
'No transpose',
'Transpose', j-1, jb, n-k,
498 $ -cone, a( 1, k+1 ), lda, w( j, kw+1 ), ldw,
499 $ cone, a( 1, j ), lda )
522 IF( jp.NE.jj .AND. j.LE.n )
523 $
CALL zswap( n-j+1, a( jp, j ), lda, a( jj, j ), lda )
544 IF( ( k.GE.nb .AND. nb.LT.n ) .OR. k.GT.n )
549 CALL zcopy( n-k+1, a( k, k ), 1, w( k, k ), 1 )
550 CALL zgemv(
'No transpose', n-k+1, k-1, -cone, a( k, 1 ), lda,
551 $ w( k, 1 ), ldw, cone, w( k, k ), 1 )
558 absakk = cabs1( w( k, k ) )
564 imax = k + izamax( n-k, w( k+1, k ), 1 )
565 colmax = cabs1( w( imax, k ) )
570 IF( max( absakk, colmax ).EQ.zero )
THEN
578 IF( absakk.GE.alpha*colmax )
THEN
587 CALL zcopy( imax-k, a( imax, k ), lda, w( k, k+1 ), 1 )
588 CALL zcopy( n-imax+1, a( imax, imax ), 1, w( imax, k+1 ),
590 CALL zgemv(
'No transpose', n-k+1, k-1, -cone, a( k, 1 ),
591 $ lda, w( imax, 1 ), ldw, cone, w( k, k+1 ),
597 jmax = k - 1 + izamax( imax-k, w( k, k+1 ), 1 )
598 rowmax = cabs1( w( jmax, k+1 ) )
600 jmax = imax + izamax( n-imax, w( imax+1, k+1 ), 1 )
601 rowmax = max( rowmax, cabs1( w( jmax, k+1 ) ) )
604 IF( absakk.GE.alpha*colmax*( colmax / rowmax ) )
THEN
609 ELSE IF( cabs1( w( imax, k+1 ) ).GE.alpha*rowmax )
THEN
618 CALL zcopy( n-k+1, w( k, k+1 ), 1, w( k, k ), 1 )
645 a( kp, kp ) = a( kk, kk )
646 CALL zcopy( kp-kk-1, a( kk+1, kk ), 1, a( kp, kk+1 ),
649 $
CALL zcopy( n-kp, a( kp+1, kk ), 1, a( kp+1, kp ), 1 )
657 $
CALL zswap( k-1, a( kk, 1 ), lda, a( kp, 1 ), lda )
658 CALL zswap( kk, w( kk, 1 ), ldw, w( kp, 1 ), ldw )
661 IF( kstep.EQ.1 )
THEN
676 CALL zcopy( n-k+1, w( k, k ), 1, a( k, k ), 1 )
678 r1 = cone / a( k, k )
679 CALL zscal( n-k, r1, a( k+1, k ), 1 )
727 d11 = w( k+1, k+1 ) / d21
728 d22 = w( k, k ) / d21
729 t = cone / ( d11*d22-cone )
737 a( j, k ) = d21*( d11*w( j, k )-w( j, k+1 ) )
738 a( j, k+1 ) = d21*( d22*w( j, k+1 )-w( j, k ) )
744 a( k, k ) = w( k, k )
745 a( k+1, k ) = w( k+1, k )
746 a( k+1, k+1 ) = w( k+1, k+1 )
754 IF( kstep.EQ.1 )
THEN
775 jb = min( nb, n-j+1 )
779 DO 100 jj = j, j + jb - 1
780 CALL zgemv(
'No transpose', j+jb-jj, k-1, -cone,
781 $ a( jj, 1 ), lda, w( jj, 1 ), ldw, cone,
788 $
CALL zgemm(
'No transpose',
'Transpose', n-j-jb+1, jb,
789 $ k-1, -cone, a( j+jb, 1 ), lda, w( j, 1 ),
790 $ ldw, cone, a( j+jb, j ), lda )
813 IF( jp.NE.jj .AND. j.GE.1 )
814 $
CALL zswap( j, a( jp, 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(uplo, n, nb, kb, a, lda, ipiv, w, ldw, info)
ZLASYF computes a partial factorization of a complex symmetric matrix using the Bunch-Kaufman diagona...
subroutine zscal(n, za, zx, incx)
ZSCAL
subroutine zswap(n, zx, incx, zy, incy)
ZSWAP