115 SUBROUTINE csytri( UPLO, N, A, LDA, IPIV, WORK, INFO )
128 COMPLEX A( lda, * ), WORK( * )
135 parameter ( one = ( 1.0e+0, 0.0e+0 ),
136 $ zero = ( 0.0e+0, 0.0e+0 ) )
141 COMPLEX AK, AKKP1, AKP1, D, T, TEMP
146 EXTERNAL lsame, cdotu
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(
'CSYTRI', -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 ccopy( k-1, a( 1, k ), 1, work, 1 )
225 CALL csymv( uplo, k-1, -one, a, lda, work, 1, zero,
227 a( k, k ) = a( k, k ) - cdotu( 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 ccopy( k-1, a( 1, k ), 1, work, 1 )
250 CALL csymv( uplo, k-1, -one, a, lda, work, 1, zero,
252 a( k, k ) = a( k, k ) - cdotu( k-1, work, 1, a( 1, k ),
254 a( k, k+1 ) = a( k, k+1 ) -
255 $ cdotu( k-1, a( 1, k ), 1, a( 1, k+1 ), 1 )
256 CALL ccopy( k-1, a( 1, k+1 ), 1, work, 1 )
257 CALL csymv( uplo, k-1, -one, a, lda, work, 1, zero,
259 a( k+1, k+1 ) = a( k+1, k+1 ) -
260 $ cdotu( k-1, work, 1, a( 1, k+1 ), 1 )
265 kp = abs( ipiv( k ) )
271 CALL cswap( kp-1, a( 1, k ), 1, a( 1, kp ), 1 )
272 CALL cswap( 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 ccopy( n-k, a( k+1, k ), 1, work, 1 )
314 CALL csymv( 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 ) - cdotu( 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 ccopy( n-k, a( k+1, k ), 1, work, 1 )
339 CALL csymv( 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 ) - cdotu( n-k, work, 1, a( k+1, k ),
343 a( k, k-1 ) = a( k, k-1 ) -
344 $ cdotu( n-k, a( k+1, k ), 1, a( k+1, k-1 ),
346 CALL ccopy( n-k, a( k+1, k-1 ), 1, work, 1 )
347 CALL csymv( 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 $ cdotu( n-k, work, 1, a( k+1, k-1 ), 1 )
355 kp = abs( ipiv( k ) )
362 $
CALL cswap( n-kp, a( kp+1, k ), 1, a( kp+1, kp ), 1 )
363 CALL cswap( 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 )
subroutine csymv(UPLO, N, ALPHA, A, LDA, X, INCX, BETA, Y, INCY)
CSYMV computes a matrix-vector product for a complex symmetric matrix.
subroutine csytri(UPLO, N, A, LDA, IPIV, WORK, INFO)
CSYTRI
subroutine xerbla(SRNAME, INFO)
XERBLA
subroutine ccopy(N, CX, INCX, CY, INCY)
CCOPY
subroutine cswap(N, CX, INCX, CY, INCY)
CSWAP