111 SUBROUTINE dsytri( UPLO, N, A, LDA, IPIV, WORK, INFO )
123 DOUBLE PRECISION A( LDA, * ), WORK( * )
129 DOUBLE PRECISION ONE, ZERO
130 parameter( one = 1.0d+0, zero = 0.0d+0 )
135 DOUBLE PRECISION AK, AKKP1, AKP1, D, T, TEMP
139 DOUBLE PRECISION DDOT
153 upper = lsame( uplo,
'U' )
154 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
156 ELSE IF( n.LT.0 )
THEN
158 ELSE IF( lda.LT.max( 1, n ) )
THEN
162 CALL xerbla(
'DSYTRI', -info )
177 DO 10 info = n, 1, -1
178 IF( ipiv( info ).GT.0 .AND. a( info, info ).EQ.zero )
186 IF( ipiv( info ).GT.0 .AND. a( info, info ).EQ.zero )
207 IF( ipiv( k ).GT.0 )
THEN
213 a( k, k ) = one / a( k, k )
218 CALL dcopy( k-1, a( 1, k ), 1, work, 1 )
219 CALL dsymv( uplo, k-1, -one, a, lda, work, 1, zero,
221 a( k, k ) = a( k, k ) - ddot( k-1, work, 1, a( 1, k ),
231 t = abs( a( k, k+1 ) )
233 akp1 = a( k+1, k+1 ) / t
234 akkp1 = a( k, k+1 ) / t
235 d = t*( ak*akp1-one )
237 a( k+1, k+1 ) = ak / d
238 a( k, k+1 ) = -akkp1 / d
243 CALL dcopy( k-1, a( 1, k ), 1, work, 1 )
244 CALL dsymv( uplo, k-1, -one, a, lda, work, 1, zero,
246 a( k, k ) = a( k, k ) - ddot( k-1, work, 1, a( 1, k ),
248 a( k, k+1 ) = a( k, k+1 ) -
249 $ ddot( k-1, a( 1, k ), 1, a( 1, k+1 ),
251 CALL dcopy( k-1, a( 1, k+1 ), 1, work, 1 )
252 CALL dsymv( uplo, k-1, -one, a, lda, work, 1, zero,
254 a( k+1, k+1 ) = a( k+1, k+1 ) -
255 $ ddot( k-1, work, 1, a( 1, k+1 ), 1 )
260 kp = abs( ipiv( k ) )
266 CALL dswap( kp-1, a( 1, k ), 1, a( 1, kp ), 1 )
267 CALL dswap( k-kp-1, a( kp+1, k ), 1, a( kp, kp+1 ), lda )
269 a( k, k ) = a( kp, kp )
271 IF( kstep.EQ.2 )
THEN
273 a( k, k+1 ) = a( kp, k+1 )
297 IF( ipiv( k ).GT.0 )
THEN
303 a( k, k ) = one / a( k, k )
308 CALL dcopy( n-k, a( k+1, k ), 1, work, 1 )
309 CALL dsymv( uplo, n-k, -one, a( k+1, k+1 ), lda, work,
311 $ zero, a( k+1, k ), 1 )
312 a( k, k ) = a( k, k ) - ddot( n-k, work, 1, a( k+1,
323 t = abs( a( k, k-1 ) )
324 ak = a( k-1, k-1 ) / t
326 akkp1 = a( k, k-1 ) / t
327 d = t*( ak*akp1-one )
328 a( k-1, k-1 ) = akp1 / d
330 a( k, k-1 ) = -akkp1 / d
335 CALL dcopy( n-k, a( k+1, k ), 1, work, 1 )
336 CALL dsymv( uplo, n-k, -one, a( k+1, k+1 ), lda, work,
338 $ zero, a( k+1, k ), 1 )
339 a( k, k ) = a( k, k ) - ddot( n-k, work, 1, a( k+1,
342 a( k, k-1 ) = a( k, k-1 ) -
343 $ ddot( n-k, a( k+1, k ), 1, a( k+1,
346 CALL dcopy( n-k, a( k+1, k-1 ), 1, work, 1 )
347 CALL dsymv( uplo, n-k, -one, a( k+1, k+1 ), lda, work,
349 $ zero, a( k+1, k-1 ), 1 )
350 a( k-1, k-1 ) = a( k-1, k-1 ) -
351 $ ddot( n-k, work, 1, a( k+1, k-1 ), 1 )
356 kp = abs( ipiv( k ) )
363 $
CALL dswap( n-kp, a( kp+1, k ), 1, a( kp+1, kp ), 1 )
364 CALL dswap( kp-k-1, a( k+1, k ), 1, a( kp, k+1 ), lda )
366 a( k, k ) = a( kp, kp )
368 IF( kstep.EQ.2 )
THEN
370 a( k, k-1 ) = a( kp, k-1 )