Debian Codegraph @

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

raw
1 /* ./src_f77/dseigt.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_DSEIGT;
15
16 #define debug_1 debug_DSEIGT
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_DSEIGT;
25
26 #define timing_1 timing_DSEIGT
27
28 /* Table of constant values */
29
30 static integer c__1 = 1;
31
32 /* ----------------------------------------------------------------------- */
33 /* \BeginDoc */
34
35 /* \Name: dseigt */
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 dseigt */
43 /* ( RNORM, N, H, LDH, EIG, BOUNDS, WORKL, IERR ) */
44
45 /* \Arguments */
46 /* RNORM Double precision 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 Double precision 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 Double precision 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 Double precision 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 Double precision 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 dstqrb. */
79
80 /* \EndDoc */
81
82 /* ----------------------------------------------------------------------- */
83
84 /* \BeginLib */
85
86 /* \Local variables: */
87 /* xxxxxx real */
88
89 /* \Routines called: */
90 /* dstqrb 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 /* dvout ARPACK utility routine that prints vectors. */
95 /* dcopy 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 dseigt_(doublereal *rnorm, integer *n, doublereal *h__,
119 integer *ldh, doublereal *eig, doublereal *bounds, doublereal *workl,
120 integer *ierr)
121 {
122 /* System generated locals */
123 integer h_dim1, h_offset, i__1;
124 doublereal d__1;
125
126 /* Local variables */
127 static integer k;
128 static real t0, t1;
129 extern /* Subroutine */ int dcopy_(integer *, doublereal *, integer *,
130 doublereal *, integer *), dvout_(integer *, integer *, doublereal
131 *, integer *, char *, ftnlen), second_(real *);
132 static integer msglvl;
133 extern /* Subroutine */ int dstqrb_(integer *, doublereal *, doublereal *,
134 doublereal *, doublereal *, integer *);
135
136
137 /* %----------------------------------------------------% */
138 /* | Include files for debugging and timing information | */
139 /* %----------------------------------------------------% */
140
141
142 /* \SCCS Information: @(#) */
143 /* FILE: debug.h SID: 2.3 DATE OF SID: 11/16/95 RELEASE: 2 */
144
145 /* %---------------------------------% */
146 /* | See debug.doc for documentation | */
147 /* %---------------------------------% */
148
149 /* %------------------% */
150 /* | Scalar Arguments | */
151 /* %------------------% */
152
153 /* %--------------------------------% */
154 /* | See stat.doc for documentation | */
155 /* %--------------------------------% */
156
157 /* \SCCS Information: @(#) */
158 /* FILE: stat.h SID: 2.2 DATE OF SID: 11/16/95 RELEASE: 2 */
159
160
161
162 /* %-----------------% */
163 /* | Array Arguments | */
164 /* %-----------------% */
165
166
167 /* %------------% */
168 /* | Parameters | */
169 /* %------------% */
170
171
172 /* %---------------% */
173 /* | Local Scalars | */
174 /* %---------------% */
175
176
177 /* %----------------------% */
178 /* | External Subroutines | */
179 /* %----------------------% */
180
181
182 /* %-----------------------% */
183 /* | Executable Statements | */
184 /* %-----------------------% */
185
186 /* %-------------------------------% */
187 /* | Initialize timing statistics | */
188 /* | & message level for debugging | */
189 /* %-------------------------------% */
190
191 /* Parameter adjustments */
192 --workl;
193 --bounds;
194 --eig;
195 h_dim1 = *ldh;
196 h_offset = 1 + h_dim1;
197 h__ -= h_offset;
198
199 /* Function Body */
200 second_(&t0);
201 msglvl = debug_1.mseigt;
202
203 if (msglvl > 0) {
204 dvout_(&debug_1.logfil, n, &h__[(h_dim1 << 1) + 1], &debug_1.ndigit,
205 "_seigt: main diagonal of matrix H", (ftnlen)33);
206 if (*n > 1) {
207 i__1 = *n - 1;
208 dvout_(&debug_1.logfil, &i__1, &h__[h_dim1 + 2], &debug_1.ndigit,
209 "_seigt: sub diagonal of matrix H", (ftnlen)32);
210 }
211 }
212
213 dcopy_(n, &h__[(h_dim1 << 1) + 1], &c__1, &eig[1], &c__1);
214 i__1 = *n - 1;
215 dcopy_(&i__1, &h__[h_dim1 + 2], &c__1, &workl[1], &c__1);
216 dstqrb_(n, &eig[1], &workl[1], &bounds[1], &workl[*n + 1], ierr);
217 if (*ierr != 0) {
218 goto L9000;
219 }
220 if (msglvl > 1) {
221 dvout_(&debug_1.logfil, n, &bounds[1], &debug_1.ndigit, "_seigt: las"
222 "t row of the eigenvector matrix for H", (ftnlen)48);
223 }
224
225 /* %-----------------------------------------------% */
226 /* | Finally determine the error bounds associated | */
227 /* | with the n Ritz values of H. | */
228 /* %-----------------------------------------------% */
229
230 i__1 = *n;
231 for (k = 1; k <= i__1; ++k) {
232 bounds[k] = *rnorm * (d__1 = bounds[k], abs(d__1));
233 /* L30: */
234 }
235
236 second_(&t1);
237 timing_1.tseigt += t1 - t0;
238
239 L9000:
240 return 0;
241
242 /* %---------------% */
243 /* | End of dseigt | */
244 /* %---------------% */
245
246 } /* dseigt_ */
247