119 SUBROUTINE dsytri2x( UPLO, N, A, LDA, IPIV, WORK, NB, INFO )
127 INTEGER INFO, LDA, N, NB
131 DOUBLE PRECISION A( LDA, * ), WORK( N+NB+1,* )
137 DOUBLE PRECISION ONE, ZERO
138 parameter( one = 1.0d+0, zero = 0.0d+0 )
142 INTEGER I, IINFO, IP, K, CUT, NNB
146 DOUBLE PRECISION AK, AKKP1, AKP1, D, T
147 DOUBLE PRECISION U01_I_J, U01_IP1_J
148 DOUBLE PRECISION U11_I_J, U11_IP1_J
166 upper = lsame( uplo,
'U' )
167 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
169 ELSE IF( n.LT.0 )
THEN
171 ELSE IF( lda.LT.max( 1, n ) )
THEN
179 CALL xerbla(
'DSYTRI2X', -info )
188 CALL dsyconv( uplo,
'C', n, a, lda, ipiv, work, iinfo )
197 IF( ipiv( info ).GT.0 .AND. a( info, info ).EQ.zero )
205 IF( ipiv( info ).GT.0 .AND. a( info, info ).EQ.zero )
225 CALL dtrtri( uplo,
'U', n, a, lda, info )
230 DO WHILE ( k .LE. n )
231 IF( ipiv( k ).GT.0 )
THEN
233 work(k,invd) = one / a( k, k )
240 akp1 = a( k+1, k+1 ) / t
241 akkp1 = work(k+1,1) / t
242 d = t*( ak*akp1-one )
243 work(k,invd) = akp1 / d
244 work(k+1,invd+1) = ak / d
245 work(k,invd+1) = -akkp1 / d
246 work(k+1,invd) = -akkp1 / d
256 DO WHILE (cut .GT. 0)
258 IF (cut .LE. nnb)
THEN
264 IF (ipiv(i) .LT. 0) count=count+1
267 IF (mod(count,2) .EQ. 1) nnb=nnb+1
288 work(u11+i,j)=a(cut+i,cut+j)
295 DO WHILE (i .LE. cut)
296 IF (ipiv(i) > 0)
THEN
298 work(i,j)=work(i,invd)*work(i,j)
304 u01_ip1_j = work(i+1,j)
305 work(i,j)=work(i,invd)*u01_i_j+
306 $ work(i,invd+1)*u01_ip1_j
307 work(i+1,j)=work(i+1,invd)*u01_i_j+
308 $ work(i+1,invd+1)*u01_ip1_j
317 DO WHILE (i .LE. nnb)
318 IF (ipiv(cut+i) > 0)
THEN
320 work(u11+i,j)=work(cut+i,invd)*work(u11+i,j)
325 u11_i_j = work(u11+i,j)
326 u11_ip1_j = work(u11+i+1,j)
327 work(u11+i,j)=work(cut+i,invd)*work(u11+i,j) +
328 $ work(cut+i,invd+1)*work(u11+i+1,j)
329 work(u11+i+1,j)=work(cut+i+1,invd)*u11_i_j+
330 $ work(cut+i+1,invd+1)*u11_ip1_j
338 CALL dtrmm(
'L',
'U',
'T',
'U',nnb, nnb,
339 $ one,a(cut+1,cut+1),lda,work(u11+1,1),n+nb+1)
343 a(cut+i,cut+j)=work(u11+i,j)
349 CALL dgemm(
'T',
'N',nnb,nnb,cut,one,a(1,cut+1),lda,
350 $ 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 dtrmm(
'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 dsyswapr( uplo, n, a, lda, i ,ip )
386 IF (i .GT. ip)
CALL dsyswapr( uplo, n, a, lda, ip ,i )
391 $
CALL dsyswapr( uplo, n, a, lda, i-1 ,ip )
393 $
CALL dsyswapr( uplo, n, a, lda, ip ,i-1 )
403 CALL dtrtri( 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 .GT. 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 dtrmm(
'L',uplo,
'T',
'U',nnb, nnb,
511 $ one,a(cut+1,cut+1),lda,work(u11+1,1),n+nb+1)
516 a(cut+i,cut+j)=work(u11+i,j)
520 IF ( (cut+nnb) .LT. n )
THEN
524 CALL dgemm(
'T',
'N',nnb,nnb,n-nnb-cut,one,a(cut+nnb+1,cut+1)
525 $ ,lda,work,n+nb+1, zero, work(u11+1,1), n+nb+1)
532 a(cut+i,cut+j)=a(cut+i,cut+j)+work(u11+i,j)
538 CALL dtrmm(
'L',uplo,
'T',
'U', n-nnb-cut, nnb,
539 $ one,a(cut+nnb+1,cut+nnb+1),lda,work,n+nb+1)
545 a(cut+nnb+i,cut+j)=work(i,j)
555 a(cut+i,cut+j)=work(u11+i,j)
568 DO WHILE ( i .GE. 1 )
569 IF( ipiv(i) .GT. 0 )
THEN
571 IF (i .LT. ip)
CALL dsyswapr( uplo, n, a, lda, i ,ip )
572 IF (i .GT. ip)
CALL dsyswapr( uplo, n, a, lda, ip ,i )
575 IF ( i .LT. ip)
CALL dsyswapr( uplo, n, a, lda, i ,ip )
576 IF ( i .GT. ip)
CALL dsyswapr( uplo, n, a, lda, ip, i )
subroutine xerbla(srname, info)
subroutine dgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
DGEMM
subroutine dsyswapr(uplo, n, a, lda, i1, i2)
DSYSWAPR applies an elementary permutation on the rows and columns of a symmetric matrix.
subroutine dsytri2x(uplo, n, a, lda, ipiv, work, nb, info)
DSYTRI2X
subroutine dsyconv(uplo, way, n, a, lda, ipiv, e, info)
DSYCONV
subroutine dtrmm(side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb)
DTRMM
subroutine dtrtri(uplo, diag, n, a, lda, info)
DTRTRI