140 COMPLEX A( LDA, * ), WORK( * )
147 parameter( cone = ( 1.0e+0, 0.0e+0 ),
148 $ czero = ( 0.0e+0, 0.0e+0 ) )
153 COMPLEX AK, AKKP1, AKP1, D, T, TEMP
158 EXTERNAL lsame, cdotu
171 upper = lsame( uplo,
'U' )
172 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
174 ELSE IF( n.LT.0 )
THEN
176 ELSE IF( lda.LT.max( 1, n ) )
THEN
180 CALL xerbla(
'CSYTRI_ROOK', -info )
195 DO 10 info = n, 1, -1
196 IF( ipiv( info ).GT.0 .AND. a( info, info ).EQ.czero )
204 IF( ipiv( info ).GT.0 .AND. a( info, info ).EQ.czero )
225 IF( ipiv( k ).GT.0 )
THEN
231 a( k, k ) = cone / a( k, k )
236 CALL ccopy( k-1, a( 1, k ), 1, work, 1 )
237 CALL csymv( uplo, k-1, -cone, a, lda, work, 1, czero,
239 a( k, k ) = a( k, k ) - cdotu( k-1, work, 1, a( 1, k ),
251 akp1 = a( k+1, k+1 ) / t
252 akkp1 = a( k, k+1 ) / t
253 d = t*( ak*akp1-cone )
255 a( k+1, k+1 ) = ak / d
256 a( k, k+1 ) = -akkp1 / d
261 CALL ccopy( k-1, a( 1, k ), 1, work, 1 )
262 CALL csymv( uplo, k-1, -cone, a, lda, work, 1, czero,
264 a( k, k ) = a( k, k ) - cdotu( k-1, work, 1, a( 1, k ),
266 a( k, k+1 ) = a( k, k+1 ) -
267 $ cdotu( k-1, a( 1, k ), 1, a( 1, k+1 ), 1 )
268 CALL ccopy( k-1, a( 1, k+1 ), 1, work, 1 )
269 CALL csymv( uplo, k-1, -cone, a, lda, work, 1, czero,
271 a( k+1, k+1 ) = a( k+1, k+1 ) -
272 $ cdotu( k-1, work, 1, a( 1, k+1 ), 1 )
277 IF( kstep.EQ.1 )
THEN
285 $
CALL cswap( kp-1, a( 1, k ), 1, a( 1, kp ), 1 )
286 CALL cswap( k-kp-1, a( kp+1, k ), 1, a( kp, kp+1 ), lda )
288 a( k, k ) = a( kp, kp )
299 $
CALL cswap( kp-1, a( 1, k ), 1, a( 1, kp ), 1 )
300 CALL cswap( k-kp-1, a( kp+1, k ), 1, a( kp, kp+1 ), lda )
303 a( k, k ) = a( kp, kp )
306 a( k, k+1 ) = a( kp, k+1 )
314 $
CALL cswap( kp-1, a( 1, k ), 1, a( 1, kp ), 1 )
315 CALL cswap( k-kp-1, a( kp+1, k ), 1, a( kp, kp+1 ), lda )
317 a( k, k ) = a( kp, kp )
341 IF( ipiv( k ).GT.0 )
THEN
347 a( k, k ) = cone / a( k, k )
352 CALL ccopy( n-k, a( k+1, k ), 1, work, 1 )
353 CALL csymv( uplo, n-k,-cone, a( k+1, k+1 ), lda, work, 1,
354 $ czero, a( k+1, k ), 1 )
355 a( k, k ) = a( k, k ) - cdotu( n-k, work, 1, a( k+1, k ),
366 ak = a( k-1, k-1 ) / t
368 akkp1 = a( k, k-1 ) / t
369 d = t*( ak*akp1-cone )
370 a( k-1, k-1 ) = akp1 / d
372 a( k, k-1 ) = -akkp1 / d
377 CALL ccopy( n-k, a( k+1, k ), 1, work, 1 )
378 CALL csymv( uplo, n-k,-cone, a( k+1, k+1 ), lda, work, 1,
379 $ czero, a( k+1, k ), 1 )
380 a( k, k ) = a( k, k ) - cdotu( n-k, work, 1, a( k+1, k ),
382 a( k, k-1 ) = a( k, k-1 ) -
383 $ cdotu( n-k, a( k+1, k ), 1, a( k+1, k-1 ),
385 CALL ccopy( n-k, a( k+1, k-1 ), 1, work, 1 )
386 CALL csymv( uplo, n-k,-cone, a( k+1, k+1 ), lda, work, 1,
387 $ czero, a( k+1, k-1 ), 1 )
388 a( k-1, k-1 ) = a( k-1, k-1 ) -
389 $ cdotu( n-k, work, 1, a( k+1, k-1 ), 1 )
394 IF( kstep.EQ.1 )
THEN
402 $
CALL cswap( n-kp, a( kp+1, k ), 1, a( kp+1, kp ), 1 )
403 CALL cswap( kp-k-1, a( k+1, k ), 1, a( kp, k+1 ), lda )
405 a( k, k ) = a( kp, kp )
416 $
CALL cswap( n-kp, a( kp+1, k ), 1, a( kp+1, kp ), 1 )
417 CALL cswap( kp-k-1, a( k+1, k ), 1, a( kp, k+1 ), lda )
420 a( k, k ) = a( kp, kp )
423 a( k, k-1 ) = a( kp, k-1 )
431 $
CALL cswap( n-kp, a( kp+1, k ), 1, a( kp+1, kp ), 1 )
432 CALL cswap( kp-k-1, a( k+1, k ), 1, a( kp, k+1 ), lda )
434 a( k, k ) = a( kp, kp )
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_rook(uplo, n, a, lda, ipiv, work, info)
CSYTRI_ROOK
subroutine cswap(n, cx, incx, cy, incy)
CSWAP