Debian Codegraph @

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

raw
1 /* ./src_f77/dsapps.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_DSAPPS;
15
16 #define debug_1 debug_DSAPPS
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_DSAPPS;
25
26 #define timing_1 timing_DSAPPS
27
28 /* Table of constant values */
29
30 static doublereal c_b4 = 0.;
31 static doublereal c_b5 = 1.;
32 static integer c__1 = 1;
33 static doublereal c_b20 = -1.;
34
35 /* ----------------------------------------------------------------------- */
36 /* \BeginDoc */
37
38 /* \Name: dsapps */
39
40 /* \Description: */
41 /* Given the Arnoldi factorization */
42
43 /* A*V_{k} - V_{k}*H_{k} = r_{k+p}*e_{k+p}^T, */
44
45 /* apply NP shifts implicitly resulting in */
46
47 /* A*(V_{k}*Q) - (V_{k}*Q)*(Q^T* H_{k}*Q) = r_{k+p}*e_{k+p}^T * Q */
48
49 /* where Q is an orthogonal matrix of order KEV+NP. Q is the product of */
50 /* rotations resulting from the NP bulge chasing sweeps. The updated Arnoldi */
51 /* factorization becomes: */
52
53 /* A*VNEW_{k} - VNEW_{k}*HNEW_{k} = rnew_{k}*e_{k}^T. */
54
55 /* \Usage: */
56 /* call dsapps */
57 /* ( N, KEV, NP, SHIFT, V, LDV, H, LDH, RESID, Q, LDQ, WORKD ) */
58
59 /* \Arguments */
60 /* N Integer. (INPUT) */
61 /* Problem size, i.e. dimension of matrix A. */
62
63 /* KEV Integer. (INPUT) */
64 /* INPUT: KEV+NP is the size of the input matrix H. */
65 /* OUTPUT: KEV is the size of the updated matrix HNEW. */
66
67 /* NP Integer. (INPUT) */
68 /* Number of implicit shifts to be applied. */
69
70 /* SHIFT Double precision array of length NP. (INPUT) */
71 /* The shifts to be applied. */
72
73 /* V Double precision N by (KEV+NP) array. (INPUT/OUTPUT) */
74 /* INPUT: V contains the current KEV+NP Arnoldi vectors. */
75 /* OUTPUT: VNEW = V(1:n,1:KEV); the updated Arnoldi vectors */
76 /* are in the first KEV columns of V. */
77
78 /* LDV Integer. (INPUT) */
79 /* Leading dimension of V exactly as declared in the calling */
80 /* program. */
81
82 /* H Double precision (KEV+NP) by 2 array. (INPUT/OUTPUT) */
83 /* INPUT: H contains the symmetric tridiagonal matrix of the */
84 /* Arnoldi factorization with the subdiagonal in the 1st column */
85 /* starting at H(2,1) and the main diagonal in the 2nd column. */
86 /* OUTPUT: H contains the updated tridiagonal matrix in the */
87 /* KEV leading submatrix. */
88
89 /* LDH Integer. (INPUT) */
90 /* Leading dimension of H exactly as declared in the calling */
91 /* program. */
92
93 /* RESID Double precision array of length (N). (INPUT/OUTPUT) */
94 /* INPUT: RESID contains the the residual vector r_{k+p}. */
95 /* OUTPUT: RESID is the updated residual vector rnew_{k}. */
96
97 /* Q Double precision KEV+NP by KEV+NP work array. (WORKSPACE) */
98 /* Work array used to accumulate the rotations during the bulge */
99 /* chase sweep. */
100
101 /* LDQ Integer. (INPUT) */
102 /* Leading dimension of Q exactly as declared in the calling */
103 /* program. */
104
105 /* WORKD Double precision work array of length 2*N. (WORKSPACE) */
106 /* Distributed array used in the application of the accumulated */
107 /* orthogonal matrix Q. */
108
109 /* \EndDoc */
110
111 /* ----------------------------------------------------------------------- */
112
113 /* \BeginLib */
114
115 /* \Local variables: */
116 /* xxxxxx real */
117
118 /* \References: */
119 /* 1. D.C. Sorensen, "Implicit Application of Polynomial Filters in */
120 /* a k-Step Arnoldi Method", SIAM J. Matr. Anal. Apps., 13 (1992), */
121 /* pp 357-385. */
122 /* 2. R.B. Lehoucq, "Analysis and Implementation of an Implicitly */
123 /* Restarted Arnoldi Iteration", Rice University Technical Report */
124 /* TR95-13, Department of Computational and Applied Mathematics. */
125
126 /* \Routines called: */
127 /* ivout ARPACK utility routine that prints integers. */
128 /* second ARPACK utility routine for timing. */
129 /* dvout ARPACK utility routine that prints vectors. */
130 /* dlamch LAPACK routine that determines machine constants. */
131 /* dlartg LAPACK Givens rotation construction routine. */
132 /* dlacpy LAPACK matrix copy routine. */
133 /* dlaset LAPACK matrix initialization routine. */
134 /* dgemv Level 2 BLAS routine for matrix vector multiplication. */
135 /* daxpy Level 1 BLAS that computes a vector triad. */
136 /* dcopy Level 1 BLAS that copies one vector to another. */
137 /* dscal Level 1 BLAS that scales a vector. */
138
139 /* \Author */
140 /* Danny Sorensen Phuong Vu */
141 /* Richard Lehoucq CRPC / Rice University */
142 /* Dept. of Computational & Houston, Texas */
143 /* Applied Mathematics */
144 /* Rice University */
145 /* Houston, Texas */
146
147 /* \Revision history: */
148 /* 12/16/93: Version ' 2.4' */
149
150 /* \SCCS Information: @(#) */
151 /* FILE: sapps.F SID: 2.6 DATE OF SID: 3/28/97 RELEASE: 2 */
152
153 /* \Remarks */
154 /* 1. In this version, each shift is applied to all the subblocks of */
155 /* the tridiagonal matrix H and not just to the submatrix that it */
156 /* comes from. This routine assumes that the subdiagonal elements */
157 /* of H that are stored in h(1:kev+np,1) are nonegative upon input */
158 /* and enforce this condition upon output. This version incorporates */
159 /* deflation. See code for documentation. */
160
161 /* \EndLib */
162
163 /* ----------------------------------------------------------------------- */
164
165 /* Subroutine */ int dsapps_(integer *n, integer *kev, integer *np,
166 doublereal *shift, doublereal *v, integer *ldv, doublereal *h__,
167 integer *ldh, doublereal *resid, doublereal *q, integer *ldq,
168 doublereal *workd)
169 {
170 /* Initialized data */
171
172 static logical first = TRUE_;
173
174 /* System generated locals */
175 integer h_dim1, h_offset, q_dim1, q_offset, v_dim1, v_offset, i__1, i__2,
176 i__3, i__4;
177 doublereal d__1, d__2;
178
179 /* Local variables */
180 static doublereal c__, f, g;
181 static integer i__, j;
182 static doublereal r__, s, a1, a2, a3, a4;
183 static real t0, t1;
184 static integer jj;
185 static doublereal big;
186 static integer iend, itop;
187 extern /* Subroutine */ int dscal_(integer *, doublereal *, doublereal *,
188 integer *), dgemv_(char *, integer *, integer *, doublereal *,
189 doublereal *, integer *, doublereal *, integer *, doublereal *,
190 doublereal *, integer *, ftnlen), dcopy_(integer *, doublereal *,
191 integer *, doublereal *, integer *), daxpy_(integer *, doublereal
192 *, doublereal *, integer *, doublereal *, integer *), dvout_(
193 integer *, integer *, doublereal *, integer *, char *, ftnlen),
194 ivout_(integer *, integer *, integer *, integer *, char *, ftnlen)
195 ;
196 extern doublereal dlamch_(char *, ftnlen);
197 extern /* Subroutine */ int second_(real *);
198 static doublereal epsmch;
199 static integer istart, kplusp, msglvl;
200 extern /* Subroutine */ int dlacpy_(char *, integer *, integer *,
201 doublereal *, integer *, doublereal *, integer *, ftnlen),
202 dlartg_(doublereal *, doublereal *, doublereal *, doublereal *,
203 doublereal *), dlaset_(char *, integer *, integer *, doublereal *,
204 doublereal *, doublereal *, integer *, ftnlen);
205
206
207 /* %----------------------------------------------------% */
208 /* | Include files for debugging and timing information | */
209 /* %----------------------------------------------------% */
210
211
212 /* \SCCS Information: @(#) */
213 /* FILE: debug.h SID: 2.3 DATE OF SID: 11/16/95 RELEASE: 2 */
214
215 /* %---------------------------------% */
216 /* | See debug.doc for documentation | */
217 /* %---------------------------------% */
218
219 /* %------------------% */
220 /* | Scalar Arguments | */
221 /* %------------------% */
222
223 /* %--------------------------------% */
224 /* | See stat.doc for documentation | */
225 /* %--------------------------------% */
226
227 /* \SCCS Information: @(#) */
228 /* FILE: stat.h SID: 2.2 DATE OF SID: 11/16/95 RELEASE: 2 */
229
230
231
232 /* %-----------------% */
233 /* | Array Arguments | */
234 /* %-----------------% */
235
236
237 /* %------------% */
238 /* | Parameters | */
239 /* %------------% */
240
241
242 /* %---------------% */
243 /* | Local Scalars | */
244 /* %---------------% */
245
246
247
248 /* %----------------------% */
249 /* | External Subroutines | */
250 /* %----------------------% */
251
252
253 /* %--------------------% */
254 /* | External Functions | */
255 /* %--------------------% */
256
257
258 /* %----------------------% */
259 /* | Intrinsics Functions | */
260 /* %----------------------% */
261
262
263 /* %----------------% */
264 /* | Data statments | */
265 /* %----------------% */
266
267 /* Parameter adjustments */
268 --workd;
269 --resid;
270 --shift;
271 v_dim1 = *ldv;
272 v_offset = 1 + v_dim1;
273 v -= v_offset;
274 h_dim1 = *ldh;
275 h_offset = 1 + h_dim1;
276 h__ -= h_offset;
277 q_dim1 = *ldq;
278 q_offset = 1 + q_dim1;
279 q -= q_offset;
280
281 /* Function Body */
282
283 /* %-----------------------% */
284 /* | Executable Statements | */
285 /* %-----------------------% */
286
287 if (first) {
288 epsmch = dlamch_("Epsilon-Machine", (ftnlen)15);
289 first = FALSE_;
290 }
291 itop = 1;
292
293 /* %-------------------------------% */
294 /* | Initialize timing statistics | */
295 /* | & message level for debugging | */
296 /* %-------------------------------% */
297
298 second_(&t0);
299 msglvl = debug_1.msapps;
300
301 kplusp = *kev + *np;
302
303 /* %----------------------------------------------% */
304 /* | Initialize Q to the identity matrix of order | */
305 /* | kplusp used to accumulate the rotations. | */
306 /* %----------------------------------------------% */
307
308 dlaset_("All", &kplusp, &kplusp, &c_b4, &c_b5, &q[q_offset], ldq, (ftnlen)
309 3);
310
311 /* %----------------------------------------------% */
312 /* | Quick return if there are no shifts to apply | */
313 /* %----------------------------------------------% */
314
315 if (*np == 0) {
316 goto L9000;
317 }
318
319 /* %----------------------------------------------------------% */
320 /* | Apply the np shifts implicitly. Apply each shift to the | */
321 /* | whole matrix and not just to the submatrix from which it | */
322 /* | comes. | */
323 /* %----------------------------------------------------------% */
324
325 i__1 = *np;
326 for (jj = 1; jj <= i__1; ++jj) {
327
328 istart = itop;
329
330 /* %----------------------------------------------------------% */
331 /* | Check for splitting and deflation. Currently we consider | */
332 /* | an off-diagonal element h(i+1,1) negligible if | */
333 /* | h(i+1,1) .le. epsmch*( |h(i,2)| + |h(i+1,2)| ) | */
334 /* | for i=1:KEV+NP-1. | */
335 /* | If above condition tests true then we set h(i+1,1) = 0. | */
336 /* | Note that h(1:KEV+NP,1) are assumed to be non negative. | */
337 /* %----------------------------------------------------------% */
338
339 L20:
340
341 /* %------------------------------------------------% */
342 /* | The following loop exits early if we encounter | */
343 /* | a negligible off diagonal element. | */
344 /* %------------------------------------------------% */
345
346 i__2 = kplusp - 1;
347 for (i__ = istart; i__ <= i__2; ++i__) {
348 big = (d__1 = h__[i__ + (h_dim1 << 1)], abs(d__1)) + (d__2 = h__[
349 i__ + 1 + (h_dim1 << 1)], abs(d__2));
350 if (h__[i__ + 1 + h_dim1] <= epsmch * big) {
351 if (msglvl > 0) {
352 ivout_(&debug_1.logfil, &c__1, &i__, &debug_1.ndigit,
353 "_sapps: deflation at row/column no.", (ftnlen)35)
354 ;
355 ivout_(&debug_1.logfil, &c__1, &jj, &debug_1.ndigit,
356 "_sapps: occured before shift number.", (ftnlen)
357 36);
358 dvout_(&debug_1.logfil, &c__1, &h__[i__ + 1 + h_dim1], &
359 debug_1.ndigit, "_sapps: the corresponding off d"
360 "iagonal element", (ftnlen)46);
361 }
362 h__[i__ + 1 + h_dim1] = 0.;
363 iend = i__;
364 goto L40;
365 }
366 /* L30: */
367 }
368 iend = kplusp;
369 L40:
370
371 if (istart < iend) {
372
373 /* %--------------------------------------------------------% */
374 /* | Construct the plane rotation G'(istart,istart+1,theta) | */
375 /* | that attempts to drive h(istart+1,1) to zero. | */
376 /* %--------------------------------------------------------% */
377
378 f = h__[istart + (h_dim1 << 1)] - shift[jj];
379 g = h__[istart + 1 + h_dim1];
380 dlartg_(&f, &g, &c__, &s, &r__);
381
382 /* %-------------------------------------------------------% */
383 /* | Apply rotation to the left and right of H; | */
384 /* | H <- G' * H * G, where G = G(istart,istart+1,theta). | */
385 /* | This will create a "bulge". | */
386 /* %-------------------------------------------------------% */
387
388 a1 = c__ * h__[istart + (h_dim1 << 1)] + s * h__[istart + 1 +
389 h_dim1];
390 a2 = c__ * h__[istart + 1 + h_dim1] + s * h__[istart + 1 + (
391 h_dim1 << 1)];
392 a4 = c__ * h__[istart + 1 + (h_dim1 << 1)] - s * h__[istart + 1 +
393 h_dim1];
394 a3 = c__ * h__[istart + 1 + h_dim1] - s * h__[istart + (h_dim1 <<
395 1)];
396 h__[istart + (h_dim1 << 1)] = c__ * a1 + s * a2;
397 h__[istart + 1 + (h_dim1 << 1)] = c__ * a4 - s * a3;
398 h__[istart + 1 + h_dim1] = c__ * a3 + s * a4;
399
400 /* %----------------------------------------------------% */
401 /* | Accumulate the rotation in the matrix Q; Q <- Q*G | */
402 /* %----------------------------------------------------% */
403
404 /* Computing MIN */
405 i__3 = istart + jj;
406 i__2 = min(i__3,kplusp);
407 for (j = 1; j <= i__2; ++j) {
408 a1 = c__ * q[j + istart * q_dim1] + s * q[j + (istart + 1) *
409 q_dim1];
410 q[j + (istart + 1) * q_dim1] = -s * q[j + istart * q_dim1] +
411 c__ * q[j + (istart + 1) * q_dim1];
412 q[j + istart * q_dim1] = a1;
413 /* L60: */
414 }
415
416
417 /* %----------------------------------------------% */
418 /* | The following loop chases the bulge created. | */
419 /* | Note that the previous rotation may also be | */
420 /* | done within the following loop. But it is | */
421 /* | kept separate to make the distinction among | */
422 /* | the bulge chasing sweeps and the first plane | */
423 /* | rotation designed to drive h(istart+1,1) to | */
424 /* | zero. | */
425 /* %----------------------------------------------% */
426
427 i__2 = iend - 1;
428 for (i__ = istart + 1; i__ <= i__2; ++i__) {
429
430 /* %----------------------------------------------% */
431 /* | Construct the plane rotation G'(i,i+1,theta) | */
432 /* | that zeros the i-th bulge that was created | */
433 /* | by G(i-1,i,theta). g represents the bulge. | */
434 /* %----------------------------------------------% */
435
436 f = h__[i__ + h_dim1];
437 g = s * h__[i__ + 1 + h_dim1];
438
439 /* %----------------------------------% */
440 /* | Final update with G(i-1,i,theta) | */
441 /* %----------------------------------% */
442
443 h__[i__ + 1 + h_dim1] = c__ * h__[i__ + 1 + h_dim1];
444 dlartg_(&f, &g, &c__, &s, &r__);
445
446 /* %-------------------------------------------% */
447 /* | The following ensures that h(1:iend-1,1), | */
448 /* | the first iend-2 off diagonal of elements | */
449 /* | H, remain non negative. | */
450 /* %-------------------------------------------% */
451
452 if (r__ < 0.) {
453 r__ = -r__;
454 c__ = -c__;
455 s = -s;
456 }
457
458 /* %--------------------------------------------% */
459 /* | Apply rotation to the left and right of H; | */
460 /* | H <- G * H * G', where G = G(i,i+1,theta) | */
461 /* %--------------------------------------------% */
462
463 h__[i__ + h_dim1] = r__;
464
465 a1 = c__ * h__[i__ + (h_dim1 << 1)] + s * h__[i__ + 1 +
466 h_dim1];
467 a2 = c__ * h__[i__ + 1 + h_dim1] + s * h__[i__ + 1 + (h_dim1
468 << 1)];
469 a3 = c__ * h__[i__ + 1 + h_dim1] - s * h__[i__ + (h_dim1 << 1)
470 ];
471 a4 = c__ * h__[i__ + 1 + (h_dim1 << 1)] - s * h__[i__ + 1 +
472 h_dim1];
473
474 h__[i__ + (h_dim1 << 1)] = c__ * a1 + s * a2;
475 h__[i__ + 1 + (h_dim1 << 1)] = c__ * a4 - s * a3;
476 h__[i__ + 1 + h_dim1] = c__ * a3 + s * a4;
477
478 /* %----------------------------------------------------% */
479 /* | Accumulate the rotation in the matrix Q; Q <- Q*G | */
480 /* %----------------------------------------------------% */
481
482 /* Computing MIN */
483 i__4 = i__ + jj;
484 i__3 = min(i__4,kplusp);
485 for (j = 1; j <= i__3; ++j) {
486 a1 = c__ * q[j + i__ * q_dim1] + s * q[j + (i__ + 1) *
487 q_dim1];
488 q[j + (i__ + 1) * q_dim1] = -s * q[j + i__ * q_dim1] +
489 c__ * q[j + (i__ + 1) * q_dim1];
490 q[j + i__ * q_dim1] = a1;
491 /* L50: */
492 }
493
494 /* L70: */
495 }
496
497 }
498
499 /* %--------------------------% */
500 /* | Update the block pointer | */
501 /* %--------------------------% */
502
503 istart = iend + 1;
504
505 /* %------------------------------------------% */
506 /* | Make sure that h(iend,1) is non-negative | */
507 /* | If not then set h(iend,1) <-- -h(iend,1) | */
508 /* | and negate the last column of Q. | */
509 /* | We have effectively carried out a | */
510 /* | similarity on transformation H | */
511 /* %------------------------------------------% */
512
513 if (h__[iend + h_dim1] < 0.) {
514 h__[iend + h_dim1] = -h__[iend + h_dim1];
515 dscal_(&kplusp, &c_b20, &q[iend * q_dim1 + 1], &c__1);
516 }
517
518 /* %--------------------------------------------------------% */
519 /* | Apply the same shift to the next block if there is any | */
520 /* %--------------------------------------------------------% */
521
522 if (iend < kplusp) {
523 goto L20;
524 }
525
526 /* %-----------------------------------------------------% */
527 /* | Check if we can increase the the start of the block | */
528 /* %-----------------------------------------------------% */
529
530 i__2 = kplusp - 1;
531 for (i__ = itop; i__ <= i__2; ++i__) {
532 if (h__[i__ + 1 + h_dim1] > 0.) {
533 goto L90;
534 }
535 ++itop;
536 /* L80: */
537 }
538
539 /* %-----------------------------------% */
540 /* | Finished applying the jj-th shift | */
541 /* %-----------------------------------% */
542
543 L90:
544 ;
545 }
546
547 /* %------------------------------------------% */
548 /* | All shifts have been applied. Check for | */
549 /* | more possible deflation that might occur | */
550 /* | after the last shift is applied. | */
551 /* %------------------------------------------% */
552
553 i__1 = kplusp - 1;
554 for (i__ = itop; i__ <= i__1; ++i__) {
555 big = (d__1 = h__[i__ + (h_dim1 << 1)], abs(d__1)) + (d__2 = h__[i__
556 + 1 + (h_dim1 << 1)], abs(d__2));
557 if (h__[i__ + 1 + h_dim1] <= epsmch * big) {
558 if (msglvl > 0) {
559 ivout_(&debug_1.logfil, &c__1, &i__, &debug_1.ndigit, "_sapp"
560 "s: deflation at row/column no.", (ftnlen)35);
561 dvout_(&debug_1.logfil, &c__1, &h__[i__ + 1 + h_dim1], &
562 debug_1.ndigit, "_sapps: the corresponding off diago"
563 "nal element", (ftnlen)46);
564 }
565 h__[i__ + 1 + h_dim1] = 0.;
566 }
567 /* L100: */
568 }
569
570 /* %-------------------------------------------------% */
571 /* | Compute the (kev+1)-st column of (V*Q) and | */
572 /* | temporarily store the result in WORKD(N+1:2*N). | */
573 /* | This is not necessary if h(kev+1,1) = 0. | */
574 /* %-------------------------------------------------% */
575
576 if (h__[*kev + 1 + h_dim1] > 0.) {
577 dgemv_("N", n, &kplusp, &c_b5, &v[v_offset], ldv, &q[(*kev + 1) *
578 q_dim1 + 1], &c__1, &c_b4, &workd[*n + 1], &c__1, (ftnlen)1);
579 }
580
581 /* %-------------------------------------------------------% */
582 /* | Compute column 1 to kev of (V*Q) in backward order | */
583 /* | taking advantage that Q is an upper triangular matrix | */
584 /* | with lower bandwidth np. | */
585 /* | Place results in v(:,kplusp-kev:kplusp) temporarily. | */
586 /* %-------------------------------------------------------% */
587
588 i__1 = *kev;
589 for (i__ = 1; i__ <= i__1; ++i__) {
590 i__2 = kplusp - i__ + 1;
591 dgemv_("N", n, &i__2, &c_b5, &v[v_offset], ldv, &q[(*kev - i__ + 1) *
592 q_dim1 + 1], &c__1, &c_b4, &workd[1], &c__1, (ftnlen)1);
593 dcopy_(n, &workd[1], &c__1, &v[(kplusp - i__ + 1) * v_dim1 + 1], &
594 c__1);
595 /* L130: */
596 }
597
598 /* %-------------------------------------------------% */
599 /* | Move v(:,kplusp-kev+1:kplusp) into v(:,1:kev). | */
600 /* %-------------------------------------------------% */
601
602 dlacpy_("All", n, kev, &v[(*np + 1) * v_dim1 + 1], ldv, &v[v_offset], ldv,
603 (ftnlen)3);
604
605 /* %--------------------------------------------% */
606 /* | Copy the (kev+1)-st column of (V*Q) in the | */
607 /* | appropriate place if h(kev+1,1) .ne. zero. | */
608 /* %--------------------------------------------% */
609
610 if (h__[*kev + 1 + h_dim1] > 0.) {
611 dcopy_(n, &workd[*n + 1], &c__1, &v[(*kev + 1) * v_dim1 + 1], &c__1);
612 }
613
614 /* %-------------------------------------% */
615 /* | Update the residual vector: | */
616 /* | r <- sigmak*r + betak*v(:,kev+1) | */
617 /* | where | */
618 /* | sigmak = (e_{kev+p}'*Q)*e_{kev} | */
619 /* | betak = e_{kev+1}'*H*e_{kev} | */
620 /* %-------------------------------------% */
621
622 dscal_(n, &q[kplusp + *kev * q_dim1], &resid[1], &c__1);
623 if (h__[*kev + 1 + h_dim1] > 0.) {
624 daxpy_(n, &h__[*kev + 1 + h_dim1], &v[(*kev + 1) * v_dim1 + 1], &c__1,
625 &resid[1], &c__1);
626 }
627
628 if (msglvl > 1) {
629 dvout_(&debug_1.logfil, &c__1, &q[kplusp + *kev * q_dim1], &
630 debug_1.ndigit, "_sapps: sigmak of the updated residual vect"
631 "or", (ftnlen)45);
632 dvout_(&debug_1.logfil, &c__1, &h__[*kev + 1 + h_dim1], &
633 debug_1.ndigit, "_sapps: betak of the updated residual vector"
634 , (ftnlen)44);
635 dvout_(&debug_1.logfil, kev, &h__[(h_dim1 << 1) + 1], &debug_1.ndigit,
636 "_sapps: updated main diagonal of H for next iteration", (
637 ftnlen)53);
638 if (*kev > 1) {
639 i__1 = *kev - 1;
640 dvout_(&debug_1.logfil, &i__1, &h__[h_dim1 + 2], &debug_1.ndigit,
641 "_sapps: updated sub diagonal of H for next iteration", (
642 ftnlen)52);
643 }
644 }
645
646 second_(&t1);
647 timing_1.tsapps += t1 - t0;
648
649 L9000:
650 return 0;
651
652 /* %---------------% */
653 /* | End of dsapps | */
654 /* %---------------% */
655
656 } /* dsapps_ */
657