111 SUBROUTINE zsytri( UPLO, N, A, LDA, IPIV, WORK, INFO )
123 COMPLEX*16 A( LDA, * ), WORK( * )
130 parameter( one = ( 1.0d+0, 0.0d+0 ),
131 $ zero = ( 0.0d+0, 0.0d+0 ) )
136 COMPLEX*16 AK, AKKP1, AKP1, D, T, TEMP
141 EXTERNAL lsame, zdotu
154 upper = lsame( uplo,
'U' )
155 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
157 ELSE IF( n.LT.0 )
THEN
159 ELSE IF( lda.LT.max( 1, n ) )
THEN
163 CALL xerbla(
'ZSYTRI', -info )
178 DO 10 info = n, 1, -1
179 IF( ipiv( info ).GT.0 .AND. a( info, info ).EQ.zero )
187 IF( ipiv( info ).GT.0 .AND. a( info, info ).EQ.zero )
208 IF( ipiv( k ).GT.0 )
THEN
214 a( k, k ) = one / a( k, k )
219 CALL zcopy( k-1, a( 1, k ), 1, work, 1 )
220 CALL zsymv( uplo, k-1, -one, a, lda, work, 1, zero,
222 a( k, k ) = a( k, k ) - zdotu( k-1, work, 1, a( 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 zcopy( k-1, a( 1, k ), 1, work, 1 )
246 CALL zsymv( uplo, k-1, -one, a, lda, work, 1, zero,
248 a( k, k ) = a( k, k ) - zdotu( k-1, work, 1, a( 1,
251 a( k, k+1 ) = a( k, k+1 ) -
252 $ zdotu( k-1, a( 1, k ), 1, a( 1, k+1 ),
254 CALL zcopy( k-1, a( 1, k+1 ), 1, work, 1 )
255 CALL zsymv( uplo, k-1, -one, a, lda, work, 1, zero,
257 a( k+1, k+1 ) = a( k+1, k+1 ) -
258 $ zdotu( k-1, work, 1, a( 1, k+1 ), 1 )
263 kp = abs( ipiv( k ) )
269 CALL zswap( kp-1, a( 1, k ), 1, a( 1, kp ), 1 )
270 CALL zswap( k-kp-1, a( kp+1, k ), 1, a( kp, kp+1 ), lda )
272 a( k, k ) = a( kp, kp )
274 IF( kstep.EQ.2 )
THEN
276 a( k, k+1 ) = a( kp, k+1 )
300 IF( ipiv( k ).GT.0 )
THEN
306 a( k, k ) = one / a( k, k )
311 CALL zcopy( n-k, a( k+1, k ), 1, work, 1 )
312 CALL zsymv( uplo, n-k, -one, a( k+1, k+1 ), lda, work,
314 $ zero, a( k+1, k ), 1 )
315 a( k, k ) = a( k, k ) - zdotu( n-k, work, 1, a( k+1,
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,
341 $ zero, a( k+1, k ), 1 )
342 a( k, k ) = a( k, k ) - zdotu( n-k, work, 1, a( k+1,
345 a( k, k-1 ) = a( k, k-1 ) -
346 $ zdotu( n-k, a( k+1, k ), 1, a( k+1,
349 CALL zcopy( n-k, a( k+1, k-1 ), 1, work, 1 )
350 CALL zsymv( uplo, n-k, -one, a( k+1, k+1 ), lda, work,
352 $ zero, a( k+1, k-1 ), 1 )
353 a( k-1, k-1 ) = a( k-1, k-1 ) -
354 $ zdotu( n-k, work, 1, a( k+1, k-1 ),
360 kp = abs( ipiv( k ) )
367 $
CALL zswap( n-kp, a( kp+1, k ), 1, a( kp+1, kp ), 1 )
368 CALL zswap( kp-k-1, a( k+1, k ), 1, a( kp, k+1 ), lda )
370 a( k, k ) = a( kp, kp )
372 IF( kstep.EQ.2 )
THEN
374 a( k, k-1 ) = a( kp, k-1 )