| 1 |
c----------------------------------------------------------------------- |
| 2 |
c\BeginDoc |
| 3 |
c |
| 4 |
c\Name: dsconv |
| 5 |
c |
| 6 |
c\Description: |
| 7 |
c Convergence testing for the symmetric Arnoldi eigenvalue routine. |
| 8 |
c |
| 9 |
c\Usage: |
| 10 |
c call dsconv |
| 11 |
c ( N, RITZ, BOUNDS, TOL, NCONV ) |
| 12 |
c |
| 13 |
c\Arguments |
| 14 |
c N Integer. (INPUT) |
| 15 |
c Number of Ritz values to check for convergence. |
| 16 |
c |
| 17 |
c RITZ Double precision array of length N. (INPUT) |
| 18 |
c The Ritz values to be checked for convergence. |
| 19 |
c |
| 20 |
c BOUNDS Double precision array of length N. (INPUT) |
| 21 |
c Ritz estimates associated with the Ritz values in RITZ. |
| 22 |
c |
| 23 |
c TOL Double precision scalar. (INPUT) |
| 24 |
c Desired relative accuracy for a Ritz value to be considered |
| 25 |
c "converged". |
| 26 |
c |
| 27 |
c NCONV Integer scalar. (OUTPUT) |
| 28 |
c Number of "converged" Ritz values. |
| 29 |
c |
| 30 |
c\EndDoc |
| 31 |
c |
| 32 |
c----------------------------------------------------------------------- |
| 33 |
c |
| 34 |
c\BeginLib |
| 35 |
c |
| 36 |
c\Routines called: |
| 37 |
c second ARPACK utility routine for timing. |
| 38 |
c dlamch LAPACK routine that determines machine constants. |
| 39 |
c |
| 40 |
c\Author |
| 41 |
c Danny Sorensen Phuong Vu |
| 42 |
c Richard Lehoucq CRPC / Rice University |
| 43 |
c Dept. of Computational & Houston, Texas |
| 44 |
c Applied Mathematics |
| 45 |
c Rice University |
| 46 |
c Houston, Texas |
| 47 |
c |
| 48 |
c\SCCS Information: @(#) |
| 49 |
c FILE: sconv.F SID: 2.4 DATE OF SID: 4/19/96 RELEASE: 2 |
| 50 |
c |
| 51 |
c\Remarks |
| 52 |
c 1. Starting with version 2.4, this routine no longer uses the |
| 53 |
c Parlett strategy using the gap conditions. |
| 54 |
c |
| 55 |
c\EndLib |
| 56 |
c |
| 57 |
c----------------------------------------------------------------------- |
| 58 |
c |
| 59 |
subroutine dsconv (n, ritz, bounds, tol, nconv) |
| 60 |
c |
| 61 |
c %----------------------------------------------------% |
| 62 |
c | Include files for debugging and timing information | |
| 63 |
c %----------------------------------------------------% |
| 64 |
c |
| 65 |
include 'debug.h' |
| 66 |
include 'stat.h' |
| 67 |
c |
| 68 |
c %------------------% |
| 69 |
c | Scalar Arguments | |
| 70 |
c %------------------% |
| 71 |
c |
| 72 |
integer n, nconv |
| 73 |
Double precision |
| 74 |
& tol |
| 75 |
c |
| 76 |
c %-----------------% |
| 77 |
c | Array Arguments | |
| 78 |
c %-----------------% |
| 79 |
c |
| 80 |
Double precision |
| 81 |
& ritz(n), bounds(n) |
| 82 |
c |
| 83 |
c %---------------% |
| 84 |
c | Local Scalars | |
| 85 |
c %---------------% |
| 86 |
c |
| 87 |
integer i |
| 88 |
Double precision |
| 89 |
& temp, eps23 |
| 90 |
c |
| 91 |
c %-------------------% |
| 92 |
c | External routines | |
| 93 |
c %-------------------% |
| 94 |
c |
| 95 |
Double precision |
| 96 |
& dlamch |
| 97 |
external dlamch |
| 98 |
|
| 99 |
c %---------------------% |
| 100 |
c | Intrinsic Functions | |
| 101 |
c %---------------------% |
| 102 |
c |
| 103 |
intrinsic abs |
| 104 |
c |
| 105 |
c %-----------------------% |
| 106 |
c | Executable Statements | |
| 107 |
c %-----------------------% |
| 108 |
c |
| 109 |
call second (t0) |
| 110 |
c |
| 111 |
eps23 = dlamch('Epsilon-Machine') |
| 112 |
eps23 = eps23**(2.0D+0 / 3.0D+0) |
| 113 |
c |
| 114 |
nconv = 0 |
| 115 |
do 10 i = 1, n |
| 116 |
c |
| 117 |
c %-----------------------------------------------------% |
| 118 |
c | The i-th Ritz value is considered "converged" | |
| 119 |
c | when: bounds(i) .le. TOL*max(eps23, abs(ritz(i))) | |
| 120 |
c %-----------------------------------------------------% |
| 121 |
c |
| 122 |
temp = max( eps23, abs(ritz(i)) ) |
| 123 |
if ( bounds(i) .le. tol*temp ) then |
| 124 |
nconv = nconv + 1 |
| 125 |
end if |
| 126 |
c |
| 127 |
10 continue |
| 128 |
c |
| 129 |
call second (t1) |
| 130 |
tsconv = tsconv + (t1 - t0) |
| 131 |
c |
| 132 |
return |
| 133 |
c |
| 134 |
c %---------------% |
| 135 |
c | End of dsconv | |
| 136 |
c %---------------% |
| 137 |
c |
| 138 |
end |