dpbdi.f 2.5 KB

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