113 SUBROUTINE csytri( UPLO, N, A, LDA, IPIV, WORK, INFO )
125 COMPLEX A( LDA, * ), WORK( * )
132 parameter( one = ( 1.0e+0, 0.0e+0 ),
133 $ zero = ( 0.0e+0, 0.0e+0 ) )
138 COMPLEX AK, AKKP1, AKP1, D, T, TEMP
143 EXTERNAL lsame, cdotu
156 upper = lsame( uplo,
'U' )
157 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
159 ELSE IF( n.LT.0 )
THEN
161 ELSE IF( lda.LT.max( 1, n ) )
THEN
165 CALL xerbla(
'CSYTRI', -info )
180 DO 10 info = n, 1, -1
181 IF( ipiv( info ).GT.0 .AND. a( info, info ).EQ.zero )
189 IF( ipiv( info ).GT.0 .AND. a( info, info ).EQ.zero )
210 IF( ipiv( k ).GT.0 )
THEN
216 a( k, k ) = one / a( k, k )
221 CALL ccopy( k-1, a( 1, k ), 1, work, 1 )
222 CALL csymv( uplo, k-1, -one, a, lda, work, 1, zero,
224 a( k, k ) = a( k, k ) - cdotu( k-1, work, 1, a( 1, k ),
236 akp1 = a( k+1, k+1 ) / t
237 akkp1 = a( k, k+1 ) / t
238 d = t*( ak*akp1-one )
240 a( k+1, k+1 ) = ak / d
241 a( k, k+1 ) = -akkp1 / d
246 CALL ccopy( k-1, a( 1, k ), 1, work, 1 )
247 CALL csymv( uplo, k-1, -one, a, lda, work, 1, zero,
249 a( k, k ) = a( k, k ) - cdotu( k-1, work, 1, a( 1, k ),
251 a( k, k+1 ) = a( k, k+1 ) -
252 $ cdotu( k-1, a( 1, k ), 1, a( 1, k+1 ), 1 )
253 CALL ccopy( k-1, a( 1, k+1 ), 1, work, 1 )
254 CALL csymv( uplo, k-1, -one, a, lda, work, 1, zero,
256 a( k+1, k+1 ) = a( k+1, k+1 ) -
257 $ cdotu( k-1, work, 1, a( 1, k+1 ), 1 )
262 kp = abs( ipiv( k ) )
268 CALL cswap( kp-1, a( 1, k ), 1, a( 1, kp ), 1 )
269 CALL cswap( k-kp-1, a( kp+1, k ), 1, a( kp, kp+1 ), lda )
271 a( k, k ) = a( kp, kp )
273 IF( kstep.EQ.2 )
THEN
275 a( k, k+1 ) = a( kp, k+1 )
299 IF( ipiv( k ).GT.0 )
THEN
305 a( k, k ) = one / a( k, k )
310 CALL ccopy( n-k, a( k+1, k ), 1, work, 1 )
311 CALL csymv( uplo, n-k, -one, a( k+1, k+1 ), lda, work, 1,
312 $ zero, a( k+1, k ), 1 )
313 a( k, k ) = a( k, k ) - cdotu( n-k, work, 1, a( k+1, k ),
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 ccopy( n-k, a( k+1, k ), 1, work, 1 )
336 CALL csymv( uplo, n-k, -one, a( k+1, k+1 ), lda, work, 1,
337 $ zero, a( k+1, k ), 1 )
338 a( k, k ) = a( k, k ) - cdotu( n-k, work, 1, a( k+1, k ),
340 a( k, k-1 ) = a( k, k-1 ) -
341 $ cdotu( n-k, a( k+1, k ), 1, a( k+1, k-1 ),
343 CALL ccopy( n-k, a( k+1, k-1 ), 1, work, 1 )
344 CALL csymv( uplo, n-k, -one, a( k+1, k+1 ), lda, work, 1,
345 $ zero, a( k+1, k-1 ), 1 )
346 a( k-1, k-1 ) = a( k-1, k-1 ) -
347 $ cdotu( n-k, work, 1, a( k+1, k-1 ), 1 )
352 kp = abs( ipiv( k ) )
359 $
CALL cswap( n-kp, a( kp+1, k ), 1, a( kp+1, kp ), 1 )
360 CALL cswap( kp-k-1, a( k+1, k ), 1, a( kp, k+1 ), lda )
362 a( k, k ) = a( kp, kp )
364 IF( kstep.EQ.2 )
THEN
366 a( k, k-1 ) = a( kp, k-1 )
subroutine xerbla(srname, info)
subroutine ccopy(n, cx, incx, cy, incy)
CCOPY
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 cswap(n, cx, incx, cy, incy)
CSWAP