121 SUBROUTINE ssytri2x( UPLO, N, A, LDA, IPIV, WORK, NB, INFO )
130 INTEGER INFO, LDA, N, NB
134 REAL A( lda, * ), WORK( n+nb+1,* )
141 parameter ( one = 1.0e+0, zero = 0.0e+0 )
145 INTEGER I, IINFO, IP, K, CUT, NNB
149 REAL AK, AKKP1, AKP1, D, T
150 REAL U01_I_J, U01_IP1_J
151 REAL U11_I_J, U11_IP1_J
169 upper = lsame( uplo,
'U' )
170 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
172 ELSE IF( n.LT.0 )
THEN
174 ELSE IF( lda.LT.max( 1, n ) )
THEN
182 CALL xerbla(
'SSYTRI2X', -info )
191 CALL ssyconv( uplo,
'C', n, a, lda, ipiv, work, iinfo )
200 IF( ipiv( info ).GT.0 .AND. a( info, info ).EQ.zero )
208 IF( ipiv( info ).GT.0 .AND. a( info, info ).EQ.zero )
228 CALL strtri( uplo,
'U', n, a, lda, info )
233 DO WHILE ( k .LE. n )
234 IF( ipiv( k ).GT.0 )
THEN
236 work(k,invd) = one / a( k, k )
243 akp1 = a( k+1, k+1 ) / t
244 akkp1 = work(k+1,1) / t
245 d = t*( ak*akp1-one )
246 work(k,invd) = akp1 / d
247 work(k+1,invd+1) = ak / d
248 work(k,invd+1) = -akkp1 / d
249 work(k+1,invd) = -akkp1 / d
259 DO WHILE (cut .GT. 0)
261 IF (cut .LE. nnb)
THEN
267 IF (ipiv(i) .LT. 0) count=count+1
270 IF (mod(count,2) .EQ. 1) nnb=nnb+1
291 work(u11+i,j)=a(cut+i,cut+j)
298 DO WHILE (i .LE. cut)
299 IF (ipiv(i) > 0)
THEN
301 work(i,j)=work(i,invd)*work(i,j)
307 u01_ip1_j = work(i+1,j)
308 work(i,j)=work(i,invd)*u01_i_j+
309 $ work(i,invd+1)*u01_ip1_j
310 work(i+1,j)=work(i+1,invd)*u01_i_j+
311 $ work(i+1,invd+1)*u01_ip1_j
320 DO WHILE (i .LE. nnb)
321 IF (ipiv(cut+i) > 0)
THEN
323 work(u11+i,j)=work(cut+i,invd)*work(u11+i,j)
328 u11_i_j = work(u11+i,j)
329 u11_ip1_j = work(u11+i+1,j)
330 work(u11+i,j)=work(cut+i,invd)*work(u11+i,j) +
331 $ work(cut+i,invd+1)*work(u11+i+1,j)
332 work(u11+i+1,j)=work(cut+i+1,invd)*u11_i_j+
333 $ work(cut+i+1,invd+1)*u11_ip1_j
341 CALL strmm(
'L',
'U',
'T',
'U',nnb, nnb,
342 $ one,a(cut+1,cut+1),lda,work(u11+1,1),n+nb+1)
346 a(cut+i,cut+j)=work(u11+i,j)
352 CALL sgemm(
'T',
'N',nnb,nnb,cut,one,a(1,cut+1),lda,
353 $ work,n+nb+1, zero, work(u11+1,1), n+nb+1)
359 a(cut+i,cut+j)=a(cut+i,cut+j)+work(u11+i,j)
365 CALL strmm(
'L',uplo,
'T',
'U',cut, nnb,
366 $ one,a,lda,work,n+nb+1)
384 DO WHILE ( i .LE. n )
385 IF( ipiv(i) .GT. 0 )
THEN
387 IF (i .LT. ip)
CALL ssyswapr( uplo, n, a, lda, i ,ip )
388 IF (i .GT. ip)
CALL ssyswapr( uplo, n, a, lda, ip ,i )
393 $
CALL ssyswapr( uplo, n, a, lda, i-1 ,ip )
395 $
CALL ssyswapr( uplo, n, a, lda, ip ,i-1 )
405 CALL strtri( uplo,
'U', n, a, lda, info )
410 DO WHILE ( k .GE. 1 )
411 IF( ipiv( k ).GT.0 )
THEN
413 work(k,invd) = one / a( k, k )
419 ak = a( k-1, k-1 ) / t
421 akkp1 = work(k-1,1) / t
422 d = t*( ak*akp1-one )
423 work(k-1,invd) = akp1 / d
424 work(k,invd) = ak / d
425 work(k,invd+1) = -akkp1 / d
426 work(k-1,invd+1) = -akkp1 / d
436 DO WHILE (cut .LT. n)
438 IF (cut + nnb .GT. n)
THEN
444 IF (ipiv(i) .LT. 0) count=count+1
447 IF (mod(count,2) .EQ. 1) nnb=nnb+1
452 work(i,j)=a(cut+nnb+i,cut+j)
462 work(u11+i,j)=a(cut+i,cut+j)
470 IF (ipiv(cut+nnb+i) > 0)
THEN
472 work(i,j)=work(cut+nnb+i,invd)*work(i,j)
478 u01_ip1_j = work(i-1,j)
479 work(i,j)=work(cut+nnb+i,invd)*u01_i_j+
480 $ work(cut+nnb+i,invd+1)*u01_ip1_j
481 work(i-1,j)=work(cut+nnb+i-1,invd+1)*u01_i_j+
482 $ work(cut+nnb+i-1,invd)*u01_ip1_j
492 IF (ipiv(cut+i) > 0)
THEN
494 work(u11+i,j)=work(cut+i,invd)*work(u11+i,j)
499 u11_i_j = work(u11+i,j)
500 u11_ip1_j = work(u11+i-1,j)
501 work(u11+i,j)=work(cut+i,invd)*work(u11+i,j) +
502 $ work(cut+i,invd+1)*u11_ip1_j
503 work(u11+i-1,j)=work(cut+i-1,invd+1)*u11_i_j+
504 $ work(cut+i-1,invd)*u11_ip1_j
512 CALL strmm(
'L',uplo,
'T',
'U',nnb, nnb,
513 $ one,a(cut+1,cut+1),lda,work(u11+1,1),n+nb+1)
518 a(cut+i,cut+j)=work(u11+i,j)
522 IF ( (cut+nnb) .LT. n )
THEN
526 CALL sgemm(
'T',
'N',nnb,nnb,n-nnb-cut,one,a(cut+nnb+1,cut+1)
527 $ ,lda,work,n+nb+1, zero, work(u11+1,1), n+nb+1)
534 a(cut+i,cut+j)=a(cut+i,cut+j)+work(u11+i,j)
540 CALL strmm(
'L',uplo,
'T',
'U', n-nnb-cut, nnb,
541 $ one,a(cut+nnb+1,cut+nnb+1),lda,work,n+nb+1)
547 a(cut+nnb+i,cut+j)=work(i,j)
557 a(cut+i,cut+j)=work(u11+i,j)
570 DO WHILE ( i .GE. 1 )
571 IF( ipiv(i) .GT. 0 )
THEN
573 IF (i .LT. ip)
CALL ssyswapr( uplo, n, a, lda, i ,ip )
574 IF (i .GT. ip)
CALL ssyswapr( uplo, n, a, lda, ip ,i )
577 IF ( i .LT. ip)
CALL ssyswapr( uplo, n, a, lda, i ,ip )
578 IF ( i .GT. ip)
CALL ssyswapr( uplo, n, a, lda, ip ,i )
subroutine ssyconv(UPLO, WAY, N, A, LDA, IPIV, E, INFO)
SSYCONV
subroutine sgemm(TRANSA, TRANSB, M, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
SGEMM
subroutine xerbla(SRNAME, INFO)
XERBLA
subroutine strmm(SIDE, UPLO, TRANSA, DIAG, M, N, ALPHA, A, LDA, B, LDB)
STRMM
subroutine ssyswapr(UPLO, N, A, LDA, I1, I2)
SSYSWAPR applies an elementary permutation on the rows and columns of a symmetric matrix...
subroutine strtri(UPLO, DIAG, N, A, LDA, INFO)
STRTRI
subroutine ssytri2x(UPLO, N, A, LDA, IPIV, WORK, NB, INFO)
SSYTRI2X