132 $ WORK, LWORK, INFO )
142 INTEGER N, LDA, LWORK, INFO
146 REAL A( LDA, * ), WORK( * )
152 parameter( zero = 0.0e+0, one = 1.0e+0 )
155 LOGICAL LQUERY, UPPER
156 INTEGER J, LWKMIN, LWKOPT
157 INTEGER NB, MJ, NJ, K1, K2, J1, J2, J3, JB
164 EXTERNAL lsame, ilaenv, sroundup_lwork
178 nb = ilaenv( 1,
'SSYTRF_AA', uplo, n, -1, -1, -1 )
183 upper = lsame( uplo,
'U' )
184 lquery = ( lwork.EQ.-1 )
193 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
195 ELSE IF( n.LT.0 )
THEN
197 ELSE IF( lda.LT.max( 1, n ) )
THEN
199 ELSE IF( lwork.LT.lwkmin .AND. .NOT.lquery )
THEN
204 work( 1 ) = sroundup_lwork( lwkopt )
208 CALL xerbla(
'SSYTRF_AA', -info )
210 ELSE IF( lquery )
THEN
226 IF( lwork.LT.((1+nb)*n) )
THEN
238 CALL scopy( n, a( 1, 1 ), lda, work( 1 ), 1 )
257 jb = min( n-j1+1, nb )
263 $ a( max(1, j), j+1 ), lda,
264 $ ipiv( j+1 ), work, n, work( n*nb+1 ) )
268 DO j2 = j+2, min(n, j+jb+1)
269 ipiv( j2 ) = ipiv( j2 ) + j
270 IF( (j2.NE.ipiv(j2)) .AND. ((j1-k1).GT.2) )
THEN
271 CALL sswap( j1-k1-2, a( 1, j2 ), 1,
272 $ a( 1, ipiv(j2) ), 1 )
285 IF( j1.GT.1 .OR. jb.GT.1 )
THEN
291 CALL scopy( n-j, a( j-1, j+1 ), lda,
292 $ work( (j+1-j1+1)+jb*n ), 1 )
293 CALL sscal( n-j, alpha, work( (j+1-j1+1)+jb*n ), 1 )
316 nj = min( nb, n-j2+1 )
322 CALL sgemv(
'No transpose', mj, jb+1,
323 $ -one, work( j3-j1+1+k1*n ), n,
325 $ one, a( j3, j3 ), lda )
331 CALL sgemm(
'Transpose',
'Transpose',
333 $ -one, a( j1-k2, j2 ), lda,
334 $ work( j3-j1+1+k1*n ), n,
335 $ one, a( j2, j3 ), lda )
345 CALL scopy( n-j, a( j+1, j+1 ), lda, work( 1 ), 1 )
357 CALL scopy( n, a( 1, 1 ), 1, work( 1 ), 1 )
376 jb = min( n-j1+1, nb )
382 $ a( j+1, max(1, j) ), lda,
383 $ ipiv( j+1 ), work, n, work( n*nb+1 ) )
387 DO j2 = j+2, min(n, j+jb+1)
388 ipiv( j2 ) = ipiv( j2 ) + j
389 IF( (j2.NE.ipiv(j2)) .AND. ((j1-k1).GT.2) )
THEN
390 CALL sswap( j1-k1-2, a( j2, 1 ), lda,
391 $ a( ipiv(j2), 1 ), lda )
404 IF( j1.GT.1 .OR. jb.GT.1 )
THEN
410 CALL scopy( n-j, a( j+1, j-1 ), 1,
411 $ work( (j+1-j1+1)+jb*n ), 1 )
412 CALL sscal( n-j, alpha, work( (j+1-j1+1)+jb*n ), 1 )
435 nj = min( nb, n-j2+1 )
441 CALL sgemv(
'No transpose', mj, jb+1,
442 $ -one, work( j3-j1+1+k1*n ), n,
443 $ a( j3, j1-k2 ), lda,
444 $ one, a( j3, j3 ), 1 )
450 CALL sgemm(
'No transpose',
'Transpose',
452 $ -one, work( j3-j1+1+k1*n ), n,
453 $ a( j2, j1-k2 ), lda,
454 $ one, a( j3, j2 ), lda )
464 CALL scopy( n-j, a( j+1, j+1 ), 1, work( 1 ), 1 )
471 work( 1 ) = sroundup_lwork( lwkopt )