Debian Codegraph @

debian/external_deps/fetk/punc/src/arpack/sseigt.c

raw
1 /* ./src_f77/sseigt.f -- translated by f2c (version 20030320).
2 You must link the resulting object file with the libraries:
3 -lf2c -lm (in that order)
4 */
5
6 #include <punc/vf2c.h>
7
8 /* Common Block Declarations */
9
10 struct {
11 integer logfil, ndigit, mgetv0, msaupd, msaup2, msaitr, mseigt, msapps,
12 msgets, mseupd, mnaupd, mnaup2, mnaitr, mneigh, mnapps, mngets,
13 mneupd, mcaupd, mcaup2, mcaitr, mceigh, mcapps, mcgets, mceupd;
14 } debug_SSEIGT;
15
16 #define debug_1 debug_SSEIGT
17
18 struct {
19 integer nopx, nbx, nrorth, nitref, nrstrt;
20 real tsaupd, tsaup2, tsaitr, tseigt, tsgets, tsapps, tsconv, tnaupd,
21 tnaup2, tnaitr, tneigh, tngets, tnapps, tnconv, tcaupd, tcaup2,
22 tcaitr, tceigh, tcgets, tcapps, tcconv, tmvopx, tmvbx, tgetv0,
23 titref, trvec;
24 } timing_SSEIGT;
25
26 #define timing_1 timing_SSEIGT
27
28 /* Table of constant values */
29
30 static integer c__1 = 1;
31
32 /* ----------------------------------------------------------------------- */
33 /* \BeginDoc */
34
35 /* \Name: sseigt */
36
37 /* \Description: */
38 /* Compute the eigenvalues of the current symmetric tridiagonal matrix */
39 /* and the corresponding error bounds given the current residual norm. */
40
41 /* \Usage: */
42 /* call sseigt */
43 /* ( RNORM, N, H, LDH, EIG, BOUNDS, WORKL, IERR ) */
44
45 /* \Arguments */
46 /* RNORM Real scalar. (INPUT) */
47 /* RNORM contains the residual norm corresponding to the current */
48 /* symmetric tridiagonal matrix H. */
49
50 /* N Integer. (INPUT) */
51 /* Size of the symmetric tridiagonal matrix H. */
52
53 /* H Real N by 2 array. (INPUT) */
54 /* H contains the symmetric tridiagonal matrix with the */
55 /* subdiagonal in the first column starting at H(2,1) and the */
56 /* main diagonal in second column. */
57
58 /* LDH Integer. (INPUT) */
59 /* Leading dimension of H exactly as declared in the calling */
60 /* program. */
61
62 /* EIG Real array of length N. (OUTPUT) */
63 /* On output, EIG contains the N eigenvalues of H possibly */
64 /* unsorted. The BOUNDS arrays are returned in the */
65 /* same sorted order as EIG. */
66
67 /* BOUNDS Real array of length N. (OUTPUT) */
68 /* On output, BOUNDS contains the error estimates corresponding */
69 /* to the eigenvalues EIG. This is equal to RNORM times the */
70 /* last components of the eigenvectors corresponding to the */
71 /* eigenvalues in EIG. */
72
73 /* WORKL Real work array of length 3*N. (WORKSPACE) */
74 /* Private (replicated) array on each PE or array allocated on */
75 /* the front end. */
76
77 /* IERR Integer. (OUTPUT) */
78 /* Error exit flag from sstqrb. */
79
80 /* \EndDoc */
81
82 /* ----------------------------------------------------------------------- */
83
84 /* \BeginLib */
85
86 /* \Local variables: */
87 /* xxxxxx real */
88
89 /* \Routines called: */
90 /* sstqrb ARPACK routine that computes the eigenvalues and the */
91 /* last components of the eigenvectors of a symmetric */
92 /* and tridiagonal matrix. */
93 /* second ARPACK utility routine for timing. */
94 /* svout ARPACK utility routine that prints vectors. */
95 /* scopy Level 1 BLAS that copies one vector to another. */
96
97 /* \Author */
98 /* Danny Sorensen Phuong Vu */
99 /* Richard Lehoucq CRPC / Rice University */
100 /* Dept. of Computational & Houston, Texas */
101 /* Applied Mathematics */
102 /* Rice University */
103 /* Houston, Texas */
104
105 /* \Revision history: */
106 /* xx/xx/92: Version ' 2.4' */
107
108 /* \SCCS Information: @(#) */
109 /* FILE: seigt.F SID: 2.4 DATE OF SID: 8/27/96 RELEASE: 2 */
110
111 /* \Remarks */
112 /* None */
113
114 /* \EndLib */
115
116 /* ----------------------------------------------------------------------- */
117
118 /* Subroutine */ int sseigt_(real *rnorm, integer *n, real *h__, integer *ldh,
119 real *eig, real *bounds, real *workl, integer *ierr)
120 {
121 /* System generated locals */
122 integer h_dim1, h_offset, i__1;
123 real r__1;
124
125 /* Local variables */
126 static integer k;
127 static real t0, t1;
128 extern /* Subroutine */ int scopy_(integer *, real *, integer *, real *,
129 integer *), svout_(integer *, integer *, real *, integer *, char *
130 , ftnlen), second_(real *);
131 static integer msglvl;
132 extern /* Subroutine */ int sstqrb_(integer *, real *, real *, real *,
133 real *, integer *);
134
135
136 /* %----------------------------------------------------% */
137 /* | Include files for debugging and timing information | */
138 /* %----------------------------------------------------% */
139
140
141 /* \SCCS Information: @(#) */
142 /* FILE: debug.h SID: 2.3 DATE OF SID: 11/16/95 RELEASE: 2 */
143
144 /* %---------------------------------% */
145 /* | See debug.doc for documentation | */
146 /* %---------------------------------% */
147
148 /* %------------------% */
149 /* | Scalar Arguments | */
150 /* %------------------% */
151
152 /* %--------------------------------% */
153 /* | See stat.doc for documentation | */
154 /* %--------------------------------% */
155
156 /* \SCCS Information: @(#) */
157 /* FILE: stat.h SID: 2.2 DATE OF SID: 11/16/95 RELEASE: 2 */
158
159
160
161 /* %-----------------% */
162 /* | Array Arguments | */
163 /* %-----------------% */
164
165
166 /* %------------% */
167 /* | Parameters | */
168 /* %------------% */
169
170
171 /* %---------------% */
172 /* | Local Scalars | */
173 /* %---------------% */
174
175
176 /* %----------------------% */
177 /* | External Subroutines | */
178 /* %----------------------% */
179
180
181 /* %-----------------------% */
182 /* | Executable Statements | */
183 /* %-----------------------% */
184
185 /* %-------------------------------% */
186 /* | Initialize timing statistics | */
187 /* | & message level for debugging | */
188 /* %-------------------------------% */
189
190 /* Parameter adjustments */
191 --workl;
192 --bounds;
193 --eig;
194 h_dim1 = *ldh;
195 h_offset = 1 + h_dim1;
196 h__ -= h_offset;
197
198 /* Function Body */
199 second_(&t0);
200 msglvl = debug_1.mseigt;
201
202 if (msglvl > 0) {
203 svout_(&debug_1.logfil, n, &h__[(h_dim1 << 1) + 1], &debug_1.ndigit,
204 "_seigt: main diagonal of matrix H", (ftnlen)33);
205 if (*n > 1) {
206 i__1 = *n - 1;
207 svout_(&debug_1.logfil, &i__1, &h__[h_dim1 + 2], &debug_1.ndigit,
208 "_seigt: sub diagonal of matrix H", (ftnlen)32);
209 }
210 }
211
212 scopy_(n, &h__[(h_dim1 << 1) + 1], &c__1, &eig[1], &c__1);
213 i__1 = *n - 1;
214 scopy_(&i__1, &h__[h_dim1 + 2], &c__1, &workl[1], &c__1);
215 sstqrb_(n, &eig[1], &workl[1], &bounds[1], &workl[*n + 1], ierr);
216 if (*ierr != 0) {
217 goto L9000;
218 }
219 if (msglvl > 1) {
220 svout_(&debug_1.logfil, n, &bounds[1], &debug_1.ndigit, "_seigt: las"
221 "t row of the eigenvector matrix for H", (ftnlen)48);
222 }
223
224 /* %-----------------------------------------------% */
225 /* | Finally determine the error bounds associated | */
226 /* | with the n Ritz values of H. | */
227 /* %-----------------------------------------------% */
228
229 i__1 = *n;
230 for (k = 1; k <= i__1; ++k) {
231 bounds[k] = *rnorm * (r__1 = bounds[k], dabs(r__1));
232 /* L30: */
233 }
234
235 second_(&t1);
236 timing_1.tseigt += t1 - t0;
237
238 L9000:
239 return 0;
240
241 /* %---------------% */
242 /* | End of sseigt | */
243 /* %---------------% */
244
245 } /* sseigt_ */
246