260 SUBROUTINE slasyf_rk( UPLO, N, NB, KB, A, LDA, E, IPIV, W, LDW,
269 INTEGER INFO, KB, LDA, LDW, N, NB
273 REAL A( LDA, * ), E( * ), W( LDW, * )
280 parameter( zero = 0.0e+0, one = 1.0e+0 )
282 parameter( eight = 8.0e+0, sevten = 17.0e+0 )
286 INTEGER IMAX, ITEMP, J, JB, JJ, JMAX, K, KK, KW, KKW,
288 REAL ABSAKK, ALPHA, COLMAX, D11, D12, D21, D22,
289 $ stemp, r1, rowmax, t, sfmin
295 EXTERNAL lsame, isamax, slamch
301 INTRINSIC abs, max, min, sqrt
309 alpha = ( one+sqrt( sevten ) ) / eight
313 sfmin = slamch(
'S' )
315 IF( lsame( uplo,
'U' ) )
THEN
337 IF( ( k.LE.n-nb+1 .AND. nb.LT.n ) .OR. k.LT.1 )
345 CALL scopy( k, a( 1, k ), 1, w( 1, kw ), 1 )
347 $
CALL sgemv(
'No transpose', k, n-k, -one, a( 1, k+1 ),
348 $ lda, w( k, kw+1 ), ldw, one, w( 1, kw ), 1 )
353 absakk = abs( w( k, kw ) )
360 imax = isamax( k-1, w( 1, kw ), 1 )
361 colmax = abs( w( imax, kw ) )
366 IF( max( absakk, colmax ).EQ.zero )
THEN
373 CALL scopy( k, w( 1, kw ), 1, a( 1, k ), 1 )
389 IF( .NOT.( absakk.LT.alpha*colmax ) )
THEN
408 CALL scopy( imax, a( 1, imax ), 1, w( 1, kw-1 ), 1 )
409 CALL scopy( k-imax, a( imax, imax+1 ), lda,
410 $ w( imax+1, kw-1 ), 1 )
413 $
CALL sgemv(
'No transpose', k, n-k, -one,
414 $ a( 1, k+1 ), lda, w( imax, kw+1 ), ldw,
415 $ one, w( 1, kw-1 ), 1 )
422 jmax = imax + isamax( k-imax, w( imax+1, kw-1 ),
424 rowmax = abs( w( jmax, kw-1 ) )
430 itemp = isamax( imax-1, w( 1, kw-1 ), 1 )
431 stemp = abs( w( itemp, kw-1 ) )
432 IF( stemp.GT.rowmax )
THEN
442 IF( .NOT.(abs( w( imax, kw-1 ) ).LT.alpha*rowmax ) )
452 CALL scopy( k, w( 1, kw-1 ), 1, w( 1, kw ), 1 )
459 ELSE IF( ( p.EQ.jmax ) .OR. ( rowmax.LE.colmax ) )
478 CALL scopy( k, w( 1, kw-1 ), 1, w( 1, kw ), 1 )
484 IF( .NOT. done )
GOTO 12
496 IF( ( kstep.EQ.2 ) .AND. ( p.NE.k ) )
THEN
500 CALL scopy( k-p, a( p+1, k ), 1, a( p, p+1 ), lda )
501 CALL scopy( p, a( 1, k ), 1, a( 1, p ), 1 )
506 CALL sswap( n-k+1, a( k, k ), lda, a( p, k ), lda )
507 CALL sswap( n-kk+1, w( k, kkw ), ldw, w( p, kkw ), ldw )
516 a( kp, k ) = a( kk, k )
517 CALL scopy( k-1-kp, a( kp+1, kk ), 1, a( kp, kp+1 ),
519 CALL scopy( kp, a( 1, kk ), 1, a( 1, kp ), 1 )
524 CALL sswap( n-kk+1, a( kk, kk ), lda, a( kp, kk ), lda )
525 CALL sswap( n-kk+1, w( kk, kkw ), ldw, w( kp, kkw ),
529 IF( kstep.EQ.1 )
THEN
539 CALL scopy( k, w( 1, kw ), 1, a( 1, k ), 1 )
541 IF( abs( a( k, k ) ).GE.sfmin )
THEN
543 CALL sscal( k-1, r1, a( 1, k ), 1 )
544 ELSE IF( a( k, k ).NE.zero )
THEN
546 a( ii, k ) = a( ii, k ) / a( k, k )
571 d11 = w( k, kw ) / d12
572 d22 = w( k-1, kw-1 ) / d12
573 t = one / ( d11*d22-one )
575 a( j, k-1 ) = t*( (d11*w( j, kw-1 )-w( j, kw ) ) /
577 a( j, k ) = t*( ( d22*w( j, kw )-w( j, kw-1 ) ) /
586 a( k-1, k-1 ) = w( k-1, kw-1 )
588 a( k, k ) = w( k, kw )
589 e( k ) = w( k-1, kw )
600 IF( kstep.EQ.1 )
THEN
620 DO 50 j = ( ( k-1 ) / nb )*nb + 1, 1, -nb
621 jb = min( nb, k-j+1 )
625 DO 40 jj = j, j + jb - 1
626 CALL sgemv(
'No transpose', jj-j+1, n-k, -one,
627 $ a( j, k+1 ), lda, w( jj, kw+1 ), ldw, one,
634 $
CALL sgemm(
'No transpose',
'Transpose', j-1, jb,
635 $ n-k, -one, a( 1, k+1 ), lda, w( j, kw+1 ),
636 $ ldw, one, a( 1, j ), lda )
660 IF( ( k.GE.nb .AND. nb.LT.n ) .OR. k.GT.n )
668 CALL scopy( n-k+1, a( k, k ), 1, w( k, k ), 1 )
670 $
CALL sgemv(
'No transpose', n-k+1, k-1, -one, a( k, 1 ),
671 $ lda, w( k, 1 ), ldw, one, w( k, k ), 1 )
676 absakk = abs( w( k, k ) )
683 imax = k + isamax( n-k, w( k+1, k ), 1 )
684 colmax = abs( w( imax, k ) )
689 IF( max( absakk, colmax ).EQ.zero )
THEN
696 CALL scopy( n-k+1, w( k, k ), 1, a( k, k ), 1 )
712 IF( .NOT.( absakk.LT.alpha*colmax ) )
THEN
731 CALL scopy( imax-k, a( imax, k ), lda, w( k, k+1 ), 1)
732 CALL scopy( n-imax+1, a( imax, imax ), 1,
733 $ w( imax, k+1 ), 1 )
735 $
CALL sgemv(
'No transpose', n-k+1, k-1, -one,
736 $ a( k, 1 ), lda, w( imax, 1 ), ldw,
737 $ one, w( k, k+1 ), 1 )
744 jmax = k - 1 + isamax( imax-k, w( k, k+1 ), 1 )
745 rowmax = abs( w( jmax, k+1 ) )
751 itemp = imax + isamax( n-imax, w( imax+1, k+1 ), 1)
752 stemp = abs( w( itemp, k+1 ) )
753 IF( stemp.GT.rowmax )
THEN
763 IF( .NOT.( abs( w( imax, k+1 ) ).LT.alpha*rowmax ) )
773 CALL scopy( n-k+1, w( k, k+1 ), 1, w( k, k ), 1 )
780 ELSE IF( ( p.EQ.jmax ) .OR. ( rowmax.LE.colmax ) )
799 CALL scopy( n-k+1, w( k, k+1 ), 1, w( k, k ), 1 )
805 IF( .NOT. done )
GOTO 72
813 IF( ( kstep.EQ.2 ) .AND. ( p.NE.k ) )
THEN
817 CALL scopy( p-k, a( k, k ), 1, a( p, k ), lda )
818 CALL scopy( n-p+1, a( p, k ), 1, a( p, p ), 1 )
823 CALL sswap( k, a( k, 1 ), lda, a( p, 1 ), lda )
824 CALL sswap( kk, w( k, 1 ), ldw, w( p, 1 ), ldw )
833 a( kp, k ) = a( kk, k )
834 CALL scopy( kp-k-1, a( k+1, kk ), 1, a( kp, k+1 ), lda )
835 CALL scopy( n-kp+1, a( kp, kk ), 1, a( kp, kp ), 1 )
839 CALL sswap( kk, a( kk, 1 ), lda, a( kp, 1 ), lda )
840 CALL sswap( kk, w( kk, 1 ), ldw, w( kp, 1 ), ldw )
843 IF( kstep.EQ.1 )
THEN
853 CALL scopy( n-k+1, w( k, k ), 1, a( k, k ), 1 )
855 IF( abs( a( k, k ) ).GE.sfmin )
THEN
857 CALL sscal( n-k, r1, a( k+1, k ), 1 )
858 ELSE IF( a( k, k ).NE.zero )
THEN
860 a( ii, k ) = a( ii, k ) / a( k, k )
884 d11 = w( k+1, k+1 ) / d21
885 d22 = w( k, k ) / d21
886 t = one / ( d11*d22-one )
888 a( j, k ) = t*( ( d11*w( j, k )-w( j, k+1 ) ) /
890 a( j, k+1 ) = t*( ( d22*w( j, k+1 )-w( j, k ) ) /
899 a( k, k ) = w( k, k )
901 a( k+1, k+1 ) = w( k+1, k+1 )
913 IF( kstep.EQ.1 )
THEN
934 jb = min( nb, n-j+1 )
938 DO 100 jj = j, j + jb - 1
939 CALL sgemv(
'No transpose', j+jb-jj, k-1, -one,
940 $ a( jj, 1 ), lda, w( jj, 1 ), ldw, one,
947 $
CALL sgemm(
'No transpose',
'Transpose', n-j-jb+1, jb,
948 $ k-1, -one, a( j+jb, 1 ), lda, w( j, 1 ),
949 $ ldw, one, a( j+jb, j ), lda )
subroutine scopy(n, sx, incx, sy, incy)
SCOPY
subroutine sgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
SGEMM
subroutine sgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
SGEMV
subroutine slasyf_rk(uplo, n, nb, kb, a, lda, e, ipiv, w, ldw, info)
SLASYF_RK computes a partial factorization of a real symmetric indefinite matrix using bounded Bunch-...
subroutine sscal(n, sa, sx, incx)
SSCAL
subroutine sswap(n, sx, incx, sy, incy)
SSWAP