119 SUBROUTINE csytri2x( UPLO, N, A, LDA, IPIV, WORK, NB, INFO )
127 INTEGER INFO, LDA, N, NB
131 COMPLEX A( LDA, * ), WORK( N+NB+1,* )
138 parameter( one = ( 1.0e+0, 0.0e+0 ),
139 $ zero = ( 0.0e+0, 0.0e+0 ) )
143 INTEGER I, IINFO, IP, K, CUT, NNB
147 COMPLEX AK, AKKP1, AKP1, D, T
148 COMPLEX U01_I_J, U01_IP1_J
149 COMPLEX U11_I_J, U11_IP1_J
167 upper = lsame( uplo,
'U' )
168 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
170 ELSE IF( n.LT.0 )
THEN
172 ELSE IF( lda.LT.max( 1, n ) )
THEN
180 CALL xerbla(
'CSYTRI2X', -info )
189 CALL csyconv( uplo,
'C', n, a, lda, ipiv, work, iinfo )
198 IF( ipiv( info ).GT.0 .AND. a( info, info ).EQ.zero )
206 IF( ipiv( info ).GT.0 .AND. a( info, info ).EQ.zero )
226 CALL ctrtri( uplo,
'U', n, a, lda, info )
231 DO WHILE ( k .LE. n )
232 IF( ipiv( k ).GT.0 )
THEN
234 work(k,invd) = one / a( k, k )
241 akp1 = a( k+1, k+1 ) / t
242 akkp1 = work(k+1,1) / t
243 d = t*( ak*akp1-one )
244 work(k,invd) = akp1 / d
245 work(k+1,invd+1) = ak / d
246 work(k,invd+1) = -akkp1 / d
247 work(k+1,invd) = -akkp1 / d
257 DO WHILE (cut .GT. 0)
259 IF (cut .LE. nnb)
THEN
265 IF (ipiv(i) .LT. 0) count=count+1
268 IF (mod(count,2) .EQ. 1) nnb=nnb+1
289 work(u11+i,j)=a(cut+i,cut+j)
296 DO WHILE (i .LE. cut)
297 IF (ipiv(i) > 0)
THEN
299 work(i,j)=work(i,invd)*work(i,j)
305 u01_ip1_j = work(i+1,j)
306 work(i,j)=work(i,invd)*u01_i_j+
307 $ work(i,invd+1)*u01_ip1_j
308 work(i+1,j)=work(i+1,invd)*u01_i_j+
309 $ work(i+1,invd+1)*u01_ip1_j
318 DO WHILE (i .LE. nnb)
319 IF (ipiv(cut+i) > 0)
THEN
321 work(u11+i,j)=work(cut+i,invd)*work(u11+i,j)
326 u11_i_j = work(u11+i,j)
327 u11_ip1_j = work(u11+i+1,j)
328 work(u11+i,j)=work(cut+i,invd)*work(u11+i,j) +
329 $ work(cut+i,invd+1)*work(u11+i+1,j)
330 work(u11+i+1,j)=work(cut+i+1,invd)*u11_i_j+
331 $ work(cut+i+1,invd+1)*u11_ip1_j
339 CALL ctrmm(
'L',
'U',
'T',
'U',nnb, nnb,
340 $ one,a(cut+1,cut+1),lda,work(u11+1,1),n+nb+1)
344 a(cut+i,cut+j)=work(u11+i,j)
350 CALL cgemm(
'T',
'N',nnb,nnb,cut,one,a(1,cut+1),lda,
351 $ work,n+nb+1, zero, work(u11+1,1), n+nb+1)
357 a(cut+i,cut+j)=a(cut+i,cut+j)+work(u11+i,j)
363 CALL ctrmm(
'L',uplo,
'T',
'U',cut, nnb,
364 $ one,a,lda,work,n+nb+1)
382 DO WHILE ( i .LE. n )
383 IF( ipiv(i) .GT. 0 )
THEN
385 IF (i .LT. ip)
CALL csyswapr( uplo, n, a, lda, i ,ip )
386 IF (i .GT. ip)
CALL csyswapr( uplo, n, a, lda, ip ,i )
391 $
CALL csyswapr( uplo, n, a, lda, i-1 ,ip )
393 $
CALL csyswapr( uplo, n, a, lda, ip ,i-1 )
403 CALL ctrtri( uplo,
'U', n, a, lda, info )
408 DO WHILE ( k .GE. 1 )
409 IF( ipiv( k ).GT.0 )
THEN
411 work(k,invd) = one / a( k, k )
417 ak = a( k-1, k-1 ) / t
419 akkp1 = work(k-1,1) / t
420 d = t*( ak*akp1-one )
421 work(k-1,invd) = akp1 / d
422 work(k,invd) = ak / d
423 work(k,invd+1) = -akkp1 / d
424 work(k-1,invd+1) = -akkp1 / d
434 DO WHILE (cut .LT. n)
436 IF (cut + nnb .GE. n)
THEN
442 IF (ipiv(i) .LT. 0) count=count+1
445 IF (mod(count,2) .EQ. 1) nnb=nnb+1
450 work(i,j)=a(cut+nnb+i,cut+j)
460 work(u11+i,j)=a(cut+i,cut+j)
468 IF (ipiv(cut+nnb+i) > 0)
THEN
470 work(i,j)=work(cut+nnb+i,invd)*work(i,j)
476 u01_ip1_j = work(i-1,j)
477 work(i,j)=work(cut+nnb+i,invd)*u01_i_j+
478 $ work(cut+nnb+i,invd+1)*u01_ip1_j
479 work(i-1,j)=work(cut+nnb+i-1,invd+1)*u01_i_j+
480 $ work(cut+nnb+i-1,invd)*u01_ip1_j
490 IF (ipiv(cut+i) > 0)
THEN
492 work(u11+i,j)=work(cut+i,invd)*work(u11+i,j)
497 u11_i_j = work(u11+i,j)
498 u11_ip1_j = work(u11+i-1,j)
499 work(u11+i,j)=work(cut+i,invd)*work(u11+i,j) +
500 $ work(cut+i,invd+1)*u11_ip1_j
501 work(u11+i-1,j)=work(cut+i-1,invd+1)*u11_i_j+
502 $ work(cut+i-1,invd)*u11_ip1_j
510 CALL ctrmm(
'L',uplo,
'T',
'U',nnb, nnb,
511 $ one,a(cut+1,cut+1),lda,work(u11+1,1),n+nb+1)
515 a(cut+i,cut+j)=work(u11+i,j)
519 IF ( (cut+nnb) .LT. n )
THEN
523 CALL cgemm(
'T',
'N',nnb,nnb,n-nnb-cut,one,a(cut+nnb+1,cut+1)
524 $ ,lda,work,n+nb+1, zero, work(u11+1,1), n+nb+1)
531 a(cut+i,cut+j)=a(cut+i,cut+j)+work(u11+i,j)
537 CALL ctrmm(
'L',uplo,
'T',
'U', n-nnb-cut, nnb,
538 $ one,a(cut+nnb+1,cut+nnb+1),lda,work,n+nb+1)
543 a(cut+nnb+i,cut+j)=work(i,j)
552 a(cut+i,cut+j)=work(u11+i,j)
565 DO WHILE ( i .GE. 1 )
566 IF( ipiv(i) .GT. 0 )
THEN
568 IF (i .LT. ip)
CALL csyswapr( uplo, n, a, lda, i ,ip )
569 IF (i .GT. ip)
CALL csyswapr( uplo, n, a, lda, ip ,i )
572 IF ( i .LT. ip)
CALL csyswapr( uplo, n, a, lda, i ,ip )
573 IF ( i .GT. ip)
CALL csyswapr( uplo, n, a, lda, ip ,i )
subroutine xerbla(srname, info)
subroutine cgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
CGEMM
subroutine csyswapr(uplo, n, a, lda, i1, i2)
CSYSWAPR
subroutine csytri2x(uplo, n, a, lda, ipiv, work, nb, info)
CSYTRI2X
subroutine csyconv(uplo, way, n, a, lda, ipiv, e, info)
CSYCONV
subroutine ctrmm(side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb)
CTRMM
subroutine ctrtri(uplo, diag, n, a, lda, info)
CTRTRI