bakvec.f 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. *DECK BAKVEC
  2. SUBROUTINE BAKVEC (NM, N, T, E, M, Z, IERR)
  3. C***BEGIN PROLOGUE BAKVEC
  4. C***PURPOSE Form the eigenvectors of a certain real non-symmetric
  5. C tridiagonal matrix from a symmetric tridiagonal matrix
  6. C output from FIGI.
  7. C***LIBRARY SLATEC (EISPACK)
  8. C***CATEGORY D4C4
  9. C***TYPE SINGLE PRECISION (BAKVEC-S)
  10. C***KEYWORDS EIGENVECTORS, EISPACK
  11. C***AUTHOR Smith, B. T., et al.
  12. C***DESCRIPTION
  13. C
  14. C This subroutine forms the eigenvectors of a NONSYMMETRIC
  15. C TRIDIAGONAL matrix by back transforming those of the
  16. C corresponding symmetric matrix determined by FIGI.
  17. C
  18. C On INPUT
  19. C
  20. C NM must be set to the row dimension of the two-dimensional
  21. C array parameters, T and Z, as declared in the calling
  22. C program dimension statement. NM is an INTEGER variable.
  23. C
  24. C N is the order of the matrix T. N is an INTEGER variable.
  25. C N must be less than or equal to NM.
  26. C
  27. C T contains the nonsymmetric matrix. Its subdiagonal is
  28. C stored in the last N-1 positions of the first column,
  29. C its diagonal in the N positions of the second column,
  30. C and its superdiagonal in the first N-1 positions of
  31. C the third column. T(1,1) and T(N,3) are arbitrary.
  32. C T is a two-dimensional REAL array, dimensioned T(NM,3).
  33. C
  34. C E contains the subdiagonal elements of the symmetric
  35. C matrix in its last N-1 positions. E(1) is arbitrary.
  36. C E is a one-dimensional REAL array, dimensioned E(N).
  37. C
  38. C M is the number of eigenvectors to be back transformed.
  39. C M is an INTEGER variable.
  40. C
  41. C Z contains the eigenvectors to be back transformed
  42. C in its first M columns. Z is a two-dimensional REAL
  43. C array, dimensioned Z(NM,M).
  44. C
  45. C On OUTPUT
  46. C
  47. C T is unaltered.
  48. C
  49. C E is destroyed.
  50. C
  51. C Z contains the transformed eigenvectors in its first M columns.
  52. C
  53. C IERR is an INTEGER flag set to
  54. C Zero for normal return,
  55. C 2*N+I if E(I) is zero with T(I,1) or T(I-1,3) non-zero.
  56. C In this case, the symmetric matrix is not similar
  57. C to the original matrix, and the eigenvectors
  58. C cannot be found by this program.
  59. C
  60. C Questions and comments should be directed to B. S. Garbow,
  61. C APPLIED MATHEMATICS DIVISION, ARGONNE NATIONAL LABORATORY
  62. C ------------------------------------------------------------------
  63. C
  64. C***REFERENCES B. T. Smith, J. M. Boyle, J. J. Dongarra, B. S. Garbow,
  65. C Y. Ikebe, V. C. Klema and C. B. Moler, Matrix Eigen-
  66. C system Routines - EISPACK Guide, Springer-Verlag,
  67. C 1976.
  68. C***ROUTINES CALLED (NONE)
  69. C***REVISION HISTORY (YYMMDD)
  70. C 760101 DATE WRITTEN
  71. C 890831 Modified array declarations. (WRB)
  72. C 890831 REVISION DATE from Version 3.2
  73. C 891214 Prologue converted to Version 4.0 format. (BAB)
  74. C 920501 Reformatted the REFERENCES section. (WRB)
  75. C***END PROLOGUE BAKVEC
  76. C
  77. INTEGER I,J,M,N,NM,IERR
  78. REAL T(NM,3),E(*),Z(NM,*)
  79. C
  80. C***FIRST EXECUTABLE STATEMENT BAKVEC
  81. IERR = 0
  82. IF (M .EQ. 0) GO TO 1001
  83. E(1) = 1.0E0
  84. IF (N .EQ. 1) GO TO 1001
  85. C
  86. DO 100 I = 2, N
  87. IF (E(I) .NE. 0.0E0) GO TO 80
  88. IF (T(I,1) .NE. 0.0E0 .OR. T(I-1,3) .NE. 0.0E0) GO TO 1000
  89. E(I) = 1.0E0
  90. GO TO 100
  91. 80 E(I) = E(I-1) * E(I) / T(I-1,3)
  92. 100 CONTINUE
  93. C
  94. DO 120 J = 1, M
  95. C
  96. DO 120 I = 2, N
  97. Z(I,J) = Z(I,J) * E(I)
  98. 120 CONTINUE
  99. C
  100. GO TO 1001
  101. C .......... SET ERROR -- EIGENVECTORS CANNOT BE
  102. C FOUND BY THIS PROGRAM ..........
  103. 1000 IERR = 2 * N + I
  104. 1001 RETURN
  105. END