You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

dgeev.c 32 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060
  1. /* f2c.h -- Standard Fortran to C header file */
  2. /** barf [ba:rf] 2. "He suggested using FORTRAN, and everybody barfed."
  3. - From The Shogakukan DICTIONARY OF NEW ENGLISH (Second edition) */
  4. #ifndef F2C_INCLUDE
  5. #define F2C_INCLUDE
  6. #include <math.h>
  7. #include <stdlib.h>
  8. #include <string.h>
  9. #include <stdio.h>
  10. #include <complex.h>
  11. #ifdef complex
  12. #undef complex
  13. #endif
  14. #ifdef I
  15. #undef I
  16. #endif
  17. #if defined(_WIN64)
  18. typedef long long BLASLONG;
  19. typedef unsigned long long BLASULONG;
  20. #else
  21. typedef long BLASLONG;
  22. typedef unsigned long BLASULONG;
  23. #endif
  24. #ifdef LAPACK_ILP64
  25. typedef BLASLONG blasint;
  26. #if defined(_WIN64)
  27. #define blasabs(x) llabs(x)
  28. #else
  29. #define blasabs(x) labs(x)
  30. #endif
  31. #else
  32. typedef int blasint;
  33. #define blasabs(x) abs(x)
  34. #endif
  35. typedef blasint integer;
  36. typedef unsigned int uinteger;
  37. typedef char *address;
  38. typedef short int shortint;
  39. typedef float real;
  40. typedef double doublereal;
  41. typedef struct { real r, i; } complex;
  42. typedef struct { doublereal r, i; } doublecomplex;
  43. static inline _Complex float Cf(complex *z) {return z->r + z->i*_Complex_I;}
  44. static inline _Complex double Cd(doublecomplex *z) {return z->r + z->i*_Complex_I;}
  45. static inline _Complex float * _pCf(complex *z) {return (_Complex float*)z;}
  46. static inline _Complex double * _pCd(doublecomplex *z) {return (_Complex double*)z;}
  47. #define pCf(z) (*_pCf(z))
  48. #define pCd(z) (*_pCd(z))
  49. typedef int logical;
  50. typedef short int shortlogical;
  51. typedef char logical1;
  52. typedef char integer1;
  53. #define TRUE_ (1)
  54. #define FALSE_ (0)
  55. /* Extern is for use with -E */
  56. #ifndef Extern
  57. #define Extern extern
  58. #endif
  59. /* I/O stuff */
  60. typedef int flag;
  61. typedef int ftnlen;
  62. typedef int ftnint;
  63. /*external read, write*/
  64. typedef struct
  65. { flag cierr;
  66. ftnint ciunit;
  67. flag ciend;
  68. char *cifmt;
  69. ftnint cirec;
  70. } cilist;
  71. /*internal read, write*/
  72. typedef struct
  73. { flag icierr;
  74. char *iciunit;
  75. flag iciend;
  76. char *icifmt;
  77. ftnint icirlen;
  78. ftnint icirnum;
  79. } icilist;
  80. /*open*/
  81. typedef struct
  82. { flag oerr;
  83. ftnint ounit;
  84. char *ofnm;
  85. ftnlen ofnmlen;
  86. char *osta;
  87. char *oacc;
  88. char *ofm;
  89. ftnint orl;
  90. char *oblnk;
  91. } olist;
  92. /*close*/
  93. typedef struct
  94. { flag cerr;
  95. ftnint cunit;
  96. char *csta;
  97. } cllist;
  98. /*rewind, backspace, endfile*/
  99. typedef struct
  100. { flag aerr;
  101. ftnint aunit;
  102. } alist;
  103. /* inquire */
  104. typedef struct
  105. { flag inerr;
  106. ftnint inunit;
  107. char *infile;
  108. ftnlen infilen;
  109. ftnint *inex; /*parameters in standard's order*/
  110. ftnint *inopen;
  111. ftnint *innum;
  112. ftnint *innamed;
  113. char *inname;
  114. ftnlen innamlen;
  115. char *inacc;
  116. ftnlen inacclen;
  117. char *inseq;
  118. ftnlen inseqlen;
  119. char *indir;
  120. ftnlen indirlen;
  121. char *infmt;
  122. ftnlen infmtlen;
  123. char *inform;
  124. ftnint informlen;
  125. char *inunf;
  126. ftnlen inunflen;
  127. ftnint *inrecl;
  128. ftnint *innrec;
  129. char *inblank;
  130. ftnlen inblanklen;
  131. } inlist;
  132. #define VOID void
  133. union Multitype { /* for multiple entry points */
  134. integer1 g;
  135. shortint h;
  136. integer i;
  137. /* longint j; */
  138. real r;
  139. doublereal d;
  140. complex c;
  141. doublecomplex z;
  142. };
  143. typedef union Multitype Multitype;
  144. struct Vardesc { /* for Namelist */
  145. char *name;
  146. char *addr;
  147. ftnlen *dims;
  148. int type;
  149. };
  150. typedef struct Vardesc Vardesc;
  151. struct Namelist {
  152. char *name;
  153. Vardesc **vars;
  154. int nvars;
  155. };
  156. typedef struct Namelist Namelist;
  157. #define abs(x) ((x) >= 0 ? (x) : -(x))
  158. #define dabs(x) (fabs(x))
  159. #define f2cmin(a,b) ((a) <= (b) ? (a) : (b))
  160. #define f2cmax(a,b) ((a) >= (b) ? (a) : (b))
  161. #define dmin(a,b) (f2cmin(a,b))
  162. #define dmax(a,b) (f2cmax(a,b))
  163. #define bit_test(a,b) ((a) >> (b) & 1)
  164. #define bit_clear(a,b) ((a) & ~((uinteger)1 << (b)))
  165. #define bit_set(a,b) ((a) | ((uinteger)1 << (b)))
  166. #define abort_() { sig_die("Fortran abort routine called", 1); }
  167. #define c_abs(z) (cabsf(Cf(z)))
  168. #define c_cos(R,Z) { pCf(R)=ccos(Cf(Z)); }
  169. #define c_div(c, a, b) {pCf(c) = Cf(a)/Cf(b);}
  170. #define z_div(c, a, b) {pCd(c) = Cd(a)/Cd(b);}
  171. #define c_exp(R, Z) {pCf(R) = cexpf(Cf(Z));}
  172. #define c_log(R, Z) {pCf(R) = clogf(Cf(Z));}
  173. #define c_sin(R, Z) {pCf(R) = csinf(Cf(Z));}
  174. //#define c_sqrt(R, Z) {*(R) = csqrtf(Cf(Z));}
  175. #define c_sqrt(R, Z) {pCf(R) = csqrtf(Cf(Z));}
  176. #define d_abs(x) (fabs(*(x)))
  177. #define d_acos(x) (acos(*(x)))
  178. #define d_asin(x) (asin(*(x)))
  179. #define d_atan(x) (atan(*(x)))
  180. #define d_atn2(x, y) (atan2(*(x),*(y)))
  181. #define d_cnjg(R, Z) { pCd(R) = conj(Cd(Z)); }
  182. #define r_cnjg(R, Z) { pCf(R) = conj(Cf(Z)); }
  183. #define d_cos(x) (cos(*(x)))
  184. #define d_cosh(x) (cosh(*(x)))
  185. #define d_dim(__a, __b) ( *(__a) > *(__b) ? *(__a) - *(__b) : 0.0 )
  186. #define d_exp(x) (exp(*(x)))
  187. #define d_imag(z) (cimag(Cd(z)))
  188. #define r_imag(z) (cimag(Cf(z)))
  189. #define d_int(__x) (*(__x)>0 ? floor(*(__x)) : -floor(- *(__x)))
  190. #define r_int(__x) (*(__x)>0 ? floor(*(__x)) : -floor(- *(__x)))
  191. #define d_lg10(x) ( 0.43429448190325182765 * log(*(x)) )
  192. #define r_lg10(x) ( 0.43429448190325182765 * log(*(x)) )
  193. #define d_log(x) (log(*(x)))
  194. #define d_mod(x, y) (fmod(*(x), *(y)))
  195. #define u_nint(__x) ((__x)>=0 ? floor((__x) + .5) : -floor(.5 - (__x)))
  196. #define d_nint(x) u_nint(*(x))
  197. #define u_sign(__a,__b) ((__b) >= 0 ? ((__a) >= 0 ? (__a) : -(__a)) : -((__a) >= 0 ? (__a) : -(__a)))
  198. #define d_sign(a,b) u_sign(*(a),*(b))
  199. #define r_sign(a,b) u_sign(*(a),*(b))
  200. #define d_sin(x) (sin(*(x)))
  201. #define d_sinh(x) (sinh(*(x)))
  202. #define d_sqrt(x) (sqrt(*(x)))
  203. #define d_tan(x) (tan(*(x)))
  204. #define d_tanh(x) (tanh(*(x)))
  205. #define i_abs(x) abs(*(x))
  206. #define i_dnnt(x) ((integer)u_nint(*(x)))
  207. #define i_len(s, n) (n)
  208. #define i_nint(x) ((integer)u_nint(*(x)))
  209. #define i_sign(a,b) ((integer)u_sign((integer)*(a),(integer)*(b)))
  210. #define pow_dd(ap, bp) ( pow(*(ap), *(bp)))
  211. #define pow_si(B,E) spow_ui(*(B),*(E))
  212. #define pow_ri(B,E) spow_ui(*(B),*(E))
  213. #define pow_di(B,E) dpow_ui(*(B),*(E))
  214. #define pow_zi(p, a, b) {pCd(p) = zpow_ui(Cd(a), *(b));}
  215. #define pow_ci(p, a, b) {pCf(p) = cpow_ui(Cf(a), *(b));}
  216. #define pow_zz(R,A,B) {pCd(R) = cpow(Cd(A),*(B));}
  217. #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++ = ' '; }
  218. #define s_cmp(a,b,c,d) ((integer)strncmp((a),(b),f2cmin((c),(d))))
  219. #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]; }
  220. #define sig_die(s, kill) { exit(1); }
  221. #define s_stop(s, n) {exit(0);}
  222. static char junk[] = "\n@(#)LIBF77 VERSION 19990503\n";
  223. #define z_abs(z) (cabs(Cd(z)))
  224. #define z_exp(R, Z) {pCd(R) = cexp(Cd(Z));}
  225. #define z_sqrt(R, Z) {pCd(R) = csqrt(Cd(Z));}
  226. #define myexit_() break;
  227. #define mycycle() continue;
  228. #define myceiling(w) {ceil(w)}
  229. #define myhuge(w) {HUGE_VAL}
  230. //#define mymaxloc_(w,s,e,n) {if (sizeof(*(w)) == sizeof(double)) dmaxloc_((w),*(s),*(e),n); else dmaxloc_((w),*(s),*(e),n);}
  231. #define mymaxloc(w,s,e,n) {dmaxloc_(w,*(s),*(e),n)}
  232. /* procedure parameter types for -A and -C++ */
  233. #define F2C_proc_par_types 1
  234. #ifdef __cplusplus
  235. typedef logical (*L_fp)(...);
  236. #else
  237. typedef logical (*L_fp)();
  238. #endif
  239. static float spow_ui(float x, integer n) {
  240. float pow=1.0; unsigned long int u;
  241. if(n != 0) {
  242. if(n < 0) n = -n, x = 1/x;
  243. for(u = n; ; ) {
  244. if(u & 01) pow *= x;
  245. if(u >>= 1) x *= x;
  246. else break;
  247. }
  248. }
  249. return pow;
  250. }
  251. static double dpow_ui(double x, integer n) {
  252. double pow=1.0; unsigned long int u;
  253. if(n != 0) {
  254. if(n < 0) n = -n, x = 1/x;
  255. for(u = n; ; ) {
  256. if(u & 01) pow *= x;
  257. if(u >>= 1) x *= x;
  258. else break;
  259. }
  260. }
  261. return pow;
  262. }
  263. static _Complex float cpow_ui(_Complex float x, integer n) {
  264. _Complex float pow=1.0; unsigned long int u;
  265. if(n != 0) {
  266. if(n < 0) n = -n, x = 1/x;
  267. for(u = n; ; ) {
  268. if(u & 01) pow *= x;
  269. if(u >>= 1) x *= x;
  270. else break;
  271. }
  272. }
  273. return pow;
  274. }
  275. static _Complex double zpow_ui(_Complex double x, integer n) {
  276. _Complex double pow=1.0; unsigned long int u;
  277. if(n != 0) {
  278. if(n < 0) n = -n, x = 1/x;
  279. for(u = n; ; ) {
  280. if(u & 01) pow *= x;
  281. if(u >>= 1) x *= x;
  282. else break;
  283. }
  284. }
  285. return pow;
  286. }
  287. static integer pow_ii(integer x, integer n) {
  288. integer pow; unsigned long int u;
  289. if (n <= 0) {
  290. if (n == 0 || x == 1) pow = 1;
  291. else if (x != -1) pow = x == 0 ? 1/x : 0;
  292. else n = -n;
  293. }
  294. if ((n > 0) || !(n == 0 || x == 1 || x != -1)) {
  295. u = n;
  296. for(pow = 1; ; ) {
  297. if(u & 01) pow *= x;
  298. if(u >>= 1) x *= x;
  299. else break;
  300. }
  301. }
  302. return pow;
  303. }
  304. static integer dmaxloc_(double *w, integer s, integer e, integer *n)
  305. {
  306. double m; integer i, mi;
  307. for(m=w[s-1], mi=s, i=s+1; i<=e; i++)
  308. if (w[i-1]>m) mi=i ,m=w[i-1];
  309. return mi-s+1;
  310. }
  311. static integer smaxloc_(float *w, integer s, integer e, integer *n)
  312. {
  313. float m; integer i, mi;
  314. for(m=w[s-1], mi=s, i=s+1; i<=e; i++)
  315. if (w[i-1]>m) mi=i ,m=w[i-1];
  316. return mi-s+1;
  317. }
  318. static inline void cdotc_(complex *z, integer *n_, complex *x, integer *incx_, complex *y, integer *incy_) {
  319. integer n = *n_, incx = *incx_, incy = *incy_, i;
  320. _Complex float zdotc = 0.0;
  321. if (incx == 1 && incy == 1) {
  322. for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
  323. zdotc += conjf(Cf(&x[i])) * Cf(&y[i]);
  324. }
  325. } else {
  326. for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
  327. zdotc += conjf(Cf(&x[i*incx])) * Cf(&y[i*incy]);
  328. }
  329. }
  330. pCf(z) = zdotc;
  331. }
  332. static inline void zdotc_(doublecomplex *z, integer *n_, doublecomplex *x, integer *incx_, doublecomplex *y, integer *incy_) {
  333. integer n = *n_, incx = *incx_, incy = *incy_, i;
  334. _Complex double zdotc = 0.0;
  335. if (incx == 1 && incy == 1) {
  336. for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
  337. zdotc += conj(Cd(&x[i])) * Cd(&y[i]);
  338. }
  339. } else {
  340. for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
  341. zdotc += conj(Cd(&x[i*incx])) * Cd(&y[i*incy]);
  342. }
  343. }
  344. pCd(z) = zdotc;
  345. }
  346. static inline void cdotu_(complex *z, integer *n_, complex *x, integer *incx_, complex *y, integer *incy_) {
  347. integer n = *n_, incx = *incx_, incy = *incy_, i;
  348. _Complex float zdotc = 0.0;
  349. if (incx == 1 && incy == 1) {
  350. for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
  351. zdotc += Cf(&x[i]) * Cf(&y[i]);
  352. }
  353. } else {
  354. for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
  355. zdotc += Cf(&x[i*incx]) * Cf(&y[i*incy]);
  356. }
  357. }
  358. pCf(z) = zdotc;
  359. }
  360. static inline void zdotu_(doublecomplex *z, integer *n_, doublecomplex *x, integer *incx_, doublecomplex *y, integer *incy_) {
  361. integer n = *n_, incx = *incx_, incy = *incy_, i;
  362. _Complex double zdotc = 0.0;
  363. if (incx == 1 && incy == 1) {
  364. for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
  365. zdotc += Cd(&x[i]) * Cd(&y[i]);
  366. }
  367. } else {
  368. for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
  369. zdotc += Cd(&x[i*incx]) * Cd(&y[i*incy]);
  370. }
  371. }
  372. pCd(z) = zdotc;
  373. }
  374. #endif
  375. /* -- translated by f2c (version 20000121).
  376. You must link the resulting object file with the libraries:
  377. -lf2c -lm (in that order)
  378. */
  379. /* Table of constant values */
  380. static integer c__1 = 1;
  381. static integer c__0 = 0;
  382. static integer c_n1 = -1;
  383. /* > \brief <b> DGEEV computes the eigenvalues and, optionally, the left and/or right eigenvectors for GE matr
  384. ices</b> */
  385. /* =========== DOCUMENTATION =========== */
  386. /* Online html documentation available at */
  387. /* http://www.netlib.org/lapack/explore-html/ */
  388. /* > \htmlonly */
  389. /* > Download DGEEV + dependencies */
  390. /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dgeev.f
  391. "> */
  392. /* > [TGZ]</a> */
  393. /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dgeev.f
  394. "> */
  395. /* > [ZIP]</a> */
  396. /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dgeev.f
  397. "> */
  398. /* > [TXT]</a> */
  399. /* > \endhtmlonly */
  400. /* Definition: */
  401. /* =========== */
  402. /* SUBROUTINE DGEEV( JOBVL, JOBVR, N, A, LDA, WR, WI, VL, LDVL, VR, */
  403. /* LDVR, WORK, LWORK, INFO ) */
  404. /* CHARACTER JOBVL, JOBVR */
  405. /* INTEGER INFO, LDA, LDVL, LDVR, LWORK, N */
  406. /* DOUBLE PRECISION A( LDA, * ), VL( LDVL, * ), VR( LDVR, * ), */
  407. /* $ WI( * ), WORK( * ), WR( * ) */
  408. /* > \par Purpose: */
  409. /* ============= */
  410. /* > */
  411. /* > \verbatim */
  412. /* > */
  413. /* > DGEEV computes for an N-by-N real nonsymmetric matrix A, the */
  414. /* > eigenvalues and, optionally, the left and/or right eigenvectors. */
  415. /* > */
  416. /* > The right eigenvector v(j) of A satisfies */
  417. /* > A * v(j) = lambda(j) * v(j) */
  418. /* > where lambda(j) is its eigenvalue. */
  419. /* > The left eigenvector u(j) of A satisfies */
  420. /* > u(j)**H * A = lambda(j) * u(j)**H */
  421. /* > where u(j)**H denotes the conjugate-transpose of u(j). */
  422. /* > */
  423. /* > The computed eigenvectors are normalized to have Euclidean norm */
  424. /* > equal to 1 and largest component real. */
  425. /* > \endverbatim */
  426. /* Arguments: */
  427. /* ========== */
  428. /* > \param[in] JOBVL */
  429. /* > \verbatim */
  430. /* > JOBVL is CHARACTER*1 */
  431. /* > = 'N': left eigenvectors of A are not computed; */
  432. /* > = 'V': left eigenvectors of A are computed. */
  433. /* > \endverbatim */
  434. /* > */
  435. /* > \param[in] JOBVR */
  436. /* > \verbatim */
  437. /* > JOBVR is CHARACTER*1 */
  438. /* > = 'N': right eigenvectors of A are not computed; */
  439. /* > = 'V': right eigenvectors of A are computed. */
  440. /* > \endverbatim */
  441. /* > */
  442. /* > \param[in] N */
  443. /* > \verbatim */
  444. /* > N is INTEGER */
  445. /* > The order of the matrix A. N >= 0. */
  446. /* > \endverbatim */
  447. /* > */
  448. /* > \param[in,out] A */
  449. /* > \verbatim */
  450. /* > A is DOUBLE PRECISION array, dimension (LDA,N) */
  451. /* > On entry, the N-by-N matrix A. */
  452. /* > On exit, A has been overwritten. */
  453. /* > \endverbatim */
  454. /* > */
  455. /* > \param[in] LDA */
  456. /* > \verbatim */
  457. /* > LDA is INTEGER */
  458. /* > The leading dimension of the array A. LDA >= f2cmax(1,N). */
  459. /* > \endverbatim */
  460. /* > */
  461. /* > \param[out] WR */
  462. /* > \verbatim */
  463. /* > WR is DOUBLE PRECISION array, dimension (N) */
  464. /* > \endverbatim */
  465. /* > */
  466. /* > \param[out] WI */
  467. /* > \verbatim */
  468. /* > WI is DOUBLE PRECISION array, dimension (N) */
  469. /* > WR and WI contain the real and imaginary parts, */
  470. /* > respectively, of the computed eigenvalues. Complex */
  471. /* > conjugate pairs of eigenvalues appear consecutively */
  472. /* > with the eigenvalue having the positive imaginary part */
  473. /* > first. */
  474. /* > \endverbatim */
  475. /* > */
  476. /* > \param[out] VL */
  477. /* > \verbatim */
  478. /* > VL is DOUBLE PRECISION array, dimension (LDVL,N) */
  479. /* > If JOBVL = 'V', the left eigenvectors u(j) are stored one */
  480. /* > after another in the columns of VL, in the same order */
  481. /* > as their eigenvalues. */
  482. /* > If JOBVL = 'N', VL is not referenced. */
  483. /* > If the j-th eigenvalue is real, then u(j) = VL(:,j), */
  484. /* > the j-th column of VL. */
  485. /* > If the j-th and (j+1)-st eigenvalues form a complex */
  486. /* > conjugate pair, then u(j) = VL(:,j) + i*VL(:,j+1) and */
  487. /* > u(j+1) = VL(:,j) - i*VL(:,j+1). */
  488. /* > \endverbatim */
  489. /* > */
  490. /* > \param[in] LDVL */
  491. /* > \verbatim */
  492. /* > LDVL is INTEGER */
  493. /* > The leading dimension of the array VL. LDVL >= 1; if */
  494. /* > JOBVL = 'V', LDVL >= N. */
  495. /* > \endverbatim */
  496. /* > */
  497. /* > \param[out] VR */
  498. /* > \verbatim */
  499. /* > VR is DOUBLE PRECISION array, dimension (LDVR,N) */
  500. /* > If JOBVR = 'V', the right eigenvectors v(j) are stored one */
  501. /* > after another in the columns of VR, in the same order */
  502. /* > as their eigenvalues. */
  503. /* > If JOBVR = 'N', VR is not referenced. */
  504. /* > If the j-th eigenvalue is real, then v(j) = VR(:,j), */
  505. /* > the j-th column of VR. */
  506. /* > If the j-th and (j+1)-st eigenvalues form a complex */
  507. /* > conjugate pair, then v(j) = VR(:,j) + i*VR(:,j+1) and */
  508. /* > v(j+1) = VR(:,j) - i*VR(:,j+1). */
  509. /* > \endverbatim */
  510. /* > */
  511. /* > \param[in] LDVR */
  512. /* > \verbatim */
  513. /* > LDVR is INTEGER */
  514. /* > The leading dimension of the array VR. LDVR >= 1; if */
  515. /* > JOBVR = 'V', LDVR >= N. */
  516. /* > \endverbatim */
  517. /* > */
  518. /* > \param[out] WORK */
  519. /* > \verbatim */
  520. /* > WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK)) */
  521. /* > On exit, if INFO = 0, WORK(1) returns the optimal LWORK. */
  522. /* > \endverbatim */
  523. /* > */
  524. /* > \param[in] LWORK */
  525. /* > \verbatim */
  526. /* > LWORK is INTEGER */
  527. /* > The dimension of the array WORK. LWORK >= f2cmax(1,3*N), and */
  528. /* > if JOBVL = 'V' or JOBVR = 'V', LWORK >= 4*N. For good */
  529. /* > performance, LWORK must generally be larger. */
  530. /* > */
  531. /* > If LWORK = -1, then a workspace query is assumed; the routine */
  532. /* > only calculates the optimal size of the WORK array, returns */
  533. /* > this value as the first entry of the WORK array, and no error */
  534. /* > message related to LWORK is issued by XERBLA. */
  535. /* > \endverbatim */
  536. /* > */
  537. /* > \param[out] INFO */
  538. /* > \verbatim */
  539. /* > INFO is INTEGER */
  540. /* > = 0: successful exit */
  541. /* > < 0: if INFO = -i, the i-th argument had an illegal value. */
  542. /* > > 0: if INFO = i, the QR algorithm failed to compute all the */
  543. /* > eigenvalues, and no eigenvectors have been computed; */
  544. /* > elements i+1:N of WR and WI contain eigenvalues which */
  545. /* > have converged. */
  546. /* > \endverbatim */
  547. /* Authors: */
  548. /* ======== */
  549. /* > \author Univ. of Tennessee */
  550. /* > \author Univ. of California Berkeley */
  551. /* > \author Univ. of Colorado Denver */
  552. /* > \author NAG Ltd. */
  553. /* > \date June 2016 */
  554. /* @precisions fortran d -> s */
  555. /* > \ingroup doubleGEeigen */
  556. /* ===================================================================== */
  557. /* Subroutine */ int dgeev_(char *jobvl, char *jobvr, integer *n, doublereal *
  558. a, integer *lda, doublereal *wr, doublereal *wi, doublereal *vl,
  559. integer *ldvl, doublereal *vr, integer *ldvr, doublereal *work,
  560. integer *lwork, integer *info)
  561. {
  562. /* System generated locals */
  563. integer a_dim1, a_offset, vl_dim1, vl_offset, vr_dim1, vr_offset, i__1,
  564. i__2, i__3;
  565. doublereal d__1, d__2;
  566. /* Local variables */
  567. integer ibal;
  568. char side[1];
  569. doublereal anrm;
  570. integer ierr, itau;
  571. extern /* Subroutine */ int drot_(integer *, doublereal *, integer *,
  572. doublereal *, integer *, doublereal *, doublereal *);
  573. integer iwrk, nout;
  574. extern doublereal dnrm2_(integer *, doublereal *, integer *);
  575. integer i__, k;
  576. doublereal r__;
  577. extern /* Subroutine */ int dscal_(integer *, doublereal *, doublereal *,
  578. integer *);
  579. extern logical lsame_(char *, char *);
  580. extern doublereal dlapy2_(doublereal *, doublereal *);
  581. extern /* Subroutine */ int dlabad_(doublereal *, doublereal *), dgebak_(
  582. char *, char *, integer *, integer *, integer *, doublereal *,
  583. integer *, doublereal *, integer *, integer *),
  584. dgebal_(char *, integer *, doublereal *, integer *, integer *,
  585. integer *, doublereal *, integer *);
  586. doublereal cs;
  587. logical scalea;
  588. extern doublereal dlamch_(char *);
  589. doublereal cscale;
  590. extern doublereal dlange_(char *, integer *, integer *, doublereal *,
  591. integer *, doublereal *);
  592. extern /* Subroutine */ int dgehrd_(integer *, integer *, integer *,
  593. doublereal *, integer *, doublereal *, doublereal *, integer *,
  594. integer *);
  595. doublereal sn;
  596. extern /* Subroutine */ int dlascl_(char *, integer *, integer *,
  597. doublereal *, doublereal *, integer *, integer *, doublereal *,
  598. integer *, integer *);
  599. extern integer idamax_(integer *, doublereal *, integer *);
  600. extern /* Subroutine */ int dlacpy_(char *, integer *, integer *,
  601. doublereal *, integer *, doublereal *, integer *),
  602. dlartg_(doublereal *, doublereal *, doublereal *, doublereal *,
  603. doublereal *), xerbla_(char *, integer *, ftnlen);
  604. logical select[1];
  605. extern integer ilaenv_(integer *, char *, char *, integer *, integer *,
  606. integer *, integer *, ftnlen, ftnlen);
  607. doublereal bignum;
  608. extern /* Subroutine */ int dorghr_(integer *, integer *, integer *,
  609. doublereal *, integer *, doublereal *, doublereal *, integer *,
  610. integer *), dhseqr_(char *, char *, integer *, integer *, integer
  611. *, doublereal *, integer *, doublereal *, doublereal *,
  612. doublereal *, integer *, doublereal *, integer *, integer *);
  613. integer minwrk, maxwrk;
  614. logical wantvl;
  615. doublereal smlnum;
  616. integer hswork;
  617. logical lquery, wantvr;
  618. extern /* Subroutine */ int dtrevc3_(char *, char *, logical *, integer *,
  619. doublereal *, integer *, doublereal *, integer *, doublereal *,
  620. integer *, integer *, integer *, doublereal *, integer *, integer
  621. *);
  622. integer ihi;
  623. doublereal scl;
  624. integer ilo;
  625. doublereal dum[1], eps;
  626. integer lwork_trevc__;
  627. /* -- LAPACK driver routine (version 3.7.0) -- */
  628. /* -- LAPACK is a software package provided by Univ. of Tennessee, -- */
  629. /* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- */
  630. /* June 2016 */
  631. /* ===================================================================== */
  632. /* Test the input arguments */
  633. /* Parameter adjustments */
  634. a_dim1 = *lda;
  635. a_offset = 1 + a_dim1 * 1;
  636. a -= a_offset;
  637. --wr;
  638. --wi;
  639. vl_dim1 = *ldvl;
  640. vl_offset = 1 + vl_dim1 * 1;
  641. vl -= vl_offset;
  642. vr_dim1 = *ldvr;
  643. vr_offset = 1 + vr_dim1 * 1;
  644. vr -= vr_offset;
  645. --work;
  646. /* Function Body */
  647. *info = 0;
  648. lquery = *lwork == -1;
  649. wantvl = lsame_(jobvl, "V");
  650. wantvr = lsame_(jobvr, "V");
  651. if (! wantvl && ! lsame_(jobvl, "N")) {
  652. *info = -1;
  653. } else if (! wantvr && ! lsame_(jobvr, "N")) {
  654. *info = -2;
  655. } else if (*n < 0) {
  656. *info = -3;
  657. } else if (*lda < f2cmax(1,*n)) {
  658. *info = -5;
  659. } else if (*ldvl < 1 || wantvl && *ldvl < *n) {
  660. *info = -9;
  661. } else if (*ldvr < 1 || wantvr && *ldvr < *n) {
  662. *info = -11;
  663. }
  664. /* Compute workspace */
  665. /* (Note: Comments in the code beginning "Workspace:" describe the */
  666. /* minimal amount of workspace needed at that point in the code, */
  667. /* as well as the preferred amount for good performance. */
  668. /* NB refers to the optimal block size for the immediately */
  669. /* following subroutine, as returned by ILAENV. */
  670. /* HSWORK refers to the workspace preferred by DHSEQR, as */
  671. /* calculated below. HSWORK is computed assuming ILO=1 and IHI=N, */
  672. /* the worst case.) */
  673. if (*info == 0) {
  674. if (*n == 0) {
  675. minwrk = 1;
  676. maxwrk = 1;
  677. } else {
  678. maxwrk = (*n << 1) + *n * ilaenv_(&c__1, "DGEHRD", " ", n, &c__1,
  679. n, &c__0, (ftnlen)6, (ftnlen)1);
  680. if (wantvl) {
  681. minwrk = *n << 2;
  682. /* Computing MAX */
  683. i__1 = maxwrk, i__2 = (*n << 1) + (*n - 1) * ilaenv_(&c__1,
  684. "DORGHR", " ", n, &c__1, n, &c_n1, (ftnlen)6, (ftnlen)
  685. 1);
  686. maxwrk = f2cmax(i__1,i__2);
  687. dhseqr_("S", "V", n, &c__1, n, &a[a_offset], lda, &wr[1], &wi[
  688. 1], &vl[vl_offset], ldvl, &work[1], &c_n1, info);
  689. hswork = (integer) work[1];
  690. /* Computing MAX */
  691. i__1 = maxwrk, i__2 = *n + 1, i__1 = f2cmax(i__1,i__2), i__2 = *
  692. n + hswork;
  693. maxwrk = f2cmax(i__1,i__2);
  694. dtrevc3_("L", "B", select, n, &a[a_offset], lda, &vl[
  695. vl_offset], ldvl, &vr[vr_offset], ldvr, n, &nout, &
  696. work[1], &c_n1, &ierr);
  697. lwork_trevc__ = (integer) work[1];
  698. /* Computing MAX */
  699. i__1 = maxwrk, i__2 = *n + lwork_trevc__;
  700. maxwrk = f2cmax(i__1,i__2);
  701. /* Computing MAX */
  702. i__1 = maxwrk, i__2 = *n << 2;
  703. maxwrk = f2cmax(i__1,i__2);
  704. } else if (wantvr) {
  705. minwrk = *n << 2;
  706. /* Computing MAX */
  707. i__1 = maxwrk, i__2 = (*n << 1) + (*n - 1) * ilaenv_(&c__1,
  708. "DORGHR", " ", n, &c__1, n, &c_n1, (ftnlen)6, (ftnlen)
  709. 1);
  710. maxwrk = f2cmax(i__1,i__2);
  711. dhseqr_("S", "V", n, &c__1, n, &a[a_offset], lda, &wr[1], &wi[
  712. 1], &vr[vr_offset], ldvr, &work[1], &c_n1, info);
  713. hswork = (integer) work[1];
  714. /* Computing MAX */
  715. i__1 = maxwrk, i__2 = *n + 1, i__1 = f2cmax(i__1,i__2), i__2 = *
  716. n + hswork;
  717. maxwrk = f2cmax(i__1,i__2);
  718. dtrevc3_("R", "B", select, n, &a[a_offset], lda, &vl[
  719. vl_offset], ldvl, &vr[vr_offset], ldvr, n, &nout, &
  720. work[1], &c_n1, &ierr);
  721. lwork_trevc__ = (integer) work[1];
  722. /* Computing MAX */
  723. i__1 = maxwrk, i__2 = *n + lwork_trevc__;
  724. maxwrk = f2cmax(i__1,i__2);
  725. /* Computing MAX */
  726. i__1 = maxwrk, i__2 = *n << 2;
  727. maxwrk = f2cmax(i__1,i__2);
  728. } else {
  729. minwrk = *n * 3;
  730. dhseqr_("E", "N", n, &c__1, n, &a[a_offset], lda, &wr[1], &wi[
  731. 1], &vr[vr_offset], ldvr, &work[1], &c_n1, info);
  732. hswork = (integer) work[1];
  733. /* Computing MAX */
  734. i__1 = maxwrk, i__2 = *n + 1, i__1 = f2cmax(i__1,i__2), i__2 = *
  735. n + hswork;
  736. maxwrk = f2cmax(i__1,i__2);
  737. }
  738. maxwrk = f2cmax(maxwrk,minwrk);
  739. }
  740. work[1] = (doublereal) maxwrk;
  741. if (*lwork < minwrk && ! lquery) {
  742. *info = -13;
  743. }
  744. }
  745. if (*info != 0) {
  746. i__1 = -(*info);
  747. xerbla_("DGEEV ", &i__1, (ftnlen)6);
  748. return 0;
  749. } else if (lquery) {
  750. return 0;
  751. }
  752. /* Quick return if possible */
  753. if (*n == 0) {
  754. return 0;
  755. }
  756. /* Get machine constants */
  757. eps = dlamch_("P");
  758. smlnum = dlamch_("S");
  759. bignum = 1. / smlnum;
  760. dlabad_(&smlnum, &bignum);
  761. smlnum = sqrt(smlnum) / eps;
  762. bignum = 1. / smlnum;
  763. /* Scale A if f2cmax element outside range [SMLNUM,BIGNUM] */
  764. anrm = dlange_("M", n, n, &a[a_offset], lda, dum);
  765. scalea = FALSE_;
  766. if (anrm > 0. && anrm < smlnum) {
  767. scalea = TRUE_;
  768. cscale = smlnum;
  769. } else if (anrm > bignum) {
  770. scalea = TRUE_;
  771. cscale = bignum;
  772. }
  773. if (scalea) {
  774. dlascl_("G", &c__0, &c__0, &anrm, &cscale, n, n, &a[a_offset], lda, &
  775. ierr);
  776. }
  777. /* Balance the matrix */
  778. /* (Workspace: need N) */
  779. ibal = 1;
  780. dgebal_("B", n, &a[a_offset], lda, &ilo, &ihi, &work[ibal], &ierr);
  781. /* Reduce to upper Hessenberg form */
  782. /* (Workspace: need 3*N, prefer 2*N+N*NB) */
  783. itau = ibal + *n;
  784. iwrk = itau + *n;
  785. i__1 = *lwork - iwrk + 1;
  786. dgehrd_(n, &ilo, &ihi, &a[a_offset], lda, &work[itau], &work[iwrk], &i__1,
  787. &ierr);
  788. if (wantvl) {
  789. /* Want left eigenvectors */
  790. /* Copy Householder vectors to VL */
  791. *(unsigned char *)side = 'L';
  792. dlacpy_("L", n, n, &a[a_offset], lda, &vl[vl_offset], ldvl)
  793. ;
  794. /* Generate orthogonal matrix in VL */
  795. /* (Workspace: need 3*N-1, prefer 2*N+(N-1)*NB) */
  796. i__1 = *lwork - iwrk + 1;
  797. dorghr_(n, &ilo, &ihi, &vl[vl_offset], ldvl, &work[itau], &work[iwrk],
  798. &i__1, &ierr);
  799. /* Perform QR iteration, accumulating Schur vectors in VL */
  800. /* (Workspace: need N+1, prefer N+HSWORK (see comments) ) */
  801. iwrk = itau;
  802. i__1 = *lwork - iwrk + 1;
  803. dhseqr_("S", "V", n, &ilo, &ihi, &a[a_offset], lda, &wr[1], &wi[1], &
  804. vl[vl_offset], ldvl, &work[iwrk], &i__1, info);
  805. if (wantvr) {
  806. /* Want left and right eigenvectors */
  807. /* Copy Schur vectors to VR */
  808. *(unsigned char *)side = 'B';
  809. dlacpy_("F", n, n, &vl[vl_offset], ldvl, &vr[vr_offset], ldvr);
  810. }
  811. } else if (wantvr) {
  812. /* Want right eigenvectors */
  813. /* Copy Householder vectors to VR */
  814. *(unsigned char *)side = 'R';
  815. dlacpy_("L", n, n, &a[a_offset], lda, &vr[vr_offset], ldvr)
  816. ;
  817. /* Generate orthogonal matrix in VR */
  818. /* (Workspace: need 3*N-1, prefer 2*N+(N-1)*NB) */
  819. i__1 = *lwork - iwrk + 1;
  820. dorghr_(n, &ilo, &ihi, &vr[vr_offset], ldvr, &work[itau], &work[iwrk],
  821. &i__1, &ierr);
  822. /* Perform QR iteration, accumulating Schur vectors in VR */
  823. /* (Workspace: need N+1, prefer N+HSWORK (see comments) ) */
  824. iwrk = itau;
  825. i__1 = *lwork - iwrk + 1;
  826. dhseqr_("S", "V", n, &ilo, &ihi, &a[a_offset], lda, &wr[1], &wi[1], &
  827. vr[vr_offset], ldvr, &work[iwrk], &i__1, info);
  828. } else {
  829. /* Compute eigenvalues only */
  830. /* (Workspace: need N+1, prefer N+HSWORK (see comments) ) */
  831. iwrk = itau;
  832. i__1 = *lwork - iwrk + 1;
  833. dhseqr_("E", "N", n, &ilo, &ihi, &a[a_offset], lda, &wr[1], &wi[1], &
  834. vr[vr_offset], ldvr, &work[iwrk], &i__1, info);
  835. }
  836. /* If INFO .NE. 0 from DHSEQR, then quit */
  837. if (*info != 0) {
  838. goto L50;
  839. }
  840. if (wantvl || wantvr) {
  841. /* Compute left and/or right eigenvectors */
  842. /* (Workspace: need 4*N, prefer N + N + 2*N*NB) */
  843. i__1 = *lwork - iwrk + 1;
  844. dtrevc3_(side, "B", select, n, &a[a_offset], lda, &vl[vl_offset],
  845. ldvl, &vr[vr_offset], ldvr, n, &nout, &work[iwrk], &i__1, &
  846. ierr);
  847. }
  848. if (wantvl) {
  849. /* Undo balancing of left eigenvectors */
  850. /* (Workspace: need N) */
  851. dgebak_("B", "L", n, &ilo, &ihi, &work[ibal], n, &vl[vl_offset], ldvl,
  852. &ierr);
  853. /* Normalize left eigenvectors and make largest component real */
  854. i__1 = *n;
  855. for (i__ = 1; i__ <= i__1; ++i__) {
  856. if (wi[i__] == 0.) {
  857. scl = 1. / dnrm2_(n, &vl[i__ * vl_dim1 + 1], &c__1);
  858. dscal_(n, &scl, &vl[i__ * vl_dim1 + 1], &c__1);
  859. } else if (wi[i__] > 0.) {
  860. d__1 = dnrm2_(n, &vl[i__ * vl_dim1 + 1], &c__1);
  861. d__2 = dnrm2_(n, &vl[(i__ + 1) * vl_dim1 + 1], &c__1);
  862. scl = 1. / dlapy2_(&d__1, &d__2);
  863. dscal_(n, &scl, &vl[i__ * vl_dim1 + 1], &c__1);
  864. dscal_(n, &scl, &vl[(i__ + 1) * vl_dim1 + 1], &c__1);
  865. i__2 = *n;
  866. for (k = 1; k <= i__2; ++k) {
  867. /* Computing 2nd power */
  868. d__1 = vl[k + i__ * vl_dim1];
  869. /* Computing 2nd power */
  870. d__2 = vl[k + (i__ + 1) * vl_dim1];
  871. work[iwrk + k - 1] = d__1 * d__1 + d__2 * d__2;
  872. /* L10: */
  873. }
  874. k = idamax_(n, &work[iwrk], &c__1);
  875. dlartg_(&vl[k + i__ * vl_dim1], &vl[k + (i__ + 1) * vl_dim1],
  876. &cs, &sn, &r__);
  877. drot_(n, &vl[i__ * vl_dim1 + 1], &c__1, &vl[(i__ + 1) *
  878. vl_dim1 + 1], &c__1, &cs, &sn);
  879. vl[k + (i__ + 1) * vl_dim1] = 0.;
  880. }
  881. /* L20: */
  882. }
  883. }
  884. if (wantvr) {
  885. /* Undo balancing of right eigenvectors */
  886. /* (Workspace: need N) */
  887. dgebak_("B", "R", n, &ilo, &ihi, &work[ibal], n, &vr[vr_offset], ldvr,
  888. &ierr);
  889. /* Normalize right eigenvectors and make largest component real */
  890. i__1 = *n;
  891. for (i__ = 1; i__ <= i__1; ++i__) {
  892. if (wi[i__] == 0.) {
  893. scl = 1. / dnrm2_(n, &vr[i__ * vr_dim1 + 1], &c__1);
  894. dscal_(n, &scl, &vr[i__ * vr_dim1 + 1], &c__1);
  895. } else if (wi[i__] > 0.) {
  896. d__1 = dnrm2_(n, &vr[i__ * vr_dim1 + 1], &c__1);
  897. d__2 = dnrm2_(n, &vr[(i__ + 1) * vr_dim1 + 1], &c__1);
  898. scl = 1. / dlapy2_(&d__1, &d__2);
  899. dscal_(n, &scl, &vr[i__ * vr_dim1 + 1], &c__1);
  900. dscal_(n, &scl, &vr[(i__ + 1) * vr_dim1 + 1], &c__1);
  901. i__2 = *n;
  902. for (k = 1; k <= i__2; ++k) {
  903. /* Computing 2nd power */
  904. d__1 = vr[k + i__ * vr_dim1];
  905. /* Computing 2nd power */
  906. d__2 = vr[k + (i__ + 1) * vr_dim1];
  907. work[iwrk + k - 1] = d__1 * d__1 + d__2 * d__2;
  908. /* L30: */
  909. }
  910. k = idamax_(n, &work[iwrk], &c__1);
  911. dlartg_(&vr[k + i__ * vr_dim1], &vr[k + (i__ + 1) * vr_dim1],
  912. &cs, &sn, &r__);
  913. drot_(n, &vr[i__ * vr_dim1 + 1], &c__1, &vr[(i__ + 1) *
  914. vr_dim1 + 1], &c__1, &cs, &sn);
  915. vr[k + (i__ + 1) * vr_dim1] = 0.;
  916. }
  917. /* L40: */
  918. }
  919. }
  920. /* Undo scaling if necessary */
  921. L50:
  922. if (scalea) {
  923. i__1 = *n - *info;
  924. /* Computing MAX */
  925. i__3 = *n - *info;
  926. i__2 = f2cmax(i__3,1);
  927. dlascl_("G", &c__0, &c__0, &cscale, &anrm, &i__1, &c__1, &wr[*info +
  928. 1], &i__2, &ierr);
  929. i__1 = *n - *info;
  930. /* Computing MAX */
  931. i__3 = *n - *info;
  932. i__2 = f2cmax(i__3,1);
  933. dlascl_("G", &c__0, &c__0, &cscale, &anrm, &i__1, &c__1, &wi[*info +
  934. 1], &i__2, &ierr);
  935. if (*info > 0) {
  936. i__1 = ilo - 1;
  937. dlascl_("G", &c__0, &c__0, &cscale, &anrm, &i__1, &c__1, &wr[1],
  938. n, &ierr);
  939. i__1 = ilo - 1;
  940. dlascl_("G", &c__0, &c__0, &cscale, &anrm, &i__1, &c__1, &wi[1],
  941. n, &ierr);
  942. }
  943. }
  944. work[1] = (doublereal) maxwrk;
  945. return 0;
  946. /* End of DGEEV */
  947. } /* dgeev_ */