Télécharger dnconv.eso

Retour à la liste

Numérotation des lignes :

dnconv
  1. C DNCONV SOURCE BP208322 20/02/06 21:15:22 10512
  2. c-----------------------------------------------------------------------
  3. c\BeginDoc
  4. c
  5. c\Name: dnconv
  6. c
  7. c\Description:
  8. c Convergence testing for the nonsymmetric Arnoldi eigenvalue routine.
  9. c
  10. c\Usage:
  11. c call dnconv
  12. c ( N, RITZR, RITZI, BOUNDS, TOL, NCONV )
  13. c
  14. c\Arguments
  15. c N Integer. (INPUT)
  16. c Number of Ritz values to check for convergence.
  17. c
  18. c RITZR, Double precision arrays of length N. (INPUT)
  19. c RITZI Real and imaginary parts of the Ritz values to be checked
  20. c for convergence.
  21.  
  22. c BOUNDS Double precision array of length N. (INPUT)
  23. c Ritz estimates for the Ritz values in RITZR and RITZI.
  24. c
  25. c TOL Double precision scalar. (INPUT)
  26. c Desired backward error for a Ritz value to be considered
  27. c "converged".
  28. c
  29. c NCONV Integer scalar. (OUTPUT)
  30. c Number of "converged" Ritz values.
  31. c
  32. c\EndDoc
  33. c
  34. c-----------------------------------------------------------------------
  35. c
  36. c\BeginLib
  37. c
  38. c\Local variables:
  39. c xxxxxx real
  40. c
  41. c\Routines called:
  42. c arscnd ARPACK utility routine for timing. -> deleted by BP in 2020
  43. c dlamch LAPACK routine that determines machine constants.
  44. c dlapy2 LAPACK routine to compute sqrt(x**2+y**2) carefully.
  45. c
  46. c\Author
  47. c Danny Sorensen Phuong Vu
  48. c Richard Lehoucq CRPC / Rice University
  49. c Dept. of Computational & Houston, Texas
  50. c Applied Mathematics
  51. c Rice University
  52. c Houston, Texas
  53. c
  54. c\Revision history:
  55. c xx/xx/92: Version ' 2.1'
  56. c
  57. c\SCCS Information: @(#)
  58. c FILE: nconv.F SID: 2.3 DATE OF SID: 4/20/96 RELEASE: 2
  59. c
  60. c\Remarks
  61. c 1. xxxx
  62. c
  63. c\EndLib
  64. c
  65. c-----------------------------------------------------------------------
  66. c
  67. subroutine dnconv (n, ritzr, ritzi, bounds, tol, nconv)
  68. c
  69. c %----------------------------------------------------%
  70. c | Include files for debugging and timing information |
  71. c -INC TARTRAK
  72. c %----------------------------------------------------%
  73. c
  74. c
  75. c %------------------%
  76. c | Scalar Arguments |
  77. c %------------------%
  78. c
  79. integer n, nconv
  80. REAL*8
  81. & tol
  82. c
  83. c %-----------------%
  84. c | Array Arguments |
  85. c %-----------------%
  86.  
  87. REAL*8
  88. & ritzr(n), ritzi(n), bounds(n)
  89. c
  90. c %---------------%
  91. c | Local Scalars |
  92. c %---------------%
  93. c
  94. integer i
  95. REAL*8
  96. & temp, eps23
  97. c
  98. c %--------------------%
  99. c | External Functions |
  100. c %--------------------%
  101. c
  102. REAL*8
  103. external dlapy2, dlamch
  104.  
  105. c %-----------------------%
  106. c | Executable Statements |
  107. c %-----------------------%
  108. c
  109. c %-------------------------------------------------------------%
  110. c | Convergence test: unlike in the symmetric code, I am not |
  111. c | using things like refined error bounds and gap condition |
  112. c | because I don't know the exact equivalent concept. |
  113. c | |
  114. c | Instead the i-th Ritz value is considered "converged" when: |
  115. c | |
  116. c | bounds(i) .le. ( TOL * | ritz | ) |
  117. c | |
  118. c | for some appropriate choice of norm. |
  119. c %-------------------------------------------------------------%
  120. c
  121. * call arscnd (t0)
  122. c
  123. c %---------------------------------%
  124. c | Get machine dependent constant. |
  125. c %---------------------------------%
  126. c
  127. eps23 = dlamch('Epsilon-Machine')
  128. eps23 = eps23**(2.0D+0 / 3.0D+0)
  129. c
  130. nconv = 0
  131. do 20 i = 1, n
  132. temp = max( eps23, dlapy2( ritzr(i), ritzi(i) ) )
  133. if (bounds(i) .le. tol*temp) nconv = nconv + 1
  134. 20 continue
  135. c
  136. * call arscnd (t1)
  137. c tnconv = tnconv + (t1 - t0)
  138. c
  139. return
  140. c
  141. c %---------------%
  142. c | End of dnconv |
  143. c %---------------%
  144. c
  145. end
  146.  
  147.  
  148.  

© Cast3M 2003 - Tous droits réservés.
Mentions légales