| 1 |
c----------------------------------------------------------------------- |
| 2 |
c\BeginDoc |
| 3 |
c |
| 4 |
c\Name: dseigt |
| 5 |
c |
| 6 |
c\Description: |
| 7 |
c Compute the eigenvalues of the current symmetric tridiagonal matrix |
| 8 |
c and the corresponding error bounds given the current residual norm. |
| 9 |
c |
| 10 |
c\Usage: |
| 11 |
c call dseigt |
| 12 |
c ( RNORM, N, H, LDH, EIG, BOUNDS, WORKL, IERR ) |
| 13 |
c |
| 14 |
c\Arguments |
| 15 |
c RNORM Double precision scalar. (INPUT) |
| 16 |
c RNORM contains the residual norm corresponding to the current |
| 17 |
c symmetric tridiagonal matrix H. |
| 18 |
c |
| 19 |
c N Integer. (INPUT) |
| 20 |
c Size of the symmetric tridiagonal matrix H. |
| 21 |
c |
| 22 |
c H Double precision N by 2 array. (INPUT) |
| 23 |
c H contains the symmetric tridiagonal matrix with the |
| 24 |
c subdiagonal in the first column starting at H(2,1) and the |
| 25 |
c main diagonal in second column. |
| 26 |
c |
| 27 |
c LDH Integer. (INPUT) |
| 28 |
c Leading dimension of H exactly as declared in the calling |
| 29 |
c program. |
| 30 |
c |
| 31 |
c EIG Double precision array of length N. (OUTPUT) |
| 32 |
c On output, EIG contains the N eigenvalues of H possibly |
| 33 |
c unsorted. The BOUNDS arrays are returned in the |
| 34 |
c same sorted order as EIG. |
| 35 |
c |
| 36 |
c BOUNDS Double precision array of length N. (OUTPUT) |
| 37 |
c On output, BOUNDS contains the error estimates corresponding |
| 38 |
c to the eigenvalues EIG. This is equal to RNORM times the |
| 39 |
c last components of the eigenvectors corresponding to the |
| 40 |
c eigenvalues in EIG. |
| 41 |
c |
| 42 |
c WORKL Double precision work array of length 3*N. (WORKSPACE) |
| 43 |
c Private (replicated) array on each PE or array allocated on |
| 44 |
c the front end. |
| 45 |
c |
| 46 |
c IERR Integer. (OUTPUT) |
| 47 |
c Error exit flag from dstqrb. |
| 48 |
c |
| 49 |
c\EndDoc |
| 50 |
c |
| 51 |
c----------------------------------------------------------------------- |
| 52 |
c |
| 53 |
c\BeginLib |
| 54 |
c |
| 55 |
c\Local variables: |
| 56 |
c xxxxxx real |
| 57 |
c |
| 58 |
c\Routines called: |
| 59 |
c dstqrb ARPACK routine that computes the eigenvalues and the |
| 60 |
c last components of the eigenvectors of a symmetric |
| 61 |
c and tridiagonal matrix. |
| 62 |
c second ARPACK utility routine for timing. |
| 63 |
c dcopy Level 1 BLAS that copies one vector to another. |
| 64 |
c |
| 65 |
c\Author |
| 66 |
c Danny Sorensen Phuong Vu |
| 67 |
c Richard Lehoucq CRPC / Rice University |
| 68 |
c Dept. of Computational & Houston, Texas |
| 69 |
c Applied Mathematics |
| 70 |
c Rice University |
| 71 |
c Houston, Texas |
| 72 |
c |
| 73 |
c\Revision history: |
| 74 |
c xx/xx/92: Version ' 2.4' |
| 75 |
c |
| 76 |
c\SCCS Information: @(#) |
| 77 |
c FILE: seigt.F SID: 2.4 DATE OF SID: 8/27/96 RELEASE: 2 |
| 78 |
c |
| 79 |
c\Remarks |
| 80 |
c None |
| 81 |
c |
| 82 |
c\EndLib |
| 83 |
c |
| 84 |
c----------------------------------------------------------------------- |
| 85 |
c |
| 86 |
subroutine dseigt |
| 87 |
& ( rnorm, n, h, ldh, eig, bounds, workl, ierr ) |
| 88 |
c |
| 89 |
c %----------------------------------------------------% |
| 90 |
c | Include files for debugging and timing information | |
| 91 |
c %----------------------------------------------------% |
| 92 |
c |
| 93 |
include 'debug.h' |
| 94 |
include 'stat.h' |
| 95 |
c |
| 96 |
c %------------------% |
| 97 |
c | Scalar Arguments | |
| 98 |
c %------------------% |
| 99 |
c |
| 100 |
integer ierr, ldh, n |
| 101 |
Double precision |
| 102 |
& rnorm |
| 103 |
c |
| 104 |
c %-----------------% |
| 105 |
c | Array Arguments | |
| 106 |
c %-----------------% |
| 107 |
c |
| 108 |
Double precision |
| 109 |
& eig(n), bounds(n), h(ldh,2), workl(3*n) |
| 110 |
c |
| 111 |
c %------------% |
| 112 |
c | Parameters | |
| 113 |
c %------------% |
| 114 |
c |
| 115 |
Double precision |
| 116 |
& zero |
| 117 |
parameter (zero = 0.0D+0) |
| 118 |
c |
| 119 |
c %---------------% |
| 120 |
c | Local Scalars | |
| 121 |
c %---------------% |
| 122 |
c |
| 123 |
integer i, k, msglvl |
| 124 |
c |
| 125 |
c %----------------------% |
| 126 |
c | External Subroutines | |
| 127 |
c %----------------------% |
| 128 |
c |
| 129 |
external dcopy, dstqrb, second |
| 130 |
c |
| 131 |
c %-----------------------% |
| 132 |
c | Executable Statements | |
| 133 |
c %-----------------------% |
| 134 |
c |
| 135 |
c %-------------------------------% |
| 136 |
c | Initialize timing statistics | |
| 137 |
c | & message level for debugging | |
| 138 |
c %-------------------------------% |
| 139 |
c |
| 140 |
call second (t0) |
| 141 |
msglvl = mseigt |
| 142 |
c |
| 143 |
c if (msglvl .gt. 0) then |
| 144 |
c call dvout (logfil, n, h(1,2), ndigit, |
| 145 |
c & '_seigt: main diagonal of matrix H') |
| 146 |
c if (n .gt. 1) then |
| 147 |
c call dvout (logfil, n-1, h(2,1), ndigit, |
| 148 |
c & '_seigt: sub diagonal of matrix H') |
| 149 |
c end if |
| 150 |
c end if |
| 151 |
c |
| 152 |
call dcopy (n, h(1,2), 1, eig, 1) |
| 153 |
call dcopy (n-1, h(2,1), 1, workl, 1) |
| 154 |
call dstqrb (n, eig, workl, bounds, workl(n+1), ierr) |
| 155 |
if (ierr .ne. 0) go to 9000 |
| 156 |
c if (msglvl .gt. 1) then |
| 157 |
c call dvout (logfil, n, bounds, ndigit, |
| 158 |
c & '_seigt: last row of the eigenvector matrix for H') |
| 159 |
c end if |
| 160 |
c |
| 161 |
c %-----------------------------------------------% |
| 162 |
c | Finally determine the error bounds associated | |
| 163 |
c | with the n Ritz values of H. | |
| 164 |
c %-----------------------------------------------% |
| 165 |
c |
| 166 |
do 30 k = 1, n |
| 167 |
bounds(k) = rnorm*abs(bounds(k)) |
| 168 |
30 continue |
| 169 |
c |
| 170 |
call second (t1) |
| 171 |
tseigt = tseigt + (t1 - t0) |
| 172 |
c |
| 173 |
9000 continue |
| 174 |
return |
| 175 |
c |
| 176 |
c %---------------% |
| 177 |
c | End of dseigt | |
| 178 |
c %---------------% |
| 179 |
c |
| 180 |
end |