cpbdi.f 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. *DECK CPBDI
  2. SUBROUTINE CPBDI (ABD, LDA, N, M, DET)
  3. C***BEGIN PROLOGUE CPBDI
  4. C***PURPOSE Compute the determinant of a complex Hermitian positive
  5. C definite band matrix using the factors computed by CPBCO or
  6. C CPBFA.
  7. C***LIBRARY SLATEC (LINPACK)
  8. C***CATEGORY D3D2
  9. C***TYPE COMPLEX (SPBDI-S, DPBDI-D, CPBDI-C)
  10. C***KEYWORDS BANDED, DETERMINANT, INVERSE, LINEAR ALGEBRA, LINPACK,
  11. C MATRIX, POSITIVE DEFINITE
  12. C***AUTHOR Moler, C. B., (U. of New Mexico)
  13. C***DESCRIPTION
  14. C
  15. C CPBDI computes the determinant
  16. C of a complex Hermitian positive definite band matrix
  17. C using the factors computed by CPBCO or CPBFA.
  18. C If the inverse is needed, use CPBSL N times.
  19. C
  20. C On Entry
  21. C
  22. C ABD COMPLEX(LDA, N)
  23. C the output from CPBCO or CPBFA.
  24. C
  25. C LDA INTEGER
  26. C the leading dimension of the array ABD .
  27. C
  28. C N INTEGER
  29. C the order of the matrix A .
  30. C
  31. C M INTEGER
  32. C the number of diagonals above the main diagonal.
  33. C
  34. C On Return
  35. C
  36. C DET REAL(2)
  37. C determinant of original matrix in the form
  38. C determinant = DET(1) * 10.0**DET(2)
  39. C with 1.0 .LE. DET(1) .LT. 10.0
  40. C or DET(1) .EQ. 0.0 .
  41. C
  42. C***REFERENCES J. J. Dongarra, J. R. Bunch, C. B. Moler, and G. W.
  43. C Stewart, LINPACK Users' Guide, SIAM, 1979.
  44. C***ROUTINES CALLED (NONE)
  45. C***REVISION HISTORY (YYMMDD)
  46. C 780814 DATE WRITTEN
  47. C 890831 Modified array declarations. (WRB)
  48. C 890831 REVISION DATE from Version 3.2
  49. C 891214 Prologue converted to Version 4.0 format. (BAB)
  50. C 900326 Removed duplicate information from DESCRIPTION section.
  51. C (WRB)
  52. C 920501 Reformatted the REFERENCES section. (WRB)
  53. C***END PROLOGUE CPBDI
  54. INTEGER LDA,N,M
  55. COMPLEX ABD(LDA,*)
  56. REAL DET(2)
  57. C
  58. REAL S
  59. INTEGER I
  60. C***FIRST EXECUTABLE STATEMENT CPBDI
  61. C
  62. C COMPUTE DETERMINANT
  63. C
  64. DET(1) = 1.0E0
  65. DET(2) = 0.0E0
  66. S = 10.0E0
  67. DO 50 I = 1, N
  68. DET(1) = REAL(ABD(M+1,I))**2*DET(1)
  69. IF (DET(1) .EQ. 0.0E0) GO TO 60
  70. 10 IF (DET(1) .GE. 1.0E0) GO TO 20
  71. DET(1) = S*DET(1)
  72. DET(2) = DET(2) - 1.0E0
  73. GO TO 10
  74. 20 CONTINUE
  75. 30 IF (DET(1) .LT. S) GO TO 40
  76. DET(1) = DET(1)/S
  77. DET(2) = DET(2) + 1.0E0
  78. GO TO 30
  79. 40 CONTINUE
  80. 50 CONTINUE
  81. 60 CONTINUE
  82. RETURN
  83. END