dnbdi.f 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. *DECK DNBDI
  2. SUBROUTINE DNBDI (ABE, LDA, N, ML, MU, IPVT, DET)
  3. C***BEGIN PROLOGUE DNBDI
  4. C***PURPOSE Compute the determinant of a band matrix using the factors
  5. C computed by DNBCO or DNBFA.
  6. C***LIBRARY SLATEC
  7. C***CATEGORY D3A2
  8. C***TYPE DOUBLE PRECISION (SNBDI-S, DNBDI-D, CNBDI-C)
  9. C***KEYWORDS BANDED, DETERMINANT, LINEAR EQUATIONS, NONSYMMETRIC
  10. C***AUTHOR Voorhees, E. A., (LANL)
  11. C***DESCRIPTION
  12. C
  13. C DNBDI computes the determinant of a band matrix
  14. C using the factors computed by DNBCO or DNBFA.
  15. C If the inverse is needed, use DNBSL N times.
  16. C
  17. C On Entry
  18. C
  19. C ABE DOUBLE PRECISION(LDA, NC)
  20. C the output from DNBCO or DNBFA.
  21. C NC must be .GE. 2*ML+MU+1 .
  22. C
  23. C LDA INTEGER
  24. C the leading dimension of the array ABE .
  25. C
  26. C N INTEGER
  27. C the order of the original matrix.
  28. C
  29. C ML INTEGER
  30. C number of diagonals below the main diagonal.
  31. C
  32. C MU INTEGER
  33. C number of diagonals above the main diagonal.
  34. C
  35. C IPVT INTEGER(N)
  36. C the pivot vector from DNBCO or DNBFA.
  37. C
  38. C On Return
  39. C
  40. C DET DOUBLE PRECISION(2)
  41. C determinant of original matrix.
  42. C Determinant = DET(1) * 10.0**DET(2)
  43. C with 1.0 .LE. ABS(DET(1)) .LT. 10.0
  44. C or DET(1) = 0.0 .
  45. C
  46. C***REFERENCES J. J. Dongarra, J. R. Bunch, C. B. Moler, and G. W.
  47. C Stewart, LINPACK Users' Guide, SIAM, 1979.
  48. C***ROUTINES CALLED (NONE)
  49. C***REVISION HISTORY (YYMMDD)
  50. C 800728 DATE WRITTEN
  51. C 890531 Changed all specific intrinsics to generic. (WRB)
  52. C 890831 Modified array declarations. (WRB)
  53. C 890831 REVISION DATE from Version 3.2
  54. C 891214 Prologue converted to Version 4.0 format. (BAB)
  55. C 920501 Reformatted the REFERENCES section. (WRB)
  56. C***END PROLOGUE DNBDI
  57. INTEGER LDA,N,ML,MU,IPVT(*)
  58. DOUBLE PRECISION ABE(LDA,*),DET(2)
  59. C
  60. DOUBLE PRECISION TEN
  61. INTEGER I
  62. C***FIRST EXECUTABLE STATEMENT DNBDI
  63. DET(1) = 1.0D0
  64. DET(2) = 0.0D0
  65. TEN = 10.0D0
  66. DO 50 I = 1, N
  67. IF (IPVT(I) .NE. I) DET(1) = -DET(1)
  68. DET(1) = ABE(I,ML+1)*DET(1)
  69. IF (DET(1) .EQ. 0.0D0) GO TO 60
  70. 10 IF (ABS(DET(1)) .GE. 1.0D0) GO TO 20
  71. DET(1) = TEN*DET(1)
  72. DET(2) = DET(2) - 1.0D0
  73. GO TO 10
  74. 20 CONTINUE
  75. 30 IF (ABS(DET(1)) .LT. TEN) GO TO 40
  76. DET(1) = DET(1)/TEN
  77. DET(2) = DET(2) + 1.0D0
  78. GO TO 30
  79. 40 CONTINUE
  80. 50 CONTINUE
  81. 60 CONTINUE
  82. RETURN
  83. END