14 typedef long long BLASLONG;
15 typedef unsigned long long BLASULONG;
17 typedef long BLASLONG;
18 typedef unsigned long BLASULONG;
22 typedef BLASLONG blasint;
24 #define blasabs(x) llabs(x)
26 #define blasabs(x) labs(x)
30 #define blasabs(x) abs(x)
33 typedef blasint integer;
35 typedef unsigned int uinteger;
36 typedef char *address;
37 typedef short int shortint;
39 typedef double doublereal;
40 typedef struct { real r, i; } complex;
41 typedef struct { doublereal r, i; } doublecomplex;
43 static inline _Fcomplex Cf(complex *z) {_Fcomplex zz={z->r , z->i}; return zz;}
44 static inline _Dcomplex Cd(doublecomplex *z) {_Dcomplex zz={z->r , z->i};return zz;}
45 static inline _Fcomplex * _pCf(complex *z) {return (_Fcomplex*)z;}
46 static inline _Dcomplex * _pCd(doublecomplex *z) {return (_Dcomplex*)z;}
48 static inline _Complex float Cf(complex *z) {return z->r + z->i*_Complex_I;}
49 static inline _Complex double Cd(doublecomplex *z) {return z->r + z->i*_Complex_I;}
50 static inline _Complex float * _pCf(complex *z) {return (_Complex float*)z;}
51 static inline _Complex double * _pCd(doublecomplex *z) {return (_Complex double*)z;}
53 #define pCf(z) (*_pCf(z))
54 #define pCd(z) (*_pCd(z))
56 typedef short int shortlogical;
57 typedef char logical1;
58 typedef char integer1;
63 /* Extern is for use with -E */
74 /*external read, write*/
83 /*internal read, write*/
113 /*rewind, backspace, endfile*/
125 ftnint *inex; /*parameters in standard's order*/
151 union Multitype { /* for multiple entry points */
162 typedef union Multitype Multitype;
164 struct Vardesc { /* for Namelist */
170 typedef struct Vardesc Vardesc;
177 typedef struct Namelist Namelist;
179 #define abs(x) ((x) >= 0 ? (x) : -(x))
180 #define dabs(x) (fabs(x))
181 #define f2cmin(a,b) ((a) <= (b) ? (a) : (b))
182 #define f2cmax(a,b) ((a) >= (b) ? (a) : (b))
183 #define dmin(a,b) (f2cmin(a,b))
184 #define dmax(a,b) (f2cmax(a,b))
185 #define bit_test(a,b) ((a) >> (b) & 1)
186 #define bit_clear(a,b) ((a) & ~((uinteger)1 << (b)))
187 #define bit_set(a,b) ((a) | ((uinteger)1 << (b)))
189 #define abort_() { sig_die("Fortran abort routine called", 1); }
190 #define c_abs(z) (cabsf(Cf(z)))
191 #define c_cos(R,Z) { pCf(R)=ccos(Cf(Z)); }
193 #define c_div(c, a, b) {Cf(c)._Val[0] = (Cf(a)._Val[0]/Cf(b)._Val[0]); Cf(c)._Val[1]=(Cf(a)._Val[1]/Cf(b)._Val[1]);}
194 #define z_div(c, a, b) {Cd(c)._Val[0] = (Cd(a)._Val[0]/Cd(b)._Val[0]); Cd(c)._Val[1]=(Cd(a)._Val[1]/df(b)._Val[1]);}
196 #define c_div(c, a, b) {pCf(c) = Cf(a)/Cf(b);}
197 #define z_div(c, a, b) {pCd(c) = Cd(a)/Cd(b);}
199 #define c_exp(R, Z) {pCf(R) = cexpf(Cf(Z));}
200 #define c_log(R, Z) {pCf(R) = clogf(Cf(Z));}
201 #define c_sin(R, Z) {pCf(R) = csinf(Cf(Z));}
202 //#define c_sqrt(R, Z) {*(R) = csqrtf(Cf(Z));}
203 #define c_sqrt(R, Z) {pCf(R) = csqrtf(Cf(Z));}
204 #define d_abs(x) (fabs(*(x)))
205 #define d_acos(x) (acos(*(x)))
206 #define d_asin(x) (asin(*(x)))
207 #define d_atan(x) (atan(*(x)))
208 #define d_atn2(x, y) (atan2(*(x),*(y)))
209 #define d_cnjg(R, Z) { pCd(R) = conj(Cd(Z)); }
210 #define r_cnjg(R, Z) { pCf(R) = conjf(Cf(Z)); }
211 #define d_cos(x) (cos(*(x)))
212 #define d_cosh(x) (cosh(*(x)))
213 #define d_dim(__a, __b) ( *(__a) > *(__b) ? *(__a) - *(__b) : 0.0 )
214 #define d_exp(x) (exp(*(x)))
215 #define d_imag(z) (cimag(Cd(z)))
216 #define r_imag(z) (cimagf(Cf(z)))
217 #define d_int(__x) (*(__x)>0 ? floor(*(__x)) : -floor(- *(__x)))
218 #define r_int(__x) (*(__x)>0 ? floor(*(__x)) : -floor(- *(__x)))
219 #define d_lg10(x) ( 0.43429448190325182765 * log(*(x)) )
220 #define r_lg10(x) ( 0.43429448190325182765 * log(*(x)) )
221 #define d_log(x) (log(*(x)))
222 #define d_mod(x, y) (fmod(*(x), *(y)))
223 #define u_nint(__x) ((__x)>=0 ? floor((__x) + .5) : -floor(.5 - (__x)))
224 #define d_nint(x) u_nint(*(x))
225 #define u_sign(__a,__b) ((__b) >= 0 ? ((__a) >= 0 ? (__a) : -(__a)) : -((__a) >= 0 ? (__a) : -(__a)))
226 #define d_sign(a,b) u_sign(*(a),*(b))
227 #define r_sign(a,b) u_sign(*(a),*(b))
228 #define d_sin(x) (sin(*(x)))
229 #define d_sinh(x) (sinh(*(x)))
230 #define d_sqrt(x) (sqrt(*(x)))
231 #define d_tan(x) (tan(*(x)))
232 #define d_tanh(x) (tanh(*(x)))
233 #define i_abs(x) abs(*(x))
234 #define i_dnnt(x) ((integer)u_nint(*(x)))
235 #define i_len(s, n) (n)
236 #define i_nint(x) ((integer)u_nint(*(x)))
237 #define i_sign(a,b) ((integer)u_sign((integer)*(a),(integer)*(b)))
238 #define pow_dd(ap, bp) ( pow(*(ap), *(bp)))
239 #define pow_si(B,E) spow_ui(*(B),*(E))
240 #define pow_ri(B,E) spow_ui(*(B),*(E))
241 #define pow_di(B,E) dpow_ui(*(B),*(E))
242 #define pow_zi(p, a, b) {pCd(p) = zpow_ui(Cd(a), *(b));}
243 #define pow_ci(p, a, b) {pCf(p) = cpow_ui(Cf(a), *(b));}
244 #define pow_zz(R,A,B) {pCd(R) = cpow(Cd(A),*(B));}
245 #define s_cat(lpp, rpp, rnp, np, llp) { ftnlen i, nc, ll; char *f__rp, *lp; ll = (llp); lp = (lpp); for(i=0; i < (int)*(np); ++i) { nc = ll; if((rnp)[i] < nc) nc = (rnp)[i]; ll -= nc; f__rp = (rpp)[i]; while(--nc >= 0) *lp++ = *(f__rp)++; } while(--ll >= 0) *lp++ = ' '; }
246 #define s_cmp(a,b,c,d) ((integer)strncmp((a),(b),f2cmin((c),(d))))
247 #define s_copy(A,B,C,D) { int __i,__m; for (__i=0, __m=f2cmin((C),(D)); __i<__m && (B)[__i] != 0; ++__i) (A)[__i] = (B)[__i]; }
248 #define sig_die(s, kill) { exit(1); }
249 #define s_stop(s, n) {exit(0);}
250 static char junk[] = "\n@(#)LIBF77 VERSION 19990503\n";
251 #define z_abs(z) (cabs(Cd(z)))
252 #define z_exp(R, Z) {pCd(R) = cexp(Cd(Z));}
253 #define z_sqrt(R, Z) {pCd(R) = csqrt(Cd(Z));}
254 #define myexit_() break;
255 #define mycycle() continue;
256 #define myceiling(w) {ceil(w)}
257 #define myhuge(w) {HUGE_VAL}
258 //#define mymaxloc_(w,s,e,n) {if (sizeof(*(w)) == sizeof(double)) dmaxloc_((w),*(s),*(e),n); else dmaxloc_((w),*(s),*(e),n);}
259 #define mymaxloc(w,s,e,n) {dmaxloc_(w,*(s),*(e),n)}
261 /* procedure parameter types for -A and -C++ */
263 #define F2C_proc_par_types 1
265 typedef logical (*L_fp)(...);
267 typedef logical (*L_fp)();
270 static float spow_ui(float x, integer n) {
271 float pow=1.0; unsigned long int u;
273 if(n < 0) n = -n, x = 1/x;
282 static double dpow_ui(double x, integer n) {
283 double pow=1.0; unsigned long int u;
285 if(n < 0) n = -n, x = 1/x;
295 static _Fcomplex cpow_ui(complex x, integer n) {
296 complex pow={1.0,0.0}; unsigned long int u;
298 if(n < 0) n = -n, x.r = 1/x.r, x.i=1/x.i;
300 if(u & 01) pow.r *= x.r, pow.i *= x.i;
301 if(u >>= 1) x.r *= x.r, x.i *= x.i;
305 _Fcomplex p={pow.r, pow.i};
309 static _Complex float cpow_ui(_Complex float x, integer n) {
310 _Complex float pow=1.0; unsigned long int u;
312 if(n < 0) n = -n, x = 1/x;
323 static _Dcomplex zpow_ui(_Dcomplex x, integer n) {
324 _Dcomplex pow={1.0,0.0}; unsigned long int u;
326 if(n < 0) n = -n, x._Val[0] = 1/x._Val[0], x._Val[1] =1/x._Val[1];
328 if(u & 01) pow._Val[0] *= x._Val[0], pow._Val[1] *= x._Val[1];
329 if(u >>= 1) x._Val[0] *= x._Val[0], x._Val[1] *= x._Val[1];
333 _Dcomplex p = {pow._Val[0], pow._Val[1]};
337 static _Complex double zpow_ui(_Complex double x, integer n) {
338 _Complex double pow=1.0; unsigned long int u;
340 if(n < 0) n = -n, x = 1/x;
350 static integer pow_ii(integer x, integer n) {
351 integer pow; unsigned long int u;
353 if (n == 0 || x == 1) pow = 1;
354 else if (x != -1) pow = x == 0 ? 1/x : 0;
357 if ((n > 0) || !(n == 0 || x == 1 || x != -1)) {
367 static integer dmaxloc_(double *w, integer s, integer e, integer *n)
369 double m; integer i, mi;
370 for(m=w[s-1], mi=s, i=s+1; i<=e; i++)
371 if (w[i-1]>m) mi=i ,m=w[i-1];
374 static integer smaxloc_(float *w, integer s, integer e, integer *n)
376 float m; integer i, mi;
377 for(m=w[s-1], mi=s, i=s+1; i<=e; i++)
378 if (w[i-1]>m) mi=i ,m=w[i-1];
381 static inline void cdotc_(complex *z, integer *n_, complex *x, integer *incx_, complex *y, integer *incy_) {
382 integer n = *n_, incx = *incx_, incy = *incy_, i;
384 _Fcomplex zdotc = {0.0, 0.0};
385 if (incx == 1 && incy == 1) {
386 for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
387 zdotc._Val[0] += conjf(Cf(&x[i]))._Val[0] * Cf(&y[i])._Val[0];
388 zdotc._Val[1] += conjf(Cf(&x[i]))._Val[1] * Cf(&y[i])._Val[1];
391 for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
392 zdotc._Val[0] += conjf(Cf(&x[i*incx]))._Val[0] * Cf(&y[i*incy])._Val[0];
393 zdotc._Val[1] += conjf(Cf(&x[i*incx]))._Val[1] * Cf(&y[i*incy])._Val[1];
399 _Complex float zdotc = 0.0;
400 if (incx == 1 && incy == 1) {
401 for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
402 zdotc += conjf(Cf(&x[i])) * Cf(&y[i]);
405 for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
406 zdotc += conjf(Cf(&x[i*incx])) * Cf(&y[i*incy]);
412 static inline void zdotc_(doublecomplex *z, integer *n_, doublecomplex *x, integer *incx_, doublecomplex *y, integer *incy_) {
413 integer n = *n_, incx = *incx_, incy = *incy_, i;
415 _Dcomplex zdotc = {0.0, 0.0};
416 if (incx == 1 && incy == 1) {
417 for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
418 zdotc._Val[0] += conj(Cd(&x[i]))._Val[0] * Cd(&y[i])._Val[0];
419 zdotc._Val[1] += conj(Cd(&x[i]))._Val[1] * Cd(&y[i])._Val[1];
422 for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
423 zdotc._Val[0] += conj(Cd(&x[i*incx]))._Val[0] * Cd(&y[i*incy])._Val[0];
424 zdotc._Val[1] += conj(Cd(&x[i*incx]))._Val[1] * Cd(&y[i*incy])._Val[1];
430 _Complex double zdotc = 0.0;
431 if (incx == 1 && incy == 1) {
432 for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
433 zdotc += conj(Cd(&x[i])) * Cd(&y[i]);
436 for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
437 zdotc += conj(Cd(&x[i*incx])) * Cd(&y[i*incy]);
443 static inline void cdotu_(complex *z, integer *n_, complex *x, integer *incx_, complex *y, integer *incy_) {
444 integer n = *n_, incx = *incx_, incy = *incy_, i;
446 _Fcomplex zdotc = {0.0, 0.0};
447 if (incx == 1 && incy == 1) {
448 for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
449 zdotc._Val[0] += Cf(&x[i])._Val[0] * Cf(&y[i])._Val[0];
450 zdotc._Val[1] += Cf(&x[i])._Val[1] * Cf(&y[i])._Val[1];
453 for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
454 zdotc._Val[0] += Cf(&x[i*incx])._Val[0] * Cf(&y[i*incy])._Val[0];
455 zdotc._Val[1] += Cf(&x[i*incx])._Val[1] * Cf(&y[i*incy])._Val[1];
461 _Complex float zdotc = 0.0;
462 if (incx == 1 && incy == 1) {
463 for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
464 zdotc += Cf(&x[i]) * Cf(&y[i]);
467 for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
468 zdotc += Cf(&x[i*incx]) * Cf(&y[i*incy]);
474 static inline void zdotu_(doublecomplex *z, integer *n_, doublecomplex *x, integer *incx_, doublecomplex *y, integer *incy_) {
475 integer n = *n_, incx = *incx_, incy = *incy_, i;
477 _Dcomplex zdotc = {0.0, 0.0};
478 if (incx == 1 && incy == 1) {
479 for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
480 zdotc._Val[0] += Cd(&x[i])._Val[0] * Cd(&y[i])._Val[0];
481 zdotc._Val[1] += Cd(&x[i])._Val[1] * Cd(&y[i])._Val[1];
484 for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
485 zdotc._Val[0] += Cd(&x[i*incx])._Val[0] * Cd(&y[i*incy])._Val[0];
486 zdotc._Val[1] += Cd(&x[i*incx])._Val[1] * Cd(&y[i*incy])._Val[1];
492 _Complex double zdotc = 0.0;
493 if (incx == 1 && incy == 1) {
494 for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
495 zdotc += Cd(&x[i]) * Cd(&y[i]);
498 for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
499 zdotc += Cd(&x[i*incx]) * Cd(&y[i*incy]);
505 /* -- translated by f2c (version 20000121).
506 You must link the resulting object file with the libraries:
507 -lf2c -lm (in that order)
513 /* Table of constant values */
515 static complex c_b1 = {0.f,0.f};
516 static complex c_b2 = {1.f,0.f};
517 static integer c__1 = 1;
519 /* > \brief \b CTGEVC */
521 /* =========== DOCUMENTATION =========== */
523 /* Online html documentation available at */
524 /* http://www.netlib.org/lapack/explore-html/ */
527 /* > Download CTGEVC + dependencies */
528 /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/ctgevc.
531 /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/ctgevc.
534 /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ctgevc.
542 /* SUBROUTINE CTGEVC( SIDE, HOWMNY, SELECT, N, S, LDS, P, LDP, VL, */
543 /* LDVL, VR, LDVR, MM, M, WORK, RWORK, INFO ) */
545 /* CHARACTER HOWMNY, SIDE */
546 /* INTEGER INFO, LDP, LDS, LDVL, LDVR, M, MM, N */
547 /* LOGICAL SELECT( * ) */
548 /* REAL RWORK( * ) */
549 /* COMPLEX P( LDP, * ), S( LDS, * ), VL( LDVL, * ), */
550 /* $ VR( LDVR, * ), WORK( * ) */
554 /* > \par Purpose: */
559 /* > CTGEVC computes some or all of the right and/or left eigenvectors of */
560 /* > a pair of complex matrices (S,P), where S and P are upper triangular. */
561 /* > Matrix pairs of this type are produced by the generalized Schur */
562 /* > factorization of a complex matrix pair (A,B): */
564 /* > A = Q*S*Z**H, B = Q*P*Z**H */
566 /* > as computed by CGGHRD + CHGEQZ. */
568 /* > The right eigenvector x and the left eigenvector y of (S,P) */
569 /* > corresponding to an eigenvalue w are defined by: */
571 /* > S*x = w*P*x, (y**H)*S = w*(y**H)*P, */
573 /* > where y**H denotes the conjugate tranpose of y. */
574 /* > The eigenvalues are not input to this routine, but are computed */
575 /* > directly from the diagonal elements of S and P. */
577 /* > This routine returns the matrices X and/or Y of right and left */
578 /* > eigenvectors of (S,P), or the products Z*X and/or Q*Y, */
579 /* > where Z and Q are input matrices. */
580 /* > If Q and Z are the unitary factors from the generalized Schur */
581 /* > factorization of a matrix pair (A,B), then Z*X and Q*Y */
582 /* > are the matrices of right and left eigenvectors of (A,B). */
588 /* > \param[in] SIDE */
590 /* > SIDE is CHARACTER*1 */
591 /* > = 'R': compute right eigenvectors only; */
592 /* > = 'L': compute left eigenvectors only; */
593 /* > = 'B': compute both right and left eigenvectors. */
596 /* > \param[in] HOWMNY */
598 /* > HOWMNY is CHARACTER*1 */
599 /* > = 'A': compute all right and/or left eigenvectors; */
600 /* > = 'B': compute all right and/or left eigenvectors, */
601 /* > backtransformed by the matrices in VR and/or VL; */
602 /* > = 'S': compute selected right and/or left eigenvectors, */
603 /* > specified by the logical array SELECT. */
606 /* > \param[in] SELECT */
608 /* > SELECT is LOGICAL array, dimension (N) */
609 /* > If HOWMNY='S', SELECT specifies the eigenvectors to be */
610 /* > computed. The eigenvector corresponding to the j-th */
611 /* > eigenvalue is computed if SELECT(j) = .TRUE.. */
612 /* > Not referenced if HOWMNY = 'A' or 'B'. */
618 /* > The order of the matrices S and P. N >= 0. */
623 /* > S is COMPLEX array, dimension (LDS,N) */
624 /* > The upper triangular matrix S from a generalized Schur */
625 /* > factorization, as computed by CHGEQZ. */
628 /* > \param[in] LDS */
630 /* > LDS is INTEGER */
631 /* > The leading dimension of array S. LDS >= f2cmax(1,N). */
636 /* > P is COMPLEX array, dimension (LDP,N) */
637 /* > The upper triangular matrix P from a generalized Schur */
638 /* > factorization, as computed by CHGEQZ. P must have real */
639 /* > diagonal elements. */
642 /* > \param[in] LDP */
644 /* > LDP is INTEGER */
645 /* > The leading dimension of array P. LDP >= f2cmax(1,N). */
648 /* > \param[in,out] VL */
650 /* > VL is COMPLEX array, dimension (LDVL,MM) */
651 /* > On entry, if SIDE = 'L' or 'B' and HOWMNY = 'B', VL must */
652 /* > contain an N-by-N matrix Q (usually the unitary matrix Q */
653 /* > of left Schur vectors returned by CHGEQZ). */
654 /* > On exit, if SIDE = 'L' or 'B', VL contains: */
655 /* > if HOWMNY = 'A', the matrix Y of left eigenvectors of (S,P); */
656 /* > if HOWMNY = 'B', the matrix Q*Y; */
657 /* > if HOWMNY = 'S', the left eigenvectors of (S,P) specified by */
658 /* > SELECT, stored consecutively in the columns of */
659 /* > VL, in the same order as their eigenvalues. */
660 /* > Not referenced if SIDE = 'R'. */
663 /* > \param[in] LDVL */
665 /* > LDVL is INTEGER */
666 /* > The leading dimension of array VL. LDVL >= 1, and if */
667 /* > SIDE = 'L' or 'l' or 'B' or 'b', LDVL >= N. */
670 /* > \param[in,out] VR */
672 /* > VR is COMPLEX array, dimension (LDVR,MM) */
673 /* > On entry, if SIDE = 'R' or 'B' and HOWMNY = 'B', VR must */
674 /* > contain an N-by-N matrix Q (usually the unitary matrix Z */
675 /* > of right Schur vectors returned by CHGEQZ). */
676 /* > On exit, if SIDE = 'R' or 'B', VR contains: */
677 /* > if HOWMNY = 'A', the matrix X of right eigenvectors of (S,P); */
678 /* > if HOWMNY = 'B', the matrix Z*X; */
679 /* > if HOWMNY = 'S', the right eigenvectors of (S,P) specified by */
680 /* > SELECT, stored consecutively in the columns of */
681 /* > VR, in the same order as their eigenvalues. */
682 /* > Not referenced if SIDE = 'L'. */
685 /* > \param[in] LDVR */
687 /* > LDVR is INTEGER */
688 /* > The leading dimension of the array VR. LDVR >= 1, and if */
689 /* > SIDE = 'R' or 'B', LDVR >= N. */
692 /* > \param[in] MM */
694 /* > MM is INTEGER */
695 /* > The number of columns in the arrays VL and/or VR. MM >= M. */
698 /* > \param[out] M */
701 /* > The number of columns in the arrays VL and/or VR actually */
702 /* > used to store the eigenvectors. If HOWMNY = 'A' or 'B', M */
703 /* > is set to N. Each selected eigenvector occupies one column. */
706 /* > \param[out] WORK */
708 /* > WORK is COMPLEX array, dimension (2*N) */
711 /* > \param[out] RWORK */
713 /* > RWORK is REAL array, dimension (2*N) */
716 /* > \param[out] INFO */
718 /* > INFO is INTEGER */
719 /* > = 0: successful exit. */
720 /* > < 0: if INFO = -i, the i-th argument had an illegal value. */
726 /* > \author Univ. of Tennessee */
727 /* > \author Univ. of California Berkeley */
728 /* > \author Univ. of Colorado Denver */
729 /* > \author NAG Ltd. */
731 /* > \date December 2016 */
733 /* > \ingroup complexGEcomputational */
735 /* ===================================================================== */
736 /* Subroutine */ int ctgevc_(char *side, char *howmny, logical *select,
737 integer *n, complex *s, integer *lds, complex *p, integer *ldp,
738 complex *vl, integer *ldvl, complex *vr, integer *ldvr, integer *mm,
739 integer *m, complex *work, real *rwork, integer *info)
741 /* System generated locals */
742 integer p_dim1, p_offset, s_dim1, s_offset, vl_dim1, vl_offset, vr_dim1,
743 vr_offset, i__1, i__2, i__3, i__4, i__5;
744 real r__1, r__2, r__3, r__4, r__5, r__6;
745 complex q__1, q__2, q__3, q__4;
747 /* Local variables */
748 integer ibeg, ieig, iend;
760 extern logical lsame_(char *, char *);
761 extern /* Subroutine */ int cgemv_(char *, integer *, integer *, complex *
762 , complex *, integer *, complex *, integer *, complex *, complex *
776 extern /* Subroutine */ int slabad_(real *, real *);
779 extern /* Complex */ VOID cladiv_(complex *, complex *, complex *);
780 extern real slamch_(char *);
783 extern /* Subroutine */ int xerbla_(char *, integer *, ftnlen);
793 /* -- LAPACK computational routine (version 3.7.0) -- */
794 /* -- LAPACK is a software package provided by Univ. of Tennessee, -- */
795 /* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- */
800 /* ===================================================================== */
803 /* Decode and Test the input parameters */
805 /* Parameter adjustments */
808 s_offset = 1 + s_dim1 * 1;
811 p_offset = 1 + p_dim1 * 1;
814 vl_offset = 1 + vl_dim1 * 1;
817 vr_offset = 1 + vr_dim1 * 1;
823 if (lsame_(howmny, "A")) {
827 } else if (lsame_(howmny, "S")) {
831 } else if (lsame_(howmny, "B")) {
839 if (lsame_(side, "R")) {
843 } else if (lsame_(side, "L")) {
847 } else if (lsame_(side, "B")) {
858 } else if (ihwmny < 0) {
862 } else if (*lds < f2cmax(1,*n)) {
864 } else if (*ldp < f2cmax(1,*n)) {
869 xerbla_("CTGEVC", &i__1, (ftnlen)6);
873 /* Count the number of eigenvectors */
878 for (j = 1; j <= i__1; ++j) {
888 /* Check diagonal of B */
892 for (j = 1; j <= i__1; ++j) {
893 if (r_imag(&p[j + j * p_dim1]) != 0.f) {
901 } else if (compl && *ldvl < *n || *ldvl < 1) {
903 } else if (compr && *ldvr < *n || *ldvr < 1) {
905 } else if (*mm < im) {
910 xerbla_("CTGEVC", &i__1, (ftnlen)6);
914 /* Quick return if possible */
921 /* Machine Constants */
923 safmin = slamch_("Safe minimum");
925 slabad_(&safmin, &big);
926 ulp = slamch_("Epsilon") * slamch_("Base");
927 small = safmin * *n / ulp;
929 bignum = 1.f / (safmin * *n);
931 /* Compute the 1-norm of each column of the strictly upper triangular */
932 /* part of A and B to check for possible overflow in the triangular */
936 anorm = (r__1 = s[i__1].r, abs(r__1)) + (r__2 = r_imag(&s[s_dim1 + 1]),
939 bnorm = (r__1 = p[i__1].r, abs(r__1)) + (r__2 = r_imag(&p[p_dim1 + 1]),
944 for (j = 2; j <= i__1; ++j) {
948 for (i__ = 1; i__ <= i__2; ++i__) {
949 i__3 = i__ + j * s_dim1;
950 rwork[j] += (r__1 = s[i__3].r, abs(r__1)) + (r__2 = r_imag(&s[i__
951 + j * s_dim1]), abs(r__2));
952 i__3 = i__ + j * p_dim1;
953 rwork[*n + j] += (r__1 = p[i__3].r, abs(r__1)) + (r__2 = r_imag(&
954 p[i__ + j * p_dim1]), abs(r__2));
958 i__2 = j + j * s_dim1;
959 r__3 = anorm, r__4 = rwork[j] + ((r__1 = s[i__2].r, abs(r__1)) + (
960 r__2 = r_imag(&s[j + j * s_dim1]), abs(r__2)));
961 anorm = f2cmax(r__3,r__4);
963 i__2 = j + j * p_dim1;
964 r__3 = bnorm, r__4 = rwork[*n + j] + ((r__1 = p[i__2].r, abs(r__1)) +
965 (r__2 = r_imag(&p[j + j * p_dim1]), abs(r__2)));
966 bnorm = f2cmax(r__3,r__4);
970 ascale = 1.f / f2cmax(anorm,safmin);
971 bscale = 1.f / f2cmax(bnorm,safmin);
973 /* Left eigenvectors */
978 /* Main loop over eigenvalues */
981 for (je = 1; je <= i__1; ++je) {
990 i__2 = je + je * s_dim1;
991 i__3 = je + je * p_dim1;
992 if ((r__2 = s[i__2].r, abs(r__2)) + (r__3 = r_imag(&s[je + je
993 * s_dim1]), abs(r__3)) <= safmin && (r__1 = p[i__3].r,
994 abs(r__1)) <= safmin) {
996 /* Singular matrix pencil -- return unit eigenvector */
999 for (jr = 1; jr <= i__2; ++jr) {
1000 i__3 = jr + ieig * vl_dim1;
1001 vl[i__3].r = 0.f, vl[i__3].i = 0.f;
1004 i__2 = ieig + ieig * vl_dim1;
1005 vl[i__2].r = 1.f, vl[i__2].i = 0.f;
1009 /* Non-singular eigenvalue: */
1010 /* Compute coefficients a and b in */
1012 /* y ( a A - b B ) = 0 */
1015 i__2 = je + je * s_dim1;
1016 i__3 = je + je * p_dim1;
1017 r__4 = ((r__2 = s[i__2].r, abs(r__2)) + (r__3 = r_imag(&s[je
1018 + je * s_dim1]), abs(r__3))) * ascale, r__5 = (r__1 =
1019 p[i__3].r, abs(r__1)) * bscale, r__4 = f2cmax(r__4,r__5);
1020 temp = 1.f / f2cmax(r__4,safmin);
1021 i__2 = je + je * s_dim1;
1022 q__2.r = temp * s[i__2].r, q__2.i = temp * s[i__2].i;
1023 q__1.r = ascale * q__2.r, q__1.i = ascale * q__2.i;
1024 salpha.r = q__1.r, salpha.i = q__1.i;
1025 i__2 = je + je * p_dim1;
1026 sbeta = temp * p[i__2].r * bscale;
1027 acoeff = sbeta * ascale;
1028 q__1.r = bscale * salpha.r, q__1.i = bscale * salpha.i;
1029 bcoeff.r = q__1.r, bcoeff.i = q__1.i;
1031 /* Scale to avoid underflow */
1033 lsa = abs(sbeta) >= safmin && abs(acoeff) < small;
1034 lsb = (r__1 = salpha.r, abs(r__1)) + (r__2 = r_imag(&salpha),
1035 abs(r__2)) >= safmin && (r__3 = bcoeff.r, abs(r__3))
1036 + (r__4 = r_imag(&bcoeff), abs(r__4)) < small;
1040 scale = small / abs(sbeta) * f2cmin(anorm,big);
1044 r__3 = scale, r__4 = small / ((r__1 = salpha.r, abs(r__1))
1045 + (r__2 = r_imag(&salpha), abs(r__2))) * f2cmin(
1047 scale = f2cmax(r__3,r__4);
1052 r__5 = 1.f, r__6 = abs(acoeff), r__5 = f2cmax(r__5,r__6),
1053 r__6 = (r__1 = bcoeff.r, abs(r__1)) + (r__2 =
1054 r_imag(&bcoeff), abs(r__2));
1055 r__3 = scale, r__4 = 1.f / (safmin * f2cmax(r__5,r__6));
1056 scale = f2cmin(r__3,r__4);
1058 acoeff = ascale * (scale * sbeta);
1060 acoeff = scale * acoeff;
1063 q__2.r = scale * salpha.r, q__2.i = scale * salpha.i;
1064 q__1.r = bscale * q__2.r, q__1.i = bscale * q__2.i;
1065 bcoeff.r = q__1.r, bcoeff.i = q__1.i;
1067 q__1.r = scale * bcoeff.r, q__1.i = scale * bcoeff.i;
1068 bcoeff.r = q__1.r, bcoeff.i = q__1.i;
1072 acoefa = abs(acoeff);
1073 bcoefa = (r__1 = bcoeff.r, abs(r__1)) + (r__2 = r_imag(&
1074 bcoeff), abs(r__2));
1077 for (jr = 1; jr <= i__2; ++jr) {
1079 work[i__3].r = 0.f, work[i__3].i = 0.f;
1083 work[i__2].r = 1.f, work[i__2].i = 0.f;
1085 r__1 = ulp * acoefa * anorm, r__2 = ulp * bcoefa * bnorm,
1086 r__1 = f2cmax(r__1,r__2);
1087 dmin__ = f2cmax(r__1,safmin);
1090 /* Triangular solve of (a A - b B) y = 0 */
1093 /* (rowwise in (a A - b B) , or columnwise in a A - b B) */
1096 for (j = je + 1; j <= i__2; ++j) {
1100 /* SUM = sum conjg( a*S(k,j) - b*P(k,j) )*x(k) */
1102 /* (Scale if necessary) */
1105 if (acoefa * rwork[j] + bcoefa * rwork[*n + j] > bignum *
1108 for (jr = je; jr <= i__3; ++jr) {
1111 q__1.r = temp * work[i__5].r, q__1.i = temp *
1113 work[i__4].r = q__1.r, work[i__4].i = q__1.i;
1118 suma.r = 0.f, suma.i = 0.f;
1119 sumb.r = 0.f, sumb.i = 0.f;
1122 for (jr = je; jr <= i__3; ++jr) {
1123 r_cnjg(&q__3, &s[jr + j * s_dim1]);
1125 q__2.r = q__3.r * work[i__4].r - q__3.i * work[i__4]
1126 .i, q__2.i = q__3.r * work[i__4].i + q__3.i *
1128 q__1.r = suma.r + q__2.r, q__1.i = suma.i + q__2.i;
1129 suma.r = q__1.r, suma.i = q__1.i;
1130 r_cnjg(&q__3, &p[jr + j * p_dim1]);
1132 q__2.r = q__3.r * work[i__4].r - q__3.i * work[i__4]
1133 .i, q__2.i = q__3.r * work[i__4].i + q__3.i *
1135 q__1.r = sumb.r + q__2.r, q__1.i = sumb.i + q__2.i;
1136 sumb.r = q__1.r, sumb.i = q__1.i;
1139 q__2.r = acoeff * suma.r, q__2.i = acoeff * suma.i;
1140 r_cnjg(&q__4, &bcoeff);
1141 q__3.r = q__4.r * sumb.r - q__4.i * sumb.i, q__3.i =
1142 q__4.r * sumb.i + q__4.i * sumb.r;
1143 q__1.r = q__2.r - q__3.r, q__1.i = q__2.i - q__3.i;
1144 sum.r = q__1.r, sum.i = q__1.i;
1146 /* Form x(j) = - SUM / conjg( a*S(j,j) - b*P(j,j) ) */
1148 /* with scaling and perturbation of the denominator */
1150 i__3 = j + j * s_dim1;
1151 q__3.r = acoeff * s[i__3].r, q__3.i = acoeff * s[i__3].i;
1152 i__4 = j + j * p_dim1;
1153 q__4.r = bcoeff.r * p[i__4].r - bcoeff.i * p[i__4].i,
1154 q__4.i = bcoeff.r * p[i__4].i + bcoeff.i * p[i__4]
1156 q__2.r = q__3.r - q__4.r, q__2.i = q__3.i - q__4.i;
1157 r_cnjg(&q__1, &q__2);
1158 d__.r = q__1.r, d__.i = q__1.i;
1159 if ((r__1 = d__.r, abs(r__1)) + (r__2 = r_imag(&d__), abs(
1161 q__1.r = dmin__, q__1.i = 0.f;
1162 d__.r = q__1.r, d__.i = q__1.i;
1165 if ((r__1 = d__.r, abs(r__1)) + (r__2 = r_imag(&d__), abs(
1167 if ((r__1 = sum.r, abs(r__1)) + (r__2 = r_imag(&sum),
1168 abs(r__2)) >= bignum * ((r__3 = d__.r, abs(
1169 r__3)) + (r__4 = r_imag(&d__), abs(r__4)))) {
1170 temp = 1.f / ((r__1 = sum.r, abs(r__1)) + (r__2 =
1171 r_imag(&sum), abs(r__2)));
1173 for (jr = je; jr <= i__3; ++jr) {
1176 q__1.r = temp * work[i__5].r, q__1.i = temp *
1178 work[i__4].r = q__1.r, work[i__4].i = q__1.i;
1182 q__1.r = temp * sum.r, q__1.i = temp * sum.i;
1183 sum.r = q__1.r, sum.i = q__1.i;
1187 q__2.r = -sum.r, q__2.i = -sum.i;
1188 cladiv_(&q__1, &q__2, &d__);
1189 work[i__3].r = q__1.r, work[i__3].i = q__1.i;
1192 r__3 = xmax, r__4 = (r__1 = work[i__3].r, abs(r__1)) + (
1193 r__2 = r_imag(&work[j]), abs(r__2));
1194 xmax = f2cmax(r__3,r__4);
1198 /* Back transform eigenvector if HOWMNY='B'. */
1202 cgemv_("N", n, &i__2, &c_b2, &vl[je * vl_dim1 + 1], ldvl,
1203 &work[je], &c__1, &c_b1, &work[*n + 1], &c__1);
1211 /* Copy and scale eigenvector into column of VL */
1215 for (jr = ibeg; jr <= i__2; ++jr) {
1217 i__3 = (isrc - 1) * *n + jr;
1218 r__3 = xmax, r__4 = (r__1 = work[i__3].r, abs(r__1)) + (
1219 r__2 = r_imag(&work[(isrc - 1) * *n + jr]), abs(
1221 xmax = f2cmax(r__3,r__4);
1225 if (xmax > safmin) {
1228 for (jr = ibeg; jr <= i__2; ++jr) {
1229 i__3 = jr + ieig * vl_dim1;
1230 i__4 = (isrc - 1) * *n + jr;
1231 q__1.r = temp * work[i__4].r, q__1.i = temp * work[
1233 vl[i__3].r = q__1.r, vl[i__3].i = q__1.i;
1241 for (jr = 1; jr <= i__2; ++jr) {
1242 i__3 = jr + ieig * vl_dim1;
1243 vl[i__3].r = 0.f, vl[i__3].i = 0.f;
1253 /* Right eigenvectors */
1258 /* Main loop over eigenvalues */
1260 for (je = *n; je >= 1; --je) {
1264 ilcomp = select[je];
1269 i__1 = je + je * s_dim1;
1270 i__2 = je + je * p_dim1;
1271 if ((r__2 = s[i__1].r, abs(r__2)) + (r__3 = r_imag(&s[je + je
1272 * s_dim1]), abs(r__3)) <= safmin && (r__1 = p[i__2].r,
1273 abs(r__1)) <= safmin) {
1275 /* Singular matrix pencil -- return unit eigenvector */
1278 for (jr = 1; jr <= i__1; ++jr) {
1279 i__2 = jr + ieig * vr_dim1;
1280 vr[i__2].r = 0.f, vr[i__2].i = 0.f;
1283 i__1 = ieig + ieig * vr_dim1;
1284 vr[i__1].r = 1.f, vr[i__1].i = 0.f;
1288 /* Non-singular eigenvalue: */
1289 /* Compute coefficients a and b in */
1291 /* ( a A - b B ) x = 0 */
1294 i__1 = je + je * s_dim1;
1295 i__2 = je + je * p_dim1;
1296 r__4 = ((r__2 = s[i__1].r, abs(r__2)) + (r__3 = r_imag(&s[je
1297 + je * s_dim1]), abs(r__3))) * ascale, r__5 = (r__1 =
1298 p[i__2].r, abs(r__1)) * bscale, r__4 = f2cmax(r__4,r__5);
1299 temp = 1.f / f2cmax(r__4,safmin);
1300 i__1 = je + je * s_dim1;
1301 q__2.r = temp * s[i__1].r, q__2.i = temp * s[i__1].i;
1302 q__1.r = ascale * q__2.r, q__1.i = ascale * q__2.i;
1303 salpha.r = q__1.r, salpha.i = q__1.i;
1304 i__1 = je + je * p_dim1;
1305 sbeta = temp * p[i__1].r * bscale;
1306 acoeff = sbeta * ascale;
1307 q__1.r = bscale * salpha.r, q__1.i = bscale * salpha.i;
1308 bcoeff.r = q__1.r, bcoeff.i = q__1.i;
1310 /* Scale to avoid underflow */
1312 lsa = abs(sbeta) >= safmin && abs(acoeff) < small;
1313 lsb = (r__1 = salpha.r, abs(r__1)) + (r__2 = r_imag(&salpha),
1314 abs(r__2)) >= safmin && (r__3 = bcoeff.r, abs(r__3))
1315 + (r__4 = r_imag(&bcoeff), abs(r__4)) < small;
1319 scale = small / abs(sbeta) * f2cmin(anorm,big);
1323 r__3 = scale, r__4 = small / ((r__1 = salpha.r, abs(r__1))
1324 + (r__2 = r_imag(&salpha), abs(r__2))) * f2cmin(
1326 scale = f2cmax(r__3,r__4);
1331 r__5 = 1.f, r__6 = abs(acoeff), r__5 = f2cmax(r__5,r__6),
1332 r__6 = (r__1 = bcoeff.r, abs(r__1)) + (r__2 =
1333 r_imag(&bcoeff), abs(r__2));
1334 r__3 = scale, r__4 = 1.f / (safmin * f2cmax(r__5,r__6));
1335 scale = f2cmin(r__3,r__4);
1337 acoeff = ascale * (scale * sbeta);
1339 acoeff = scale * acoeff;
1342 q__2.r = scale * salpha.r, q__2.i = scale * salpha.i;
1343 q__1.r = bscale * q__2.r, q__1.i = bscale * q__2.i;
1344 bcoeff.r = q__1.r, bcoeff.i = q__1.i;
1346 q__1.r = scale * bcoeff.r, q__1.i = scale * bcoeff.i;
1347 bcoeff.r = q__1.r, bcoeff.i = q__1.i;
1351 acoefa = abs(acoeff);
1352 bcoefa = (r__1 = bcoeff.r, abs(r__1)) + (r__2 = r_imag(&
1353 bcoeff), abs(r__2));
1356 for (jr = 1; jr <= i__1; ++jr) {
1358 work[i__2].r = 0.f, work[i__2].i = 0.f;
1362 work[i__1].r = 1.f, work[i__1].i = 0.f;
1364 r__1 = ulp * acoefa * anorm, r__2 = ulp * bcoefa * bnorm,
1365 r__1 = f2cmax(r__1,r__2);
1366 dmin__ = f2cmax(r__1,safmin);
1368 /* Triangular solve of (a A - b B) x = 0 (columnwise) */
1370 /* WORK(1:j-1) contains sums w, */
1371 /* WORK(j+1:JE) contains x */
1374 for (jr = 1; jr <= i__1; ++jr) {
1376 i__3 = jr + je * s_dim1;
1377 q__2.r = acoeff * s[i__3].r, q__2.i = acoeff * s[i__3].i;
1378 i__4 = jr + je * p_dim1;
1379 q__3.r = bcoeff.r * p[i__4].r - bcoeff.i * p[i__4].i,
1380 q__3.i = bcoeff.r * p[i__4].i + bcoeff.i * p[i__4]
1382 q__1.r = q__2.r - q__3.r, q__1.i = q__2.i - q__3.i;
1383 work[i__2].r = q__1.r, work[i__2].i = q__1.i;
1387 work[i__1].r = 1.f, work[i__1].i = 0.f;
1389 for (j = je - 1; j >= 1; --j) {
1391 /* Form x(j) := - w(j) / d */
1392 /* with scaling and perturbation of the denominator */
1394 i__1 = j + j * s_dim1;
1395 q__2.r = acoeff * s[i__1].r, q__2.i = acoeff * s[i__1].i;
1396 i__2 = j + j * p_dim1;
1397 q__3.r = bcoeff.r * p[i__2].r - bcoeff.i * p[i__2].i,
1398 q__3.i = bcoeff.r * p[i__2].i + bcoeff.i * p[i__2]
1400 q__1.r = q__2.r - q__3.r, q__1.i = q__2.i - q__3.i;
1401 d__.r = q__1.r, d__.i = q__1.i;
1402 if ((r__1 = d__.r, abs(r__1)) + (r__2 = r_imag(&d__), abs(
1404 q__1.r = dmin__, q__1.i = 0.f;
1405 d__.r = q__1.r, d__.i = q__1.i;
1408 if ((r__1 = d__.r, abs(r__1)) + (r__2 = r_imag(&d__), abs(
1411 if ((r__1 = work[i__1].r, abs(r__1)) + (r__2 = r_imag(
1412 &work[j]), abs(r__2)) >= bignum * ((r__3 =
1413 d__.r, abs(r__3)) + (r__4 = r_imag(&d__), abs(
1416 temp = 1.f / ((r__1 = work[i__1].r, abs(r__1)) + (
1417 r__2 = r_imag(&work[j]), abs(r__2)));
1419 for (jr = 1; jr <= i__1; ++jr) {
1422 q__1.r = temp * work[i__3].r, q__1.i = temp *
1424 work[i__2].r = q__1.r, work[i__2].i = q__1.i;
1432 q__2.r = -work[i__2].r, q__2.i = -work[i__2].i;
1433 cladiv_(&q__1, &q__2, &d__);
1434 work[i__1].r = q__1.r, work[i__1].i = q__1.i;
1438 /* w = w + x(j)*(a S(*,j) - b P(*,j) ) with scaling */
1441 if ((r__1 = work[i__1].r, abs(r__1)) + (r__2 = r_imag(
1442 &work[j]), abs(r__2)) > 1.f) {
1444 temp = 1.f / ((r__1 = work[i__1].r, abs(r__1)) + (
1445 r__2 = r_imag(&work[j]), abs(r__2)));
1446 if (acoefa * rwork[j] + bcoefa * rwork[*n + j] >=
1449 for (jr = 1; jr <= i__1; ++jr) {
1452 q__1.r = temp * work[i__3].r, q__1.i =
1453 temp * work[i__3].i;
1454 work[i__2].r = q__1.r, work[i__2].i =
1462 q__1.r = acoeff * work[i__1].r, q__1.i = acoeff *
1464 ca.r = q__1.r, ca.i = q__1.i;
1466 q__1.r = bcoeff.r * work[i__1].r - bcoeff.i * work[
1467 i__1].i, q__1.i = bcoeff.r * work[i__1].i +
1468 bcoeff.i * work[i__1].r;
1469 cb.r = q__1.r, cb.i = q__1.i;
1471 for (jr = 1; jr <= i__1; ++jr) {
1474 i__4 = jr + j * s_dim1;
1475 q__3.r = ca.r * s[i__4].r - ca.i * s[i__4].i,
1476 q__3.i = ca.r * s[i__4].i + ca.i * s[i__4]
1478 q__2.r = work[i__3].r + q__3.r, q__2.i = work[
1480 i__5 = jr + j * p_dim1;
1481 q__4.r = cb.r * p[i__5].r - cb.i * p[i__5].i,
1482 q__4.i = cb.r * p[i__5].i + cb.i * p[i__5]
1484 q__1.r = q__2.r - q__4.r, q__1.i = q__2.i -
1486 work[i__2].r = q__1.r, work[i__2].i = q__1.i;
1493 /* Back transform eigenvector if HOWMNY='B'. */
1496 cgemv_("N", n, &je, &c_b2, &vr[vr_offset], ldvr, &work[1],
1497 &c__1, &c_b1, &work[*n + 1], &c__1);
1505 /* Copy and scale eigenvector into column of VR */
1509 for (jr = 1; jr <= i__1; ++jr) {
1511 i__2 = (isrc - 1) * *n + jr;
1512 r__3 = xmax, r__4 = (r__1 = work[i__2].r, abs(r__1)) + (
1513 r__2 = r_imag(&work[(isrc - 1) * *n + jr]), abs(
1515 xmax = f2cmax(r__3,r__4);
1519 if (xmax > safmin) {
1522 for (jr = 1; jr <= i__1; ++jr) {
1523 i__2 = jr + ieig * vr_dim1;
1524 i__3 = (isrc - 1) * *n + jr;
1525 q__1.r = temp * work[i__3].r, q__1.i = temp * work[
1527 vr[i__2].r = q__1.r, vr[i__2].i = q__1.i;
1535 for (jr = iend + 1; jr <= i__1; ++jr) {
1536 i__2 = jr + ieig * vr_dim1;
1537 vr[i__2].r = 0.f, vr[i__2].i = 0.f;