132 $ WORK, LWORK, INFO )
142 INTEGER N, LDA, LWORK, INFO
146 DOUBLE PRECISION A( LDA, * ), WORK( * )
151 DOUBLE PRECISION ZERO, ONE
152 parameter( zero = 0.0d+0, one = 1.0d+0 )
155 LOGICAL LQUERY, UPPER
156 INTEGER J, LWKMIN, LWKOPT
157 INTEGER NB, MJ, NJ, K1, K2, J1, J2, J3, JB
158 DOUBLE PRECISION ALPHA
163 EXTERNAL lsame, ilaenv
177 nb = ilaenv( 1,
'DSYTRF_AA', uplo, n, -1, -1, -1 )
182 upper = lsame( uplo,
'U' )
183 lquery = ( lwork.EQ.-1 )
192 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
194 ELSE IF( n.LT.0 )
THEN
196 ELSE IF( lda.LT.max( 1, n ) )
THEN
198 ELSE IF( lwork.LT.lwkmin .AND. .NOT.lquery )
THEN
207 CALL xerbla(
'DSYTRF_AA', -info )
209 ELSE IF( lquery )
THEN
225 IF( lwork.LT.((1+nb)*n) )
THEN
237 CALL dcopy( n, a( 1, 1 ), lda, work( 1 ), 1 )
256 jb = min( n-j1+1, nb )
262 $ a( max(1, j), j+1 ), lda,
263 $ ipiv( j+1 ), work, n, work( n*nb+1 ) )
267 DO j2 = j+2, min(n, j+jb+1)
268 ipiv( j2 ) = ipiv( j2 ) + j
269 IF( (j2.NE.ipiv(j2)) .AND. ((j1-k1).GT.2) )
THEN
270 CALL dswap( j1-k1-2, a( 1, j2 ), 1,
271 $ a( 1, ipiv(j2) ), 1 )
284 IF( j1.GT.1 .OR. jb.GT.1 )
THEN
290 CALL dcopy( n-j, a( j-1, j+1 ), lda,
291 $ work( (j+1-j1+1)+jb*n ), 1 )
292 CALL dscal( n-j, alpha, work( (j+1-j1+1)+jb*n ), 1 )
315 nj = min( nb, n-j2+1 )
321 CALL dgemv(
'No transpose', mj, jb+1,
322 $ -one, work( j3-j1+1+k1*n ), n,
324 $ one, a( j3, j3 ), lda )
330 CALL dgemm(
'Transpose',
'Transpose',
332 $ -one, a( j1-k2, j2 ), lda,
333 $ work( j3-j1+1+k1*n ), n,
334 $ one, a( j2, j3 ), lda )
344 CALL dcopy( n-j, a( j+1, j+1 ), lda, work( 1 ), 1 )
356 CALL dcopy( n, a( 1, 1 ), 1, work( 1 ), 1 )
375 jb = min( n-j1+1, nb )
381 $ a( j+1, max(1, j) ), lda,
382 $ ipiv( j+1 ), work, n, work( n*nb+1 ) )
386 DO j2 = j+2, min(n, j+jb+1)
387 ipiv( j2 ) = ipiv( j2 ) + j
388 IF( (j2.NE.ipiv(j2)) .AND. ((j1-k1).GT.2) )
THEN
389 CALL dswap( j1-k1-2, a( j2, 1 ), lda,
390 $ a( ipiv(j2), 1 ), lda )
403 IF( j1.GT.1 .OR. jb.GT.1 )
THEN
409 CALL dcopy( n-j, a( j+1, j-1 ), 1,
410 $ work( (j+1-j1+1)+jb*n ), 1 )
411 CALL dscal( n-j, alpha, work( (j+1-j1+1)+jb*n ), 1 )
434 nj = min( nb, n-j2+1 )
440 CALL dgemv(
'No transpose', mj, jb+1,
441 $ -one, work( j3-j1+1+k1*n ), n,
442 $ a( j3, j1-k2 ), lda,
443 $ one, a( j3, j3 ), 1 )
449 CALL dgemm(
'No transpose',
'Transpose',
451 $ -one, work( j3-j1+1+k1*n ), n,
452 $ a( j2, j1-k2 ), lda,
453 $ one, a( j3, j2 ), lda )
463 CALL dcopy( n-j, a( j+1, j+1 ), 1, work( 1 ), 1 )