115 SUBROUTINE zsytri( UPLO, N, A, LDA, IPIV, WORK, INFO )
128 COMPLEX*16 a( lda, * ), work( * )
135 parameter( one = ( 1.0d+0, 0.0d+0 ),
136 $ zero = ( 0.0d+0, 0.0d+0 ) )
141 COMPLEX*16 ak, akkp1, akp1, d, t, temp
159 upper =
lsame( uplo,
'U' )
160 IF( .NOT.upper .AND. .NOT.
lsame( uplo,
'L' ) )
THEN
162 ELSE IF( n.LT.0 )
THEN
164 ELSE IF( lda.LT.max( 1, n ) )
THEN
168 CALL
xerbla(
'ZSYTRI', -info )
183 DO 10 info = n, 1, -1
184 IF( ipiv( info ).GT.0 .AND. a( info, info ).EQ.zero )
192 IF( ipiv( info ).GT.0 .AND. a( info, info ).EQ.zero )
213 IF( ipiv( k ).GT.0 )
THEN
219 a( k, k ) = one / a( k, k )
224 CALL
zcopy( k-1, a( 1, k ), 1, work, 1 )
225 CALL
zsymv( uplo, k-1, -one, a, lda, work, 1, zero,
227 a( k, k ) = a( k, k ) -
zdotu( k-1, work, 1, a( 1, k ),
239 akp1 = a( k+1, k+1 ) / t
240 akkp1 = a( k, k+1 ) / t
241 d = t*( ak*akp1-one )
243 a( k+1, k+1 ) = ak / d
244 a( k, k+1 ) = -akkp1 / d
249 CALL
zcopy( k-1, a( 1, k ), 1, work, 1 )
250 CALL
zsymv( uplo, k-1, -one, a, lda, work, 1, zero,
252 a( k, k ) = a( k, k ) -
zdotu( k-1, work, 1, a( 1, k ),
254 a( k, k+1 ) = a( k, k+1 ) -
255 $
zdotu( k-1, a( 1, k ), 1, a( 1, k+1 ), 1 )
256 CALL
zcopy( k-1, a( 1, k+1 ), 1, work, 1 )
257 CALL
zsymv( uplo, k-1, -one, a, lda, work, 1, zero,
259 a( k+1, k+1 ) = a( k+1, k+1 ) -
260 $
zdotu( k-1, work, 1, a( 1, k+1 ), 1 )
265 kp = abs( ipiv( k ) )
271 CALL
zswap( kp-1, a( 1, k ), 1, a( 1, kp ), 1 )
272 CALL
zswap( k-kp-1, a( kp+1, k ), 1, a( kp, kp+1 ), lda )
274 a( k, k ) = a( kp, kp )
276 IF( kstep.EQ.2 )
THEN
278 a( k, k+1 ) = a( kp, k+1 )
302 IF( ipiv( k ).GT.0 )
THEN
308 a( k, k ) = one / a( k, k )
313 CALL
zcopy( n-k, a( k+1, k ), 1, work, 1 )
314 CALL
zsymv( uplo, n-k, -one, a( k+1, k+1 ), lda, work, 1,
315 $ zero, a( k+1, k ), 1 )
316 a( k, k ) = a( k, k ) -
zdotu( n-k, work, 1, a( k+1, k ),
327 ak = a( k-1, k-1 ) / t
329 akkp1 = a( k, k-1 ) / t
330 d = t*( ak*akp1-one )
331 a( k-1, k-1 ) = akp1 / d
333 a( k, k-1 ) = -akkp1 / d
338 CALL
zcopy( n-k, a( k+1, k ), 1, work, 1 )
339 CALL
zsymv( uplo, n-k, -one, a( k+1, k+1 ), lda, work, 1,
340 $ zero, a( k+1, k ), 1 )
341 a( k, k ) = a( k, k ) -
zdotu( n-k, work, 1, a( k+1, k ),
343 a( k, k-1 ) = a( k, k-1 ) -
344 $
zdotu( n-k, a( k+1, k ), 1, a( k+1, k-1 ),
346 CALL
zcopy( n-k, a( k+1, k-1 ), 1, work, 1 )
347 CALL
zsymv( uplo, n-k, -one, a( k+1, k+1 ), lda, work, 1,
348 $ zero, a( k+1, k-1 ), 1 )
349 a( k-1, k-1 ) = a( k-1, k-1 ) -
350 $
zdotu( n-k, work, 1, a( k+1, k-1 ), 1 )
355 kp = abs( ipiv( k ) )
362 $ CALL
zswap( n-kp, a( kp+1, k ), 1, a( kp+1, kp ), 1 )
363 CALL
zswap( kp-k-1, a( k+1, k ), 1, a( kp, k+1 ), lda )
365 a( k, k ) = a( kp, kp )
367 IF( kstep.EQ.2 )
THEN
369 a( k, k-1 ) = a( kp, k-1 )