113 SUBROUTINE dsytri( UPLO, N, A, LDA, IPIV, WORK, INFO )
125 DOUBLE PRECISION A( LDA, * ), WORK( * )
131 DOUBLE PRECISION ONE, ZERO
132 parameter( one = 1.0d+0, zero = 0.0d+0 )
137 DOUBLE PRECISION AK, AKKP1, AKP1, D, T, TEMP
141 DOUBLE PRECISION DDOT
155 upper = lsame( uplo,
'U' )
156 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
158 ELSE IF( n.LT.0 )
THEN
160 ELSE IF( lda.LT.max( 1, n ) )
THEN
164 CALL xerbla(
'DSYTRI', -info )
179 DO 10 info = n, 1, -1
180 IF( ipiv( info ).GT.0 .AND. a( info, info ).EQ.zero )
188 IF( ipiv( info ).GT.0 .AND. a( info, info ).EQ.zero )
209 IF( ipiv( k ).GT.0 )
THEN
215 a( k, k ) = one / a( k, k )
220 CALL dcopy( k-1, a( 1, k ), 1, work, 1 )
221 CALL dsymv( uplo, k-1, -one, a, lda, work, 1, zero,
223 a( k, k ) = a( k, k ) - ddot( k-1, work, 1, a( 1, k ),
233 t = abs( a( k, k+1 ) )
235 akp1 = a( k+1, k+1 ) / t
236 akkp1 = a( k, k+1 ) / t
237 d = t*( ak*akp1-one )
239 a( k+1, k+1 ) = ak / d
240 a( k, k+1 ) = -akkp1 / d
245 CALL dcopy( k-1, a( 1, k ), 1, work, 1 )
246 CALL dsymv( uplo, k-1, -one, a, lda, work, 1, zero,
248 a( k, k ) = a( k, k ) - ddot( k-1, work, 1, a( 1, k ),
250 a( k, k+1 ) = a( k, k+1 ) -
251 $ ddot( k-1, a( 1, k ), 1, a( 1, k+1 ), 1 )
252 CALL dcopy( k-1, a( 1, k+1 ), 1, work, 1 )
253 CALL dsymv( uplo, k-1, -one, a, lda, work, 1, zero,
255 a( k+1, k+1 ) = a( k+1, k+1 ) -
256 $ ddot( k-1, work, 1, a( 1, k+1 ), 1 )
261 kp = abs( ipiv( k ) )
267 CALL dswap( kp-1, a( 1, k ), 1, a( 1, kp ), 1 )
268 CALL dswap( k-kp-1, a( kp+1, k ), 1, a( kp, kp+1 ), lda )
270 a( k, k ) = a( kp, kp )
272 IF( kstep.EQ.2 )
THEN
274 a( k, k+1 ) = a( kp, k+1 )
298 IF( ipiv( k ).GT.0 )
THEN
304 a( k, k ) = one / a( k, k )
309 CALL dcopy( n-k, a( k+1, k ), 1, work, 1 )
310 CALL dsymv( uplo, n-k, -one, a( k+1, k+1 ), lda, work, 1,
311 $ zero, a( k+1, k ), 1 )
312 a( k, k ) = a( k, k ) - ddot( n-k, work, 1, a( k+1, k ),
322 t = abs( a( k, k-1 ) )
323 ak = a( k-1, k-1 ) / t
325 akkp1 = a( k, k-1 ) / t
326 d = t*( ak*akp1-one )
327 a( k-1, k-1 ) = akp1 / d
329 a( k, k-1 ) = -akkp1 / d
334 CALL dcopy( n-k, a( k+1, k ), 1, work, 1 )
335 CALL dsymv( uplo, n-k, -one, a( k+1, k+1 ), lda, work, 1,
336 $ zero, a( k+1, k ), 1 )
337 a( k, k ) = a( k, k ) - ddot( n-k, work, 1, a( k+1, k ),
339 a( k, k-1 ) = a( k, k-1 ) -
340 $ ddot( n-k, a( k+1, k ), 1, a( k+1, k-1 ),
342 CALL dcopy( n-k, a( k+1, k-1 ), 1, work, 1 )
343 CALL dsymv( uplo, n-k, -one, a( k+1, k+1 ), lda, work, 1,
344 $ zero, a( k+1, k-1 ), 1 )
345 a( k-1, k-1 ) = a( k-1, k-1 ) -
346 $ ddot( n-k, work, 1, a( k+1, k-1 ), 1 )
351 kp = abs( ipiv( k ) )
358 $
CALL dswap( n-kp, a( kp+1, k ), 1, a( kp+1, kp ), 1 )
359 CALL dswap( kp-k-1, a( k+1, k ), 1, a( kp, k+1 ), lda )
361 a( k, k ) = a( kp, kp )
363 IF( kstep.EQ.2 )
THEN
365 a( k, k-1 ) = a( kp, k-1 )
subroutine xerbla(srname, info)
subroutine dcopy(n, dx, incx, dy, incy)
DCOPY
subroutine dsymv(uplo, n, alpha, a, lda, x, incx, beta, y, incy)
DSYMV
subroutine dsytri(uplo, n, a, lda, ipiv, work, info)
DSYTRI
subroutine dswap(n, dx, incx, dy, incy)
DSWAP