eltran.f 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. *DECK ELTRAN
  2. SUBROUTINE ELTRAN (NM, N, LOW, IGH, A, INT, Z)
  3. C***BEGIN PROLOGUE ELTRAN
  4. C***PURPOSE Accumulates the stabilized elementary similarity
  5. C transformations used in the reduction of a real general
  6. C matrix to upper Hessenberg form by ELMHES.
  7. C***LIBRARY SLATEC (EISPACK)
  8. C***CATEGORY D4C4
  9. C***TYPE SINGLE PRECISION (ELTRAN-S)
  10. C***KEYWORDS EIGENVALUES, EIGENVECTORS, EISPACK
  11. C***AUTHOR Smith, B. T., et al.
  12. C***DESCRIPTION
  13. C
  14. C This subroutine is a translation of the ALGOL procedure ELMTRANS,
  15. C NUM. MATH. 16, 181-204(1970) by Peters and Wilkinson.
  16. C HANDBOOK FOR AUTO. COMP., VOL.II-LINEAR ALGEBRA, 372-395(1971).
  17. C
  18. C This subroutine accumulates the stabilized elementary
  19. C similarity transformations used in the reduction of a
  20. C REAL GENERAL matrix to upper Hessenberg form by ELMHES.
  21. C
  22. C On INPUT
  23. C
  24. C NM must be set to the row dimension of the two-dimensional
  25. C array parameters, A and Z, as declared in the calling
  26. C program dimension statement. NM is an INTEGER variable.
  27. C
  28. C N is the order of the matrix A. N is an INTEGER variable.
  29. C N must be less than or equal to NM.
  30. C
  31. C LOW and IGH are two INTEGER variables determined by the
  32. C balancing subroutine BALANC. If BALANC has not been
  33. C used, set LOW=1 and IGH equal to the order of the matrix, N.
  34. C
  35. C A contains the multipliers which were used in the reduction
  36. C by ELMHES in its lower triangle below the subdiagonal.
  37. C A is a two-dimensional REAL array, dimensioned A(NM,IGH).
  38. C
  39. C INT contains information on the rows and columns interchanged
  40. C in the reduction by ELMHES. Only elements LOW through IGH
  41. C are used. INT is a one-dimensional INTEGER array,
  42. C dimensioned INT(IGH).
  43. C
  44. C On OUTPUT
  45. C
  46. C Z contains the transformation matrix produced in the reduction
  47. C by ELMHES. Z is a two-dimensional REAL array, dimensioned
  48. C Z(NM,N).
  49. C
  50. C Questions and comments should be directed to B. S. Garbow,
  51. C APPLIED MATHEMATICS DIVISION, ARGONNE NATIONAL LABORATORY
  52. C ------------------------------------------------------------------
  53. C
  54. C***REFERENCES B. T. Smith, J. M. Boyle, J. J. Dongarra, B. S. Garbow,
  55. C Y. Ikebe, V. C. Klema and C. B. Moler, Matrix Eigen-
  56. C system Routines - EISPACK Guide, Springer-Verlag,
  57. C 1976.
  58. C***ROUTINES CALLED (NONE)
  59. C***REVISION HISTORY (YYMMDD)
  60. C 760101 DATE WRITTEN
  61. C 890831 Modified array declarations. (WRB)
  62. C 890831 REVISION DATE from Version 3.2
  63. C 891214 Prologue converted to Version 4.0 format. (BAB)
  64. C 920501 Reformatted the REFERENCES section. (WRB)
  65. C***END PROLOGUE ELTRAN
  66. C
  67. INTEGER I,J,N,KL,MM,MP,NM,IGH,LOW,MP1
  68. REAL A(NM,*),Z(NM,*)
  69. INTEGER INT(*)
  70. C
  71. C***FIRST EXECUTABLE STATEMENT ELTRAN
  72. DO 80 I = 1, N
  73. C
  74. DO 60 J = 1, N
  75. 60 Z(I,J) = 0.0E0
  76. C
  77. Z(I,I) = 1.0E0
  78. 80 CONTINUE
  79. C
  80. KL = IGH - LOW - 1
  81. IF (KL .LT. 1) GO TO 200
  82. C .......... FOR MP=IGH-1 STEP -1 UNTIL LOW+1 DO -- ..........
  83. DO 140 MM = 1, KL
  84. MP = IGH - MM
  85. MP1 = MP + 1
  86. C
  87. DO 100 I = MP1, IGH
  88. 100 Z(I,MP) = A(I,MP-1)
  89. C
  90. I = INT(MP)
  91. IF (I .EQ. MP) GO TO 140
  92. C
  93. DO 130 J = MP, IGH
  94. Z(MP,J) = Z(I,J)
  95. Z(I,J) = 0.0E0
  96. 130 CONTINUE
  97. C
  98. Z(I,MP) = 1.0E0
  99. 140 CONTINUE
  100. C
  101. 200 RETURN
  102. END