157 SUBROUTINE dlasyf( UPLO, N, NB, KB, A, LDA, IPIV, W, LDW, INFO )
166 INTEGER info, kb, lda, ldw, n, nb
170 DOUBLE PRECISION a( lda, * ), w( ldw, * )
176 DOUBLE PRECISION zero, one
177 parameter( zero = 0.0d+0, one = 1.0d+0 )
178 DOUBLE PRECISION eight, sevten
179 parameter( eight = 8.0d+0, sevten = 17.0d+0 )
182 INTEGER imax, j, jb, jj, jmax, jp, k, kk, kkw, kp,
184 DOUBLE PRECISION 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
dcopy( k, a( 1, k ), 1, w( 1, kw ), 1 )
229 $ CALL
dgemv(
'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 =
idamax( 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
dcopy( imax, a( 1, imax ), 1, w( 1, kw-1 ), 1 )
267 CALL
dcopy( k-imax, a( imax, imax+1 ), lda,
268 $ w( imax+1, kw-1 ), 1 )
270 $ CALL
dgemv(
'No transpose', k, n-k, -one, a( 1, k+1 ),
271 $ lda, w( imax, kw+1 ), ldw, one,
277 jmax = imax +
idamax( k-imax, w( imax+1, kw-1 ), 1 )
278 rowmax = abs( w( jmax, kw-1 ) )
280 jmax =
idamax( 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
dcopy( k, w( 1, kw-1 ), 1, w( 1, kw ), 1 )
318 a( kp, k ) = a( kk, k )
319 CALL
dcopy( k-1-kp, a( kp+1, kk ), 1, a( kp, kp+1 ),
321 CALL
dcopy( kp, a( 1, kk ), 1, a( 1, kp ), 1 )
325 CALL
dswap( n-kk+1, a( kk, kk ), lda, a( kp, kk ), lda )
326 CALL
dswap( n-kk+1, w( kk, kkw ), ldw, w( kp, kkw ),
330 IF( kstep.EQ.1 )
THEN
340 CALL
dcopy( k, w( 1, kw ), 1, a( 1, k ), 1 )
342 CALL
dscal( 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
dgemv(
'No transpose', jj-j+1, n-k, -one,
405 $ a( j, k+1 ), lda, w( jj, kw+1 ), ldw, one,
411 CALL
dgemm(
'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
dswap( 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
dcopy( n-k+1, a( k, k ), 1, w( k, k ), 1 )
456 CALL
dgemv(
'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 +
idamax( 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
dcopy( imax-k, a( imax, k ), lda, w( k, k+1 ), 1 )
494 CALL
dcopy( n-imax+1, a( imax, imax ), 1, w( imax, k+1 ),
496 CALL
dgemv(
'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 +
idamax( imax-k, w( k, k+1 ), 1 )
503 rowmax = abs( w( jmax, k+1 ) )
505 jmax = imax +
idamax( 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
dcopy( n-k+1, w( k, k+1 ), 1, w( k, k ), 1 )
542 a( kp, k ) = a( kk, k )
543 CALL
dcopy( kp-k-1, a( k+1, kk ), 1, a( kp, k+1 ), lda )
544 CALL
dcopy( n-kp+1, a( kp, kk ), 1, a( kp, kp ), 1 )
548 CALL
dswap( kk, a( kk, 1 ), lda, a( kp, 1 ), lda )
549 CALL
dswap( kk, w( kk, 1 ), ldw, w( kp, 1 ), ldw )
552 IF( kstep.EQ.1 )
THEN
562 CALL
dcopy( n-k+1, w( k, k ), 1, a( k, k ), 1 )
565 CALL
dscal( 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
dgemv(
'No transpose', j+jb-jj, k-1, -one,
628 $ a( jj, 1 ), lda, w( jj, 1 ), ldw, one,
635 $ CALL
dgemm(
'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
dswap( j, a( jp, 1 ), lda, a( jj, 1 ), lda )