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.

slahqr.c 32 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110
  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. /* > \brief \b SLAHQR computes the eigenvalues and Schur factorization of an upper Hessenberg matrix, using th
  382. e double-shift/single-shift QR algorithm. */
  383. /* =========== DOCUMENTATION =========== */
  384. /* Online html documentation available at */
  385. /* http://www.netlib.org/lapack/explore-html/ */
  386. /* > \htmlonly */
  387. /* > Download SLAHQR + dependencies */
  388. /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/slahqr.
  389. f"> */
  390. /* > [TGZ]</a> */
  391. /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/slahqr.
  392. f"> */
  393. /* > [ZIP]</a> */
  394. /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/slahqr.
  395. f"> */
  396. /* > [TXT]</a> */
  397. /* > \endhtmlonly */
  398. /* Definition: */
  399. /* =========== */
  400. /* SUBROUTINE SLAHQR( WANTT, WANTZ, N, ILO, IHI, H, LDH, WR, WI, */
  401. /* ILOZ, IHIZ, Z, LDZ, INFO ) */
  402. /* INTEGER IHI, IHIZ, ILO, ILOZ, INFO, LDH, LDZ, N */
  403. /* LOGICAL WANTT, WANTZ */
  404. /* REAL H( LDH, * ), WI( * ), WR( * ), Z( LDZ, * ) */
  405. /* > \par Purpose: */
  406. /* ============= */
  407. /* > */
  408. /* > \verbatim */
  409. /* > */
  410. /* > SLAHQR is an auxiliary routine called by SHSEQR to update the */
  411. /* > eigenvalues and Schur decomposition already computed by SHSEQR, by */
  412. /* > dealing with the Hessenberg submatrix in rows and columns ILO to */
  413. /* > IHI. */
  414. /* > \endverbatim */
  415. /* Arguments: */
  416. /* ========== */
  417. /* > \param[in] WANTT */
  418. /* > \verbatim */
  419. /* > WANTT is LOGICAL */
  420. /* > = .TRUE. : the full Schur form T is required; */
  421. /* > = .FALSE.: only eigenvalues are required. */
  422. /* > \endverbatim */
  423. /* > */
  424. /* > \param[in] WANTZ */
  425. /* > \verbatim */
  426. /* > WANTZ is LOGICAL */
  427. /* > = .TRUE. : the matrix of Schur vectors Z is required; */
  428. /* > = .FALSE.: Schur vectors are not required. */
  429. /* > \endverbatim */
  430. /* > */
  431. /* > \param[in] N */
  432. /* > \verbatim */
  433. /* > N is INTEGER */
  434. /* > The order of the matrix H. N >= 0. */
  435. /* > \endverbatim */
  436. /* > */
  437. /* > \param[in] ILO */
  438. /* > \verbatim */
  439. /* > ILO is INTEGER */
  440. /* > \endverbatim */
  441. /* > */
  442. /* > \param[in] IHI */
  443. /* > \verbatim */
  444. /* > IHI is INTEGER */
  445. /* > It is assumed that H is already upper quasi-triangular in */
  446. /* > rows and columns IHI+1:N, and that H(ILO,ILO-1) = 0 (unless */
  447. /* > ILO = 1). SLAHQR works primarily with the Hessenberg */
  448. /* > submatrix in rows and columns ILO to IHI, but applies */
  449. /* > transformations to all of H if WANTT is .TRUE.. */
  450. /* > 1 <= ILO <= f2cmax(1,IHI); IHI <= N. */
  451. /* > \endverbatim */
  452. /* > */
  453. /* > \param[in,out] H */
  454. /* > \verbatim */
  455. /* > H is REAL array, dimension (LDH,N) */
  456. /* > On entry, the upper Hessenberg matrix H. */
  457. /* > On exit, if INFO is zero and if WANTT is .TRUE., H is upper */
  458. /* > quasi-triangular in rows and columns ILO:IHI, with any */
  459. /* > 2-by-2 diagonal blocks in standard form. If INFO is zero */
  460. /* > and WANTT is .FALSE., the contents of H are unspecified on */
  461. /* > exit. The output state of H if INFO is nonzero is given */
  462. /* > below under the description of INFO. */
  463. /* > \endverbatim */
  464. /* > */
  465. /* > \param[in] LDH */
  466. /* > \verbatim */
  467. /* > LDH is INTEGER */
  468. /* > The leading dimension of the array H. LDH >= f2cmax(1,N). */
  469. /* > \endverbatim */
  470. /* > */
  471. /* > \param[out] WR */
  472. /* > \verbatim */
  473. /* > WR is REAL array, dimension (N) */
  474. /* > \endverbatim */
  475. /* > */
  476. /* > \param[out] WI */
  477. /* > \verbatim */
  478. /* > WI is REAL array, dimension (N) */
  479. /* > The real and imaginary parts, respectively, of the computed */
  480. /* > eigenvalues ILO to IHI are stored in the corresponding */
  481. /* > elements of WR and WI. If two eigenvalues are computed as a */
  482. /* > complex conjugate pair, they are stored in consecutive */
  483. /* > elements of WR and WI, say the i-th and (i+1)th, with */
  484. /* > WI(i) > 0 and WI(i+1) < 0. If WANTT is .TRUE., the */
  485. /* > eigenvalues are stored in the same order as on the diagonal */
  486. /* > of the Schur form returned in H, with WR(i) = H(i,i), and, if */
  487. /* > H(i:i+1,i:i+1) is a 2-by-2 diagonal block, */
  488. /* > WI(i) = sqrt(H(i+1,i)*H(i,i+1)) and WI(i+1) = -WI(i). */
  489. /* > \endverbatim */
  490. /* > */
  491. /* > \param[in] ILOZ */
  492. /* > \verbatim */
  493. /* > ILOZ is INTEGER */
  494. /* > \endverbatim */
  495. /* > */
  496. /* > \param[in] IHIZ */
  497. /* > \verbatim */
  498. /* > IHIZ is INTEGER */
  499. /* > Specify the rows of Z to which transformations must be */
  500. /* > applied if WANTZ is .TRUE.. */
  501. /* > 1 <= ILOZ <= ILO; IHI <= IHIZ <= N. */
  502. /* > \endverbatim */
  503. /* > */
  504. /* > \param[in,out] Z */
  505. /* > \verbatim */
  506. /* > Z is REAL array, dimension (LDZ,N) */
  507. /* > If WANTZ is .TRUE., on entry Z must contain the current */
  508. /* > matrix Z of transformations accumulated by SHSEQR, and on */
  509. /* > exit Z has been updated; transformations are applied only to */
  510. /* > the submatrix Z(ILOZ:IHIZ,ILO:IHI). */
  511. /* > If WANTZ is .FALSE., Z is not referenced. */
  512. /* > \endverbatim */
  513. /* > */
  514. /* > \param[in] LDZ */
  515. /* > \verbatim */
  516. /* > LDZ is INTEGER */
  517. /* > The leading dimension of the array Z. LDZ >= f2cmax(1,N). */
  518. /* > \endverbatim */
  519. /* > */
  520. /* > \param[out] INFO */
  521. /* > \verbatim */
  522. /* > INFO is INTEGER */
  523. /* > = 0: successful exit */
  524. /* > > 0: If INFO = i, SLAHQR failed to compute all the */
  525. /* > eigenvalues ILO to IHI in a total of 30 iterations */
  526. /* > per eigenvalue; elements i+1:ihi of WR and WI */
  527. /* > contain those eigenvalues which have been */
  528. /* > successfully computed. */
  529. /* > */
  530. /* > If INFO > 0 and WANTT is .FALSE., then on exit, */
  531. /* > the remaining unconverged eigenvalues are the */
  532. /* > eigenvalues of the upper Hessenberg matrix rows */
  533. /* > and columns ILO through INFO of the final, output */
  534. /* > value of H. */
  535. /* > */
  536. /* > If INFO > 0 and WANTT is .TRUE., then on exit */
  537. /* > (*) (initial value of H)*U = U*(final value of H) */
  538. /* > where U is an orthogonal matrix. The final */
  539. /* > value of H is upper Hessenberg and triangular in */
  540. /* > rows and columns INFO+1 through IHI. */
  541. /* > */
  542. /* > If INFO > 0 and WANTZ is .TRUE., then on exit */
  543. /* > (final value of Z) = (initial value of Z)*U */
  544. /* > where U is the orthogonal matrix in (*) */
  545. /* > (regardless of the value of WANTT.) */
  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 December 2016 */
  554. /* > \ingroup realOTHERauxiliary */
  555. /* > \par Further Details: */
  556. /* ===================== */
  557. /* > */
  558. /* > \verbatim */
  559. /* > */
  560. /* > 02-96 Based on modifications by */
  561. /* > David Day, Sandia National Laboratory, USA */
  562. /* > */
  563. /* > 12-04 Further modifications by */
  564. /* > Ralph Byers, University of Kansas, USA */
  565. /* > This is a modified version of SLAHQR from LAPACK version 3.0. */
  566. /* > It is (1) more robust against overflow and underflow and */
  567. /* > (2) adopts the more conservative Ahues & Tisseur stopping */
  568. /* > criterion (LAWN 122, 1997). */
  569. /* > \endverbatim */
  570. /* > */
  571. /* ===================================================================== */
  572. /* Subroutine */ int slahqr_(logical *wantt, logical *wantz, integer *n,
  573. integer *ilo, integer *ihi, real *h__, integer *ldh, real *wr, real *
  574. wi, integer *iloz, integer *ihiz, real *z__, integer *ldz, integer *
  575. info)
  576. {
  577. /* System generated locals */
  578. integer h_dim1, h_offset, z_dim1, z_offset, i__1, i__2, i__3, i__4;
  579. real r__1, r__2, r__3, r__4;
  580. /* Local variables */
  581. extern /* Subroutine */ int srot_(integer *, real *, integer *, real *,
  582. integer *, real *, real *);
  583. integer i__, j, k, l, m;
  584. real s, v[3];
  585. integer itmax, i1, i2;
  586. extern /* Subroutine */ int scopy_(integer *, real *, integer *, real *,
  587. integer *);
  588. real t1, t2, t3, v2, v3, aa, ab, ba, bb;
  589. extern /* Subroutine */ int slanv2_(real *, real *, real *, real *, real *
  590. , real *, real *, real *, real *, real *);
  591. real h11, h12, h21, h22, cs;
  592. integer nh;
  593. extern /* Subroutine */ int slabad_(real *, real *);
  594. real sn;
  595. integer nr;
  596. real tr;
  597. extern real slamch_(char *);
  598. integer nz;
  599. real safmin;
  600. extern /* Subroutine */ int slarfg_(integer *, real *, real *, integer *,
  601. real *);
  602. real safmax, rtdisc, smlnum, det, h21s;
  603. integer its;
  604. real ulp, sum, tst, rt1i, rt2i, rt1r, rt2r;
  605. /* -- LAPACK auxiliary routine (version 3.7.0) -- */
  606. /* -- LAPACK is a software package provided by Univ. of Tennessee, -- */
  607. /* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- */
  608. /* December 2016 */
  609. /* ========================================================= */
  610. /* Parameter adjustments */
  611. h_dim1 = *ldh;
  612. h_offset = 1 + h_dim1 * 1;
  613. h__ -= h_offset;
  614. --wr;
  615. --wi;
  616. z_dim1 = *ldz;
  617. z_offset = 1 + z_dim1 * 1;
  618. z__ -= z_offset;
  619. /* Function Body */
  620. *info = 0;
  621. /* Quick return if possible */
  622. if (*n == 0) {
  623. return 0;
  624. }
  625. if (*ilo == *ihi) {
  626. wr[*ilo] = h__[*ilo + *ilo * h_dim1];
  627. wi[*ilo] = 0.f;
  628. return 0;
  629. }
  630. /* ==== clear out the trash ==== */
  631. i__1 = *ihi - 3;
  632. for (j = *ilo; j <= i__1; ++j) {
  633. h__[j + 2 + j * h_dim1] = 0.f;
  634. h__[j + 3 + j * h_dim1] = 0.f;
  635. /* L10: */
  636. }
  637. if (*ilo <= *ihi - 2) {
  638. h__[*ihi + (*ihi - 2) * h_dim1] = 0.f;
  639. }
  640. nh = *ihi - *ilo + 1;
  641. nz = *ihiz - *iloz + 1;
  642. /* Set machine-dependent constants for the stopping criterion. */
  643. safmin = slamch_("SAFE MINIMUM");
  644. safmax = 1.f / safmin;
  645. slabad_(&safmin, &safmax);
  646. ulp = slamch_("PRECISION");
  647. smlnum = safmin * ((real) nh / ulp);
  648. /* I1 and I2 are the indices of the first row and last column of H */
  649. /* to which transformations must be applied. If eigenvalues only are */
  650. /* being computed, I1 and I2 are set inside the main loop. */
  651. if (*wantt) {
  652. i1 = 1;
  653. i2 = *n;
  654. }
  655. /* ITMAX is the total number of QR iterations allowed. */
  656. itmax = f2cmax(10,nh) * 30;
  657. /* The main loop begins here. I is the loop index and decreases from */
  658. /* IHI to ILO in steps of 1 or 2. Each iteration of the loop works */
  659. /* with the active submatrix in rows and columns L to I. */
  660. /* Eigenvalues I+1 to IHI have already converged. Either L = ILO or */
  661. /* H(L,L-1) is negligible so that the matrix splits. */
  662. i__ = *ihi;
  663. L20:
  664. l = *ilo;
  665. if (i__ < *ilo) {
  666. goto L160;
  667. }
  668. /* Perform QR iterations on rows and columns ILO to I until a */
  669. /* submatrix of order 1 or 2 splits off at the bottom because a */
  670. /* subdiagonal element has become negligible. */
  671. i__1 = itmax;
  672. for (its = 0; its <= i__1; ++its) {
  673. /* Look for a single small subdiagonal element. */
  674. i__2 = l + 1;
  675. for (k = i__; k >= i__2; --k) {
  676. if ((r__1 = h__[k + (k - 1) * h_dim1], abs(r__1)) <= smlnum) {
  677. goto L40;
  678. }
  679. tst = (r__1 = h__[k - 1 + (k - 1) * h_dim1], abs(r__1)) + (r__2 =
  680. h__[k + k * h_dim1], abs(r__2));
  681. if (tst == 0.f) {
  682. if (k - 2 >= *ilo) {
  683. tst += (r__1 = h__[k - 1 + (k - 2) * h_dim1], abs(r__1));
  684. }
  685. if (k + 1 <= *ihi) {
  686. tst += (r__1 = h__[k + 1 + k * h_dim1], abs(r__1));
  687. }
  688. }
  689. /* ==== The following is a conservative small subdiagonal */
  690. /* . deflation criterion due to Ahues & Tisseur (LAWN 122, */
  691. /* . 1997). It has better mathematical foundation and */
  692. /* . improves accuracy in some cases. ==== */
  693. if ((r__1 = h__[k + (k - 1) * h_dim1], abs(r__1)) <= ulp * tst) {
  694. /* Computing MAX */
  695. r__3 = (r__1 = h__[k + (k - 1) * h_dim1], abs(r__1)), r__4 = (
  696. r__2 = h__[k - 1 + k * h_dim1], abs(r__2));
  697. ab = f2cmax(r__3,r__4);
  698. /* Computing MIN */
  699. r__3 = (r__1 = h__[k + (k - 1) * h_dim1], abs(r__1)), r__4 = (
  700. r__2 = h__[k - 1 + k * h_dim1], abs(r__2));
  701. ba = f2cmin(r__3,r__4);
  702. /* Computing MAX */
  703. r__3 = (r__1 = h__[k + k * h_dim1], abs(r__1)), r__4 = (r__2 =
  704. h__[k - 1 + (k - 1) * h_dim1] - h__[k + k * h_dim1],
  705. abs(r__2));
  706. aa = f2cmax(r__3,r__4);
  707. /* Computing MIN */
  708. r__3 = (r__1 = h__[k + k * h_dim1], abs(r__1)), r__4 = (r__2 =
  709. h__[k - 1 + (k - 1) * h_dim1] - h__[k + k * h_dim1],
  710. abs(r__2));
  711. bb = f2cmin(r__3,r__4);
  712. s = aa + ab;
  713. /* Computing MAX */
  714. r__1 = smlnum, r__2 = ulp * (bb * (aa / s));
  715. if (ba * (ab / s) <= f2cmax(r__1,r__2)) {
  716. goto L40;
  717. }
  718. }
  719. /* L30: */
  720. }
  721. L40:
  722. l = k;
  723. if (l > *ilo) {
  724. /* H(L,L-1) is negligible */
  725. h__[l + (l - 1) * h_dim1] = 0.f;
  726. }
  727. /* Exit from loop if a submatrix of order 1 or 2 has split off. */
  728. if (l >= i__ - 1) {
  729. goto L150;
  730. }
  731. /* Now the active submatrix is in rows and columns L to I. If */
  732. /* eigenvalues only are being computed, only the active submatrix */
  733. /* need be transformed. */
  734. if (! (*wantt)) {
  735. i1 = l;
  736. i2 = i__;
  737. }
  738. if (its == 10) {
  739. /* Exceptional shift. */
  740. s = (r__1 = h__[l + 1 + l * h_dim1], abs(r__1)) + (r__2 = h__[l +
  741. 2 + (l + 1) * h_dim1], abs(r__2));
  742. h11 = s * .75f + h__[l + l * h_dim1];
  743. h12 = s * -.4375f;
  744. h21 = s;
  745. h22 = h11;
  746. } else if (its == 20) {
  747. /* Exceptional shift. */
  748. s = (r__1 = h__[i__ + (i__ - 1) * h_dim1], abs(r__1)) + (r__2 =
  749. h__[i__ - 1 + (i__ - 2) * h_dim1], abs(r__2));
  750. h11 = s * .75f + h__[i__ + i__ * h_dim1];
  751. h12 = s * -.4375f;
  752. h21 = s;
  753. h22 = h11;
  754. } else {
  755. /* Prepare to use Francis' double shift */
  756. /* (i.e. 2nd degree generalized Rayleigh quotient) */
  757. h11 = h__[i__ - 1 + (i__ - 1) * h_dim1];
  758. h21 = h__[i__ + (i__ - 1) * h_dim1];
  759. h12 = h__[i__ - 1 + i__ * h_dim1];
  760. h22 = h__[i__ + i__ * h_dim1];
  761. }
  762. s = abs(h11) + abs(h12) + abs(h21) + abs(h22);
  763. if (s == 0.f) {
  764. rt1r = 0.f;
  765. rt1i = 0.f;
  766. rt2r = 0.f;
  767. rt2i = 0.f;
  768. } else {
  769. h11 /= s;
  770. h21 /= s;
  771. h12 /= s;
  772. h22 /= s;
  773. tr = (h11 + h22) / 2.f;
  774. det = (h11 - tr) * (h22 - tr) - h12 * h21;
  775. rtdisc = sqrt((abs(det)));
  776. if (det >= 0.f) {
  777. /* ==== complex conjugate shifts ==== */
  778. rt1r = tr * s;
  779. rt2r = rt1r;
  780. rt1i = rtdisc * s;
  781. rt2i = -rt1i;
  782. } else {
  783. /* ==== real shifts (use only one of them) ==== */
  784. rt1r = tr + rtdisc;
  785. rt2r = tr - rtdisc;
  786. if ((r__1 = rt1r - h22, abs(r__1)) <= (r__2 = rt2r - h22, abs(
  787. r__2))) {
  788. rt1r *= s;
  789. rt2r = rt1r;
  790. } else {
  791. rt2r *= s;
  792. rt1r = rt2r;
  793. }
  794. rt1i = 0.f;
  795. rt2i = 0.f;
  796. }
  797. }
  798. /* Look for two consecutive small subdiagonal elements. */
  799. i__2 = l;
  800. for (m = i__ - 2; m >= i__2; --m) {
  801. /* Determine the effect of starting the double-shift QR */
  802. /* iteration at row M, and see if this would make H(M,M-1) */
  803. /* negligible. (The following uses scaling to avoid */
  804. /* overflows and most underflows.) */
  805. h21s = h__[m + 1 + m * h_dim1];
  806. s = (r__1 = h__[m + m * h_dim1] - rt2r, abs(r__1)) + abs(rt2i) +
  807. abs(h21s);
  808. h21s = h__[m + 1 + m * h_dim1] / s;
  809. v[0] = h21s * h__[m + (m + 1) * h_dim1] + (h__[m + m * h_dim1] -
  810. rt1r) * ((h__[m + m * h_dim1] - rt2r) / s) - rt1i * (rt2i
  811. / s);
  812. v[1] = h21s * (h__[m + m * h_dim1] + h__[m + 1 + (m + 1) * h_dim1]
  813. - rt1r - rt2r);
  814. v[2] = h21s * h__[m + 2 + (m + 1) * h_dim1];
  815. s = abs(v[0]) + abs(v[1]) + abs(v[2]);
  816. v[0] /= s;
  817. v[1] /= s;
  818. v[2] /= s;
  819. if (m == l) {
  820. goto L60;
  821. }
  822. if ((r__1 = h__[m + (m - 1) * h_dim1], abs(r__1)) * (abs(v[1]) +
  823. abs(v[2])) <= ulp * abs(v[0]) * ((r__2 = h__[m - 1 + (m -
  824. 1) * h_dim1], abs(r__2)) + (r__3 = h__[m + m * h_dim1],
  825. abs(r__3)) + (r__4 = h__[m + 1 + (m + 1) * h_dim1], abs(
  826. r__4)))) {
  827. goto L60;
  828. }
  829. /* L50: */
  830. }
  831. L60:
  832. /* Double-shift QR step */
  833. i__2 = i__ - 1;
  834. for (k = m; k <= i__2; ++k) {
  835. /* The first iteration of this loop determines a reflection G */
  836. /* from the vector V and applies it from left and right to H, */
  837. /* thus creating a nonzero bulge below the subdiagonal. */
  838. /* Each subsequent iteration determines a reflection G to */
  839. /* restore the Hessenberg form in the (K-1)th column, and thus */
  840. /* chases the bulge one step toward the bottom of the active */
  841. /* submatrix. NR is the order of G. */
  842. /* Computing MIN */
  843. i__3 = 3, i__4 = i__ - k + 1;
  844. nr = f2cmin(i__3,i__4);
  845. if (k > m) {
  846. scopy_(&nr, &h__[k + (k - 1) * h_dim1], &c__1, v, &c__1);
  847. }
  848. slarfg_(&nr, v, &v[1], &c__1, &t1);
  849. if (k > m) {
  850. h__[k + (k - 1) * h_dim1] = v[0];
  851. h__[k + 1 + (k - 1) * h_dim1] = 0.f;
  852. if (k < i__ - 1) {
  853. h__[k + 2 + (k - 1) * h_dim1] = 0.f;
  854. }
  855. } else if (m > l) {
  856. /* ==== Use the following instead of */
  857. /* . H( K, K-1 ) = -H( K, K-1 ) to */
  858. /* . avoid a bug when v(2) and v(3) */
  859. /* . underflow. ==== */
  860. h__[k + (k - 1) * h_dim1] *= 1.f - t1;
  861. }
  862. v2 = v[1];
  863. t2 = t1 * v2;
  864. if (nr == 3) {
  865. v3 = v[2];
  866. t3 = t1 * v3;
  867. /* Apply G from the left to transform the rows of the matrix */
  868. /* in columns K to I2. */
  869. i__3 = i2;
  870. for (j = k; j <= i__3; ++j) {
  871. sum = h__[k + j * h_dim1] + v2 * h__[k + 1 + j * h_dim1]
  872. + v3 * h__[k + 2 + j * h_dim1];
  873. h__[k + j * h_dim1] -= sum * t1;
  874. h__[k + 1 + j * h_dim1] -= sum * t2;
  875. h__[k + 2 + j * h_dim1] -= sum * t3;
  876. /* L70: */
  877. }
  878. /* Apply G from the right to transform the columns of the */
  879. /* matrix in rows I1 to f2cmin(K+3,I). */
  880. /* Computing MIN */
  881. i__4 = k + 3;
  882. i__3 = f2cmin(i__4,i__);
  883. for (j = i1; j <= i__3; ++j) {
  884. sum = h__[j + k * h_dim1] + v2 * h__[j + (k + 1) * h_dim1]
  885. + v3 * h__[j + (k + 2) * h_dim1];
  886. h__[j + k * h_dim1] -= sum * t1;
  887. h__[j + (k + 1) * h_dim1] -= sum * t2;
  888. h__[j + (k + 2) * h_dim1] -= sum * t3;
  889. /* L80: */
  890. }
  891. if (*wantz) {
  892. /* Accumulate transformations in the matrix Z */
  893. i__3 = *ihiz;
  894. for (j = *iloz; j <= i__3; ++j) {
  895. sum = z__[j + k * z_dim1] + v2 * z__[j + (k + 1) *
  896. z_dim1] + v3 * z__[j + (k + 2) * z_dim1];
  897. z__[j + k * z_dim1] -= sum * t1;
  898. z__[j + (k + 1) * z_dim1] -= sum * t2;
  899. z__[j + (k + 2) * z_dim1] -= sum * t3;
  900. /* L90: */
  901. }
  902. }
  903. } else if (nr == 2) {
  904. /* Apply G from the left to transform the rows of the matrix */
  905. /* in columns K to I2. */
  906. i__3 = i2;
  907. for (j = k; j <= i__3; ++j) {
  908. sum = h__[k + j * h_dim1] + v2 * h__[k + 1 + j * h_dim1];
  909. h__[k + j * h_dim1] -= sum * t1;
  910. h__[k + 1 + j * h_dim1] -= sum * t2;
  911. /* L100: */
  912. }
  913. /* Apply G from the right to transform the columns of the */
  914. /* matrix in rows I1 to f2cmin(K+3,I). */
  915. i__3 = i__;
  916. for (j = i1; j <= i__3; ++j) {
  917. sum = h__[j + k * h_dim1] + v2 * h__[j + (k + 1) * h_dim1]
  918. ;
  919. h__[j + k * h_dim1] -= sum * t1;
  920. h__[j + (k + 1) * h_dim1] -= sum * t2;
  921. /* L110: */
  922. }
  923. if (*wantz) {
  924. /* Accumulate transformations in the matrix Z */
  925. i__3 = *ihiz;
  926. for (j = *iloz; j <= i__3; ++j) {
  927. sum = z__[j + k * z_dim1] + v2 * z__[j + (k + 1) *
  928. z_dim1];
  929. z__[j + k * z_dim1] -= sum * t1;
  930. z__[j + (k + 1) * z_dim1] -= sum * t2;
  931. /* L120: */
  932. }
  933. }
  934. }
  935. /* L130: */
  936. }
  937. /* L140: */
  938. }
  939. /* Failure to converge in remaining number of iterations */
  940. *info = i__;
  941. return 0;
  942. L150:
  943. if (l == i__) {
  944. /* H(I,I-1) is negligible: one eigenvalue has converged. */
  945. wr[i__] = h__[i__ + i__ * h_dim1];
  946. wi[i__] = 0.f;
  947. } else if (l == i__ - 1) {
  948. /* H(I-1,I-2) is negligible: a pair of eigenvalues have converged. */
  949. /* Transform the 2-by-2 submatrix to standard Schur form, */
  950. /* and compute and store the eigenvalues. */
  951. slanv2_(&h__[i__ - 1 + (i__ - 1) * h_dim1], &h__[i__ - 1 + i__ *
  952. h_dim1], &h__[i__ + (i__ - 1) * h_dim1], &h__[i__ + i__ *
  953. h_dim1], &wr[i__ - 1], &wi[i__ - 1], &wr[i__], &wi[i__], &cs,
  954. &sn);
  955. if (*wantt) {
  956. /* Apply the transformation to the rest of H. */
  957. if (i2 > i__) {
  958. i__1 = i2 - i__;
  959. srot_(&i__1, &h__[i__ - 1 + (i__ + 1) * h_dim1], ldh, &h__[
  960. i__ + (i__ + 1) * h_dim1], ldh, &cs, &sn);
  961. }
  962. i__1 = i__ - i1 - 1;
  963. srot_(&i__1, &h__[i1 + (i__ - 1) * h_dim1], &c__1, &h__[i1 + i__ *
  964. h_dim1], &c__1, &cs, &sn);
  965. }
  966. if (*wantz) {
  967. /* Apply the transformation to Z. */
  968. srot_(&nz, &z__[*iloz + (i__ - 1) * z_dim1], &c__1, &z__[*iloz +
  969. i__ * z_dim1], &c__1, &cs, &sn);
  970. }
  971. }
  972. /* return to start of the main loop with new value of I. */
  973. i__ = l - 1;
  974. goto L20;
  975. L160:
  976. return 0;
  977. /* End of SLAHQR */
  978. } /* slahqr_ */