157 SUBROUTINE slasyf( UPLO, N, NB, KB, A, LDA, IPIV, W, LDW, INFO )
166 INTEGER info, kb, lda, ldw, n, nb
170 REAL a( lda, * ), w( ldw, * )
177 parameter( zero = 0.0e+0, one = 1.0e+0 )
179 parameter( eight = 8.0e+0, sevten = 17.0e+0 )
182 INTEGER imax, j, jb, jj, jmax, jp, k, kk, kkw, kp,
184 REAL absakk, alpha, colmax, d11, d21, d22, r1,
196 INTRINSIC abs, max, min, sqrt
204 alpha = ( one+sqrt( sevten ) ) / eight
206 IF(
lsame( uplo,
'U' ) )
THEN
222 IF( ( k.LE.n-nb+1 .AND. nb.LT.n ) .OR. k.LT.1 )
227 CALL
scopy( k, a( 1, k ), 1, w( 1, kw ), 1 )
229 $ CALL
sgemv(
'No transpose', k, n-k, -one, a( 1, k+1 ), lda,
230 $ w( k, kw+1 ), ldw, one, w( 1, kw ), 1 )
237 absakk = abs( w( k, kw ) )
243 imax =
isamax( k-1, w( 1, kw ), 1 )
244 colmax = abs( w( imax, kw ) )
249 IF( max( absakk, colmax ).EQ.zero )
THEN
257 IF( absakk.GE.alpha*colmax )
THEN
266 CALL
scopy( imax, a( 1, imax ), 1, w( 1, kw-1 ), 1 )
267 CALL
scopy( k-imax, a( imax, imax+1 ), lda,
268 $ w( imax+1, kw-1 ), 1 )
270 $ CALL
sgemv(
'No transpose', k, n-k, -one, a( 1, k+1 ),
271 $ lda, w( imax, kw+1 ), ldw, one,
277 jmax = imax +
isamax( k-imax, w( imax+1, kw-1 ), 1 )
278 rowmax = abs( w( jmax, kw-1 ) )
280 jmax =
isamax( imax-1, w( 1, kw-1 ), 1 )
281 rowmax = max( rowmax, abs( w( jmax, kw-1 ) ) )
284 IF( absakk.GE.alpha*colmax*( colmax / rowmax ) )
THEN
289 ELSE IF( abs( w( imax, kw-1 ) ).GE.alpha*rowmax )
THEN
298 CALL
scopy( k, w( 1, kw-1 ), 1, w( 1, kw ), 1 )
318 a( kp, k ) = a( kk, k )
319 CALL
scopy( k-1-kp, a( kp+1, kk ), 1, a( kp, kp+1 ),
321 CALL
scopy( kp, a( 1, kk ), 1, a( 1, kp ), 1 )
325 CALL
sswap( n-kk+1, a( kk, kk ), lda, a( kp, kk ), lda )
326 CALL
sswap( n-kk+1, w( kk, kkw ), ldw, w( kp, kkw ),
330 IF( kstep.EQ.1 )
THEN
340 CALL
scopy( k, w( 1, kw ), 1, a( 1, k ), 1 )
342 CALL
sscal( k-1, r1, a( 1, k ), 1 )
358 d11 = w( k, kw ) / d21
359 d22 = w( k-1, kw-1 ) / d21
360 t = one / ( d11*d22-one )
363 a( j, k-1 ) = d21*( d11*w( j, kw-1 )-w( j, kw ) )
364 a( j, k ) = d21*( d22*w( j, kw )-w( j, kw-1 ) )
370 a( k-1, k-1 ) = w( k-1, kw-1 )
371 a( k-1, k ) = w( k-1, kw )
372 a( k, k ) = w( k, kw )
378 IF( kstep.EQ.1 )
THEN
398 DO 50 j = ( ( k-1 ) / nb )*nb + 1, 1, -nb
399 jb = min( nb, k-j+1 )
403 DO 40 jj = j, j + jb - 1
404 CALL
sgemv(
'No transpose', jj-j+1, n-k, -one,
405 $ a( j, k+1 ), lda, w( jj, kw+1 ), ldw, one,
411 CALL
sgemm(
'No transpose',
'Transpose', j-1, jb, n-k, -one,
412 $ a( 1, k+1 ), lda, w( j, kw+1 ), ldw, one,
428 IF( jp.NE.jj .AND. j.LE.n )
429 $ CALL
sswap( n-j+1, a( jp, j ), lda, a( jj, j ), lda )
450 IF( ( k.GE.nb .AND. nb.LT.n ) .OR. k.GT.n )
455 CALL
scopy( n-k+1, a( k, k ), 1, w( k, k ), 1 )
456 CALL
sgemv(
'No transpose', n-k+1, k-1, -one, a( k, 1 ), lda,
457 $ w( k, 1 ), ldw, one, w( k, k ), 1 )
464 absakk = abs( w( k, k ) )
470 imax = k +
isamax( n-k, w( k+1, k ), 1 )
471 colmax = abs( w( imax, k ) )
476 IF( max( absakk, colmax ).EQ.zero )
THEN
484 IF( absakk.GE.alpha*colmax )
THEN
493 CALL
scopy( imax-k, a( imax, k ), lda, w( k, k+1 ), 1 )
494 CALL
scopy( n-imax+1, a( imax, imax ), 1, w( imax, k+1 ),
496 CALL
sgemv(
'No transpose', n-k+1, k-1, -one, a( k, 1 ),
497 $ lda, w( imax, 1 ), ldw, one, w( k, k+1 ), 1 )
502 jmax = k - 1 +
isamax( imax-k, w( k, k+1 ), 1 )
503 rowmax = abs( w( jmax, k+1 ) )
505 jmax = imax +
isamax( n-imax, w( imax+1, k+1 ), 1 )
506 rowmax = max( rowmax, abs( w( jmax, k+1 ) ) )
509 IF( absakk.GE.alpha*colmax*( colmax / rowmax ) )
THEN
514 ELSE IF( abs( w( imax, k+1 ) ).GE.alpha*rowmax )
THEN
523 CALL
scopy( n-k+1, w( k, k+1 ), 1, w( k, k ), 1 )
542 a( kp, k ) = a( kk, k )
543 CALL
scopy( kp-k-1, a( k+1, kk ), 1, a( kp, k+1 ), lda )
544 CALL
scopy( n-kp+1, a( kp, kk ), 1, a( kp, kp ), 1 )
548 CALL
sswap( kk, a( kk, 1 ), lda, a( kp, 1 ), lda )
549 CALL
sswap( kk, w( kk, 1 ), ldw, w( kp, 1 ), ldw )
552 IF( kstep.EQ.1 )
THEN
562 CALL
scopy( n-k+1, w( k, k ), 1, a( k, k ), 1 )
565 CALL
sscal( n-k, r1, a( k+1, k ), 1 )
581 d11 = w( k+1, k+1 ) / d21
582 d22 = w( k, k ) / d21
583 t = one / ( d11*d22-one )
586 a( j, k ) = d21*( d11*w( j, k )-w( j, k+1 ) )
587 a( j, k+1 ) = d21*( d22*w( j, k+1 )-w( j, k ) )
593 a( k, k ) = w( k, k )
594 a( k+1, k ) = w( k+1, k )
595 a( k+1, k+1 ) = w( k+1, k+1 )
601 IF( kstep.EQ.1 )
THEN
622 jb = min( nb, n-j+1 )
626 DO 100 jj = j, j + jb - 1
627 CALL
sgemv(
'No transpose', j+jb-jj, k-1, -one,
628 $ a( jj, 1 ), lda, w( jj, 1 ), ldw, one,
635 $ CALL
sgemm(
'No transpose',
'Transpose', n-j-jb+1, jb,
636 $ k-1, -one, a( j+jb, 1 ), lda, w( j, 1 ), ldw,
637 $ one, a( j+jb, j ), lda )
652 IF( jp.NE.jj .AND. j.GE.1 )
653 $ CALL
sswap( j, a( jp, 1 ), lda, a( jj, 1 ), lda )