191 INTEGER INFO, KB, LDA, LDW, N, NB
195 COMPLEX A( LDA, * ), W( LDW, * )
202 parameter( zero = 0.0e+0, one = 1.0e+0 )
204 parameter( eight = 8.0e+0, sevten = 17.0e+0 )
206 parameter( cone = ( 1.0e+0, 0.0e+0 ),
207 $ czero = ( 0.0e+0, 0.0e+0 ) )
211 INTEGER IMAX, ITEMP, J, JB, JJ, JMAX, JP1, JP2, K, KK,
212 $ kw, kkw, kp, kstep, p, ii
213 REAL ABSAKK, ALPHA, COLMAX, ROWMAX, STEMP, SFMIN
214 COMPLEX D11, D12, D21, D22, R1, T, Z
220 EXTERNAL lsame, icamax, slamch
226 INTRINSIC abs, max, min, sqrt, aimag, real
232 cabs1( z ) = abs( real( z ) ) + abs( aimag( z ) )
240 alpha = ( one+sqrt( sevten ) ) / eight
244 sfmin = slamch(
'S' )
246 IF( lsame( uplo,
'U' ) )
THEN
263 IF( ( k.LE.n-nb+1 .AND. nb.LT.n ) .OR. k.LT.1 )
271 CALL ccopy( k, a( 1, k ), 1, w( 1, kw ), 1 )
273 $
CALL cgemv(
'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 = icamax( k-1, w( 1, kw ), 1 )
287 colmax = cabs1( w( imax, kw ) )
292 IF( max( absakk, colmax ).EQ.zero )
THEN
299 CALL ccopy( k, w( 1, kw ), 1, a( 1, k ), 1 )
309 IF( .NOT.( absakk.LT.alpha*colmax ) )
THEN
328 CALL ccopy( imax, a( 1, imax ), 1, w( 1, kw-1 ), 1 )
329 CALL ccopy( k-imax, a( imax, imax+1 ), lda,
330 $ w( imax+1, kw-1 ), 1 )
333 $
CALL cgemv(
'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 + icamax( k-imax, w( imax+1, kw-1 ),
344 rowmax = cabs1( w( jmax, kw-1 ) )
350 itemp = icamax( imax-1, w( 1, kw-1 ), 1 )
351 stemp = cabs1( w( itemp, kw-1 ) )
352 IF( stemp.GT.rowmax )
THEN
362 IF( .NOT.(cabs1( w( imax, kw-1 ) ).LT.alpha*rowmax ) )
372 CALL ccopy( k, w( 1, kw-1 ), 1, w( 1, kw ), 1 )
379 ELSE IF( ( p.EQ.jmax ) .OR. ( rowmax.LE.colmax ) )
398 CALL ccopy( 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 ccopy( k-p, a( p+1, k ), 1, a( p, p+1 ), lda )
421 CALL ccopy( p, a( 1, k ), 1, a( 1, p ), 1 )
426 CALL cswap( n-k+1, a( k, k ), lda, a( p, k ), lda )
427 CALL cswap( n-kk+1, w( k, kkw ), ldw, w( p, kkw ), ldw )
436 a( kp, k ) = a( kk, k )
437 CALL ccopy( k-1-kp, a( kp+1, kk ), 1, a( kp, kp+1 ),
439 CALL ccopy( kp, a( 1, kk ), 1, a( 1, kp ), 1 )
444 CALL cswap( n-kk+1, a( kk, kk ), lda, a( kp, kk ), lda )
445 CALL cswap( n-kk+1, w( kk, kkw ), ldw, w( kp, kkw ),
449 IF( kstep.EQ.1 )
THEN
459 CALL ccopy( 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 cscal( 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 cgemv(
'No transpose', jj-j+1, n-k, -cone,
534 $ a( j, k+1 ), lda, w( jj, kw+1 ), ldw, cone,
541 $
CALL cgemm(
'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 cswap( n-j+1, a( jp2, j ), lda, a( jj, j ), lda )
567 IF( jp1.NE.jj .AND. kstep.EQ.2 )
568 $
CALL cswap( 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 ccopy( n-k+1, a( k, k ), 1, w( k, k ), 1 )
599 $
CALL cgemv(
'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 + icamax( n-k, w( k+1, k ), 1 )
613 colmax = cabs1( w( imax, k ) )
618 IF( max( absakk, colmax ).EQ.zero )
THEN
625 CALL ccopy( n-k+1, w( k, k ), 1, a( k, k ), 1 )
635 IF( .NOT.( absakk.LT.alpha*colmax ) )
THEN
654 CALL ccopy( imax-k, a( imax, k ), lda, w( k, k+1 ), 1)
655 CALL ccopy( n-imax+1, a( imax, imax ), 1,
656 $ w( imax, k+1 ), 1 )
658 $
CALL cgemv(
'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 + icamax( imax-k, w( k, k+1 ), 1 )
668 rowmax = cabs1( w( jmax, k+1 ) )
674 itemp = imax + icamax( n-imax, w( imax+1, k+1 ), 1)
675 stemp = cabs1( w( itemp, k+1 ) )
676 IF( stemp.GT.rowmax )
THEN
686 IF( .NOT.( cabs1( w( imax, k+1 ) ).LT.alpha*rowmax ) )
696 CALL ccopy( n-k+1, w( k, k+1 ), 1, w( k, k ), 1 )
703 ELSE IF( ( p.EQ.jmax ) .OR. ( rowmax.LE.colmax ) )
722 CALL ccopy( 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 ccopy( p-k, a( k, k ), 1, a( p, k ), lda )
741 CALL ccopy( n-p+1, a( p, k ), 1, a( p, p ), 1 )
746 CALL cswap( k, a( k, 1 ), lda, a( p, 1 ), lda )
747 CALL cswap( kk, w( k, 1 ), ldw, w( p, 1 ), ldw )
756 a( kp, k ) = a( kk, k )
757 CALL ccopy( kp-k-1, a( k+1, kk ), 1, a( kp, k+1 ), lda )
758 CALL ccopy( n-kp+1, a( kp, kk ), 1, a( kp, kp ), 1 )
762 CALL cswap( kk, a( kk, 1 ), lda, a( kp, 1 ), lda )
763 CALL cswap( kk, w( kk, 1 ), ldw, w( kp, 1 ), ldw )
766 IF( kstep.EQ.1 )
THEN
776 CALL ccopy( 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 cscal( 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 cgemv(
'No transpose', j+jb-jj, k-1, -cone,
850 $ a( jj, 1 ), lda, w( jj, 1 ), ldw, cone,
857 $
CALL cgemm(
'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 cswap( j, a( jp2, 1 ), lda, a( jj, 1 ), lda )
883 IF( jp1.NE.jj .AND. kstep.EQ.2 )
884 $
CALL cswap( j, a( jp1, 1 ), lda, a( jj, 1 ), lda )
subroutine ccopy(n, cx, incx, cy, incy)
CCOPY
subroutine cgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
CGEMM
subroutine cgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
CGEMV
subroutine clasyf_rook(uplo, n, nb, kb, a, lda, ipiv, w, ldw, info)
CLASYF_ROOK computes a partial factorization of a complex symmetric matrix using the bounded Bunch-Ka...
subroutine cscal(n, ca, cx, incx)
CSCAL
subroutine cswap(n, cx, incx, cy, incy)
CSWAP