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.

slaqr5.c 47 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531
  1. #include <math.h>
  2. #include <stdlib.h>
  3. #include <string.h>
  4. #include <stdio.h>
  5. #include <complex.h>
  6. #ifdef complex
  7. #undef complex
  8. #endif
  9. #ifdef I
  10. #undef I
  11. #endif
  12. #if defined(_WIN64)
  13. typedef long long BLASLONG;
  14. typedef unsigned long long BLASULONG;
  15. #else
  16. typedef long BLASLONG;
  17. typedef unsigned long BLASULONG;
  18. #endif
  19. #ifdef LAPACK_ILP64
  20. typedef BLASLONG blasint;
  21. #if defined(_WIN64)
  22. #define blasabs(x) llabs(x)
  23. #else
  24. #define blasabs(x) labs(x)
  25. #endif
  26. #else
  27. typedef int blasint;
  28. #define blasabs(x) abs(x)
  29. #endif
  30. typedef blasint integer;
  31. typedef unsigned int uinteger;
  32. typedef char *address;
  33. typedef short int shortint;
  34. typedef float real;
  35. typedef double doublereal;
  36. typedef struct { real r, i; } complex;
  37. typedef struct { doublereal r, i; } doublecomplex;
  38. #ifdef _MSC_VER
  39. static inline _Fcomplex Cf(complex *z) {_Fcomplex zz={z->r , z->i}; return zz;}
  40. static inline _Dcomplex Cd(doublecomplex *z) {_Dcomplex zz={z->r , z->i};return zz;}
  41. static inline _Fcomplex * _pCf(complex *z) {return (_Fcomplex*)z;}
  42. static inline _Dcomplex * _pCd(doublecomplex *z) {return (_Dcomplex*)z;}
  43. #else
  44. static inline _Complex float Cf(complex *z) {return z->r + z->i*_Complex_I;}
  45. static inline _Complex double Cd(doublecomplex *z) {return z->r + z->i*_Complex_I;}
  46. static inline _Complex float * _pCf(complex *z) {return (_Complex float*)z;}
  47. static inline _Complex double * _pCd(doublecomplex *z) {return (_Complex double*)z;}
  48. #endif
  49. #define pCf(z) (*_pCf(z))
  50. #define pCd(z) (*_pCd(z))
  51. typedef int logical;
  52. typedef short int shortlogical;
  53. typedef char logical1;
  54. typedef char integer1;
  55. #define TRUE_ (1)
  56. #define FALSE_ (0)
  57. /* Extern is for use with -E */
  58. #ifndef Extern
  59. #define Extern extern
  60. #endif
  61. /* I/O stuff */
  62. typedef int flag;
  63. typedef int ftnlen;
  64. typedef int ftnint;
  65. /*external read, write*/
  66. typedef struct
  67. { flag cierr;
  68. ftnint ciunit;
  69. flag ciend;
  70. char *cifmt;
  71. ftnint cirec;
  72. } cilist;
  73. /*internal read, write*/
  74. typedef struct
  75. { flag icierr;
  76. char *iciunit;
  77. flag iciend;
  78. char *icifmt;
  79. ftnint icirlen;
  80. ftnint icirnum;
  81. } icilist;
  82. /*open*/
  83. typedef struct
  84. { flag oerr;
  85. ftnint ounit;
  86. char *ofnm;
  87. ftnlen ofnmlen;
  88. char *osta;
  89. char *oacc;
  90. char *ofm;
  91. ftnint orl;
  92. char *oblnk;
  93. } olist;
  94. /*close*/
  95. typedef struct
  96. { flag cerr;
  97. ftnint cunit;
  98. char *csta;
  99. } cllist;
  100. /*rewind, backspace, endfile*/
  101. typedef struct
  102. { flag aerr;
  103. ftnint aunit;
  104. } alist;
  105. /* inquire */
  106. typedef struct
  107. { flag inerr;
  108. ftnint inunit;
  109. char *infile;
  110. ftnlen infilen;
  111. ftnint *inex; /*parameters in standard's order*/
  112. ftnint *inopen;
  113. ftnint *innum;
  114. ftnint *innamed;
  115. char *inname;
  116. ftnlen innamlen;
  117. char *inacc;
  118. ftnlen inacclen;
  119. char *inseq;
  120. ftnlen inseqlen;
  121. char *indir;
  122. ftnlen indirlen;
  123. char *infmt;
  124. ftnlen infmtlen;
  125. char *inform;
  126. ftnint informlen;
  127. char *inunf;
  128. ftnlen inunflen;
  129. ftnint *inrecl;
  130. ftnint *innrec;
  131. char *inblank;
  132. ftnlen inblanklen;
  133. } inlist;
  134. #define VOID void
  135. union Multitype { /* for multiple entry points */
  136. integer1 g;
  137. shortint h;
  138. integer i;
  139. /* longint j; */
  140. real r;
  141. doublereal d;
  142. complex c;
  143. doublecomplex z;
  144. };
  145. typedef union Multitype Multitype;
  146. struct Vardesc { /* for Namelist */
  147. char *name;
  148. char *addr;
  149. ftnlen *dims;
  150. int type;
  151. };
  152. typedef struct Vardesc Vardesc;
  153. struct Namelist {
  154. char *name;
  155. Vardesc **vars;
  156. int nvars;
  157. };
  158. typedef struct Namelist Namelist;
  159. #define abs(x) ((x) >= 0 ? (x) : -(x))
  160. #define dabs(x) (fabs(x))
  161. #define f2cmin(a,b) ((a) <= (b) ? (a) : (b))
  162. #define f2cmax(a,b) ((a) >= (b) ? (a) : (b))
  163. #define dmin(a,b) (f2cmin(a,b))
  164. #define dmax(a,b) (f2cmax(a,b))
  165. #define bit_test(a,b) ((a) >> (b) & 1)
  166. #define bit_clear(a,b) ((a) & ~((uinteger)1 << (b)))
  167. #define bit_set(a,b) ((a) | ((uinteger)1 << (b)))
  168. #define abort_() { sig_die("Fortran abort routine called", 1); }
  169. #define c_abs(z) (cabsf(Cf(z)))
  170. #define c_cos(R,Z) { pCf(R)=ccos(Cf(Z)); }
  171. #ifdef _MSC_VER
  172. #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]);}
  173. #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]/Cd(b)._Val[1]);}
  174. #else
  175. #define c_div(c, a, b) {pCf(c) = Cf(a)/Cf(b);}
  176. #define z_div(c, a, b) {pCd(c) = Cd(a)/Cd(b);}
  177. #endif
  178. #define c_exp(R, Z) {pCf(R) = cexpf(Cf(Z));}
  179. #define c_log(R, Z) {pCf(R) = clogf(Cf(Z));}
  180. #define c_sin(R, Z) {pCf(R) = csinf(Cf(Z));}
  181. //#define c_sqrt(R, Z) {*(R) = csqrtf(Cf(Z));}
  182. #define c_sqrt(R, Z) {pCf(R) = csqrtf(Cf(Z));}
  183. #define d_abs(x) (fabs(*(x)))
  184. #define d_acos(x) (acos(*(x)))
  185. #define d_asin(x) (asin(*(x)))
  186. #define d_atan(x) (atan(*(x)))
  187. #define d_atn2(x, y) (atan2(*(x),*(y)))
  188. #define d_cnjg(R, Z) { pCd(R) = conj(Cd(Z)); }
  189. #define r_cnjg(R, Z) { pCf(R) = conjf(Cf(Z)); }
  190. #define d_cos(x) (cos(*(x)))
  191. #define d_cosh(x) (cosh(*(x)))
  192. #define d_dim(__a, __b) ( *(__a) > *(__b) ? *(__a) - *(__b) : 0.0 )
  193. #define d_exp(x) (exp(*(x)))
  194. #define d_imag(z) (cimag(Cd(z)))
  195. #define r_imag(z) (cimagf(Cf(z)))
  196. #define d_int(__x) (*(__x)>0 ? floor(*(__x)) : -floor(- *(__x)))
  197. #define r_int(__x) (*(__x)>0 ? floor(*(__x)) : -floor(- *(__x)))
  198. #define d_lg10(x) ( 0.43429448190325182765 * log(*(x)) )
  199. #define r_lg10(x) ( 0.43429448190325182765 * log(*(x)) )
  200. #define d_log(x) (log(*(x)))
  201. #define d_mod(x, y) (fmod(*(x), *(y)))
  202. #define u_nint(__x) ((__x)>=0 ? floor((__x) + .5) : -floor(.5 - (__x)))
  203. #define d_nint(x) u_nint(*(x))
  204. #define u_sign(__a,__b) ((__b) >= 0 ? ((__a) >= 0 ? (__a) : -(__a)) : -((__a) >= 0 ? (__a) : -(__a)))
  205. #define d_sign(a,b) u_sign(*(a),*(b))
  206. #define r_sign(a,b) u_sign(*(a),*(b))
  207. #define d_sin(x) (sin(*(x)))
  208. #define d_sinh(x) (sinh(*(x)))
  209. #define d_sqrt(x) (sqrt(*(x)))
  210. #define d_tan(x) (tan(*(x)))
  211. #define d_tanh(x) (tanh(*(x)))
  212. #define i_abs(x) abs(*(x))
  213. #define i_dnnt(x) ((integer)u_nint(*(x)))
  214. #define i_len(s, n) (n)
  215. #define i_nint(x) ((integer)u_nint(*(x)))
  216. #define i_sign(a,b) ((integer)u_sign((integer)*(a),(integer)*(b)))
  217. #define pow_dd(ap, bp) ( pow(*(ap), *(bp)))
  218. #define pow_si(B,E) spow_ui(*(B),*(E))
  219. #define pow_ri(B,E) spow_ui(*(B),*(E))
  220. #define pow_di(B,E) dpow_ui(*(B),*(E))
  221. #define pow_zi(p, a, b) {pCd(p) = zpow_ui(Cd(a), *(b));}
  222. #define pow_ci(p, a, b) {pCf(p) = cpow_ui(Cf(a), *(b));}
  223. #define pow_zz(R,A,B) {pCd(R) = cpow(Cd(A),*(B));}
  224. #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++ = ' '; }
  225. #define s_cmp(a,b,c,d) ((integer)strncmp((a),(b),f2cmin((c),(d))))
  226. #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]; }
  227. #define sig_die(s, kill) { exit(1); }
  228. #define s_stop(s, n) {exit(0);}
  229. static char junk[] = "\n@(#)LIBF77 VERSION 19990503\n";
  230. #define z_abs(z) (cabs(Cd(z)))
  231. #define z_exp(R, Z) {pCd(R) = cexp(Cd(Z));}
  232. #define z_sqrt(R, Z) {pCd(R) = csqrt(Cd(Z));}
  233. #define myexit_() break;
  234. #define mycycle_() continue;
  235. #define myceiling_(w) {ceil(w)}
  236. #define myhuge_(w) {HUGE_VAL}
  237. //#define mymaxloc_(w,s,e,n) {if (sizeof(*(w)) == sizeof(double)) dmaxloc_((w),*(s),*(e),n); else dmaxloc_((w),*(s),*(e),n);}
  238. #define mymaxloc_(w,s,e,n) {dmaxloc_(w,*(s),*(e),n)}
  239. /* procedure parameter types for -A and -C++ */
  240. #define F2C_proc_par_types 1
  241. #ifdef __cplusplus
  242. typedef logical (*L_fp)(...);
  243. #else
  244. typedef logical (*L_fp)();
  245. #endif
  246. static float spow_ui(float x, integer n) {
  247. float pow=1.0; unsigned long int u;
  248. if(n != 0) {
  249. if(n < 0) n = -n, x = 1/x;
  250. for(u = n; ; ) {
  251. if(u & 01) pow *= x;
  252. if(u >>= 1) x *= x;
  253. else break;
  254. }
  255. }
  256. return pow;
  257. }
  258. static double dpow_ui(double x, integer n) {
  259. double pow=1.0; unsigned long int u;
  260. if(n != 0) {
  261. if(n < 0) n = -n, x = 1/x;
  262. for(u = n; ; ) {
  263. if(u & 01) pow *= x;
  264. if(u >>= 1) x *= x;
  265. else break;
  266. }
  267. }
  268. return pow;
  269. }
  270. #ifdef _MSC_VER
  271. static _Fcomplex cpow_ui(complex x, integer n) {
  272. complex pow={1.0,0.0}; unsigned long int u;
  273. if(n != 0) {
  274. if(n < 0) n = -n, x.r = 1/x.r, x.i=1/x.i;
  275. for(u = n; ; ) {
  276. if(u & 01) pow.r *= x.r, pow.i *= x.i;
  277. if(u >>= 1) x.r *= x.r, x.i *= x.i;
  278. else break;
  279. }
  280. }
  281. _Fcomplex p={pow.r, pow.i};
  282. return p;
  283. }
  284. #else
  285. static _Complex float cpow_ui(_Complex float x, integer n) {
  286. _Complex float pow=1.0; unsigned long int u;
  287. if(n != 0) {
  288. if(n < 0) n = -n, x = 1/x;
  289. for(u = n; ; ) {
  290. if(u & 01) pow *= x;
  291. if(u >>= 1) x *= x;
  292. else break;
  293. }
  294. }
  295. return pow;
  296. }
  297. #endif
  298. #ifdef _MSC_VER
  299. static _Dcomplex zpow_ui(_Dcomplex x, integer n) {
  300. _Dcomplex pow={1.0,0.0}; unsigned long int u;
  301. if(n != 0) {
  302. if(n < 0) n = -n, x._Val[0] = 1/x._Val[0], x._Val[1] =1/x._Val[1];
  303. for(u = n; ; ) {
  304. if(u & 01) pow._Val[0] *= x._Val[0], pow._Val[1] *= x._Val[1];
  305. if(u >>= 1) x._Val[0] *= x._Val[0], x._Val[1] *= x._Val[1];
  306. else break;
  307. }
  308. }
  309. _Dcomplex p = {pow._Val[0], pow._Val[1]};
  310. return p;
  311. }
  312. #else
  313. static _Complex double zpow_ui(_Complex double x, integer n) {
  314. _Complex double pow=1.0; unsigned long int u;
  315. if(n != 0) {
  316. if(n < 0) n = -n, x = 1/x;
  317. for(u = n; ; ) {
  318. if(u & 01) pow *= x;
  319. if(u >>= 1) x *= x;
  320. else break;
  321. }
  322. }
  323. return pow;
  324. }
  325. #endif
  326. static integer pow_ii(integer x, integer n) {
  327. integer pow; unsigned long int u;
  328. if (n <= 0) {
  329. if (n == 0 || x == 1) pow = 1;
  330. else if (x != -1) pow = x == 0 ? 1/x : 0;
  331. else n = -n;
  332. }
  333. if ((n > 0) || !(n == 0 || x == 1 || x != -1)) {
  334. u = n;
  335. for(pow = 1; ; ) {
  336. if(u & 01) pow *= x;
  337. if(u >>= 1) x *= x;
  338. else break;
  339. }
  340. }
  341. return pow;
  342. }
  343. static integer dmaxloc_(double *w, integer s, integer e, integer *n)
  344. {
  345. double m; integer i, mi;
  346. for(m=w[s-1], mi=s, i=s+1; i<=e; i++)
  347. if (w[i-1]>m) mi=i ,m=w[i-1];
  348. return mi-s+1;
  349. }
  350. static integer smaxloc_(float *w, integer s, integer e, integer *n)
  351. {
  352. float m; integer i, mi;
  353. for(m=w[s-1], mi=s, i=s+1; i<=e; i++)
  354. if (w[i-1]>m) mi=i ,m=w[i-1];
  355. return mi-s+1;
  356. }
  357. static inline void cdotc_(complex *z, integer *n_, complex *x, integer *incx_, complex *y, integer *incy_) {
  358. integer n = *n_, incx = *incx_, incy = *incy_, i;
  359. #ifdef _MSC_VER
  360. _Fcomplex zdotc = {0.0, 0.0};
  361. if (incx == 1 && incy == 1) {
  362. for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
  363. zdotc._Val[0] += conjf(Cf(&x[i]))._Val[0] * Cf(&y[i])._Val[0];
  364. zdotc._Val[1] += conjf(Cf(&x[i]))._Val[1] * Cf(&y[i])._Val[1];
  365. }
  366. } else {
  367. for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
  368. zdotc._Val[0] += conjf(Cf(&x[i*incx]))._Val[0] * Cf(&y[i*incy])._Val[0];
  369. zdotc._Val[1] += conjf(Cf(&x[i*incx]))._Val[1] * Cf(&y[i*incy])._Val[1];
  370. }
  371. }
  372. pCf(z) = zdotc;
  373. }
  374. #else
  375. _Complex float zdotc = 0.0;
  376. if (incx == 1 && incy == 1) {
  377. for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
  378. zdotc += conjf(Cf(&x[i])) * Cf(&y[i]);
  379. }
  380. } else {
  381. for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
  382. zdotc += conjf(Cf(&x[i*incx])) * Cf(&y[i*incy]);
  383. }
  384. }
  385. pCf(z) = zdotc;
  386. }
  387. #endif
  388. static inline void zdotc_(doublecomplex *z, integer *n_, doublecomplex *x, integer *incx_, doublecomplex *y, integer *incy_) {
  389. integer n = *n_, incx = *incx_, incy = *incy_, i;
  390. #ifdef _MSC_VER
  391. _Dcomplex zdotc = {0.0, 0.0};
  392. if (incx == 1 && incy == 1) {
  393. for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
  394. zdotc._Val[0] += conj(Cd(&x[i]))._Val[0] * Cd(&y[i])._Val[0];
  395. zdotc._Val[1] += conj(Cd(&x[i]))._Val[1] * Cd(&y[i])._Val[1];
  396. }
  397. } else {
  398. for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
  399. zdotc._Val[0] += conj(Cd(&x[i*incx]))._Val[0] * Cd(&y[i*incy])._Val[0];
  400. zdotc._Val[1] += conj(Cd(&x[i*incx]))._Val[1] * Cd(&y[i*incy])._Val[1];
  401. }
  402. }
  403. pCd(z) = zdotc;
  404. }
  405. #else
  406. _Complex double zdotc = 0.0;
  407. if (incx == 1 && incy == 1) {
  408. for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
  409. zdotc += conj(Cd(&x[i])) * Cd(&y[i]);
  410. }
  411. } else {
  412. for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
  413. zdotc += conj(Cd(&x[i*incx])) * Cd(&y[i*incy]);
  414. }
  415. }
  416. pCd(z) = zdotc;
  417. }
  418. #endif
  419. static inline void cdotu_(complex *z, integer *n_, complex *x, integer *incx_, complex *y, integer *incy_) {
  420. integer n = *n_, incx = *incx_, incy = *incy_, i;
  421. #ifdef _MSC_VER
  422. _Fcomplex zdotc = {0.0, 0.0};
  423. if (incx == 1 && incy == 1) {
  424. for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
  425. zdotc._Val[0] += Cf(&x[i])._Val[0] * Cf(&y[i])._Val[0];
  426. zdotc._Val[1] += Cf(&x[i])._Val[1] * Cf(&y[i])._Val[1];
  427. }
  428. } else {
  429. for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
  430. zdotc._Val[0] += Cf(&x[i*incx])._Val[0] * Cf(&y[i*incy])._Val[0];
  431. zdotc._Val[1] += Cf(&x[i*incx])._Val[1] * Cf(&y[i*incy])._Val[1];
  432. }
  433. }
  434. pCf(z) = zdotc;
  435. }
  436. #else
  437. _Complex float zdotc = 0.0;
  438. if (incx == 1 && incy == 1) {
  439. for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
  440. zdotc += Cf(&x[i]) * Cf(&y[i]);
  441. }
  442. } else {
  443. for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
  444. zdotc += Cf(&x[i*incx]) * Cf(&y[i*incy]);
  445. }
  446. }
  447. pCf(z) = zdotc;
  448. }
  449. #endif
  450. static inline void zdotu_(doublecomplex *z, integer *n_, doublecomplex *x, integer *incx_, doublecomplex *y, integer *incy_) {
  451. integer n = *n_, incx = *incx_, incy = *incy_, i;
  452. #ifdef _MSC_VER
  453. _Dcomplex zdotc = {0.0, 0.0};
  454. if (incx == 1 && incy == 1) {
  455. for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
  456. zdotc._Val[0] += Cd(&x[i])._Val[0] * Cd(&y[i])._Val[0];
  457. zdotc._Val[1] += Cd(&x[i])._Val[1] * Cd(&y[i])._Val[1];
  458. }
  459. } else {
  460. for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
  461. zdotc._Val[0] += Cd(&x[i*incx])._Val[0] * Cd(&y[i*incy])._Val[0];
  462. zdotc._Val[1] += Cd(&x[i*incx])._Val[1] * Cd(&y[i*incy])._Val[1];
  463. }
  464. }
  465. pCd(z) = zdotc;
  466. }
  467. #else
  468. _Complex double zdotc = 0.0;
  469. if (incx == 1 && incy == 1) {
  470. for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
  471. zdotc += Cd(&x[i]) * Cd(&y[i]);
  472. }
  473. } else {
  474. for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
  475. zdotc += Cd(&x[i*incx]) * Cd(&y[i*incy]);
  476. }
  477. }
  478. pCd(z) = zdotc;
  479. }
  480. #endif
  481. /* -- translated by f2c (version 20000121).
  482. You must link the resulting object file with the libraries:
  483. -lf2c -lm (in that order)
  484. */
  485. /* Table of constant values */
  486. static real c_b7 = 0.f;
  487. static real c_b8 = 1.f;
  488. static integer c__2 = 2;
  489. static integer c__1 = 1;
  490. static integer c__3 = 3;
  491. /* > \brief \b SLAQR5 performs a single small-bulge multi-shift QR sweep. */
  492. /* =========== DOCUMENTATION =========== */
  493. /* Online html documentation available at */
  494. /* http://www.netlib.org/lapack/explore-html/ */
  495. /* > \htmlonly */
  496. /* > Download SLAQR5 + dependencies */
  497. /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/slaqr5.
  498. f"> */
  499. /* > [TGZ]</a> */
  500. /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/slaqr5.
  501. f"> */
  502. /* > [ZIP]</a> */
  503. /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/slaqr5.
  504. f"> */
  505. /* > [TXT]</a> */
  506. /* > \endhtmlonly */
  507. /* Definition: */
  508. /* =========== */
  509. /* SUBROUTINE SLAQR5( WANTT, WANTZ, KACC22, N, KTOP, KBOT, NSHFTS, */
  510. /* SR, SI, H, LDH, ILOZ, IHIZ, Z, LDZ, V, LDV, U, */
  511. /* LDU, NV, WV, LDWV, NH, WH, LDWH ) */
  512. /* INTEGER IHIZ, ILOZ, KACC22, KBOT, KTOP, LDH, LDU, LDV, */
  513. /* $ LDWH, LDWV, LDZ, N, NH, NSHFTS, NV */
  514. /* LOGICAL WANTT, WANTZ */
  515. /* REAL H( LDH, * ), SI( * ), SR( * ), U( LDU, * ), */
  516. /* $ V( LDV, * ), WH( LDWH, * ), WV( LDWV, * ), */
  517. /* $ Z( LDZ, * ) */
  518. /* > \par Purpose: */
  519. /* ============= */
  520. /* > */
  521. /* > \verbatim */
  522. /* > */
  523. /* > SLAQR5, called by SLAQR0, performs a */
  524. /* > single small-bulge multi-shift QR sweep. */
  525. /* > \endverbatim */
  526. /* Arguments: */
  527. /* ========== */
  528. /* > \param[in] WANTT */
  529. /* > \verbatim */
  530. /* > WANTT is LOGICAL */
  531. /* > WANTT = .true. if the quasi-triangular Schur factor */
  532. /* > is being computed. WANTT is set to .false. otherwise. */
  533. /* > \endverbatim */
  534. /* > */
  535. /* > \param[in] WANTZ */
  536. /* > \verbatim */
  537. /* > WANTZ is LOGICAL */
  538. /* > WANTZ = .true. if the orthogonal Schur factor is being */
  539. /* > computed. WANTZ is set to .false. otherwise. */
  540. /* > \endverbatim */
  541. /* > */
  542. /* > \param[in] KACC22 */
  543. /* > \verbatim */
  544. /* > KACC22 is INTEGER with value 0, 1, or 2. */
  545. /* > Specifies the computation mode of far-from-diagonal */
  546. /* > orthogonal updates. */
  547. /* > = 0: SLAQR5 does not accumulate reflections and does not */
  548. /* > use matrix-matrix multiply to update far-from-diagonal */
  549. /* > matrix entries. */
  550. /* > = 1: SLAQR5 accumulates reflections and uses matrix-matrix */
  551. /* > multiply to update the far-from-diagonal matrix entries. */
  552. /* > = 2: Same as KACC22 = 1. This option used to enable exploiting */
  553. /* > the 2-by-2 structure during matrix multiplications, but */
  554. /* > this is no longer supported. */
  555. /* > \endverbatim */
  556. /* > */
  557. /* > \param[in] N */
  558. /* > \verbatim */
  559. /* > N is INTEGER */
  560. /* > N is the order of the Hessenberg matrix H upon which this */
  561. /* > subroutine operates. */
  562. /* > \endverbatim */
  563. /* > */
  564. /* > \param[in] KTOP */
  565. /* > \verbatim */
  566. /* > KTOP is INTEGER */
  567. /* > \endverbatim */
  568. /* > */
  569. /* > \param[in] KBOT */
  570. /* > \verbatim */
  571. /* > KBOT is INTEGER */
  572. /* > These are the first and last rows and columns of an */
  573. /* > isolated diagonal block upon which the QR sweep is to be */
  574. /* > applied. It is assumed without a check that */
  575. /* > either KTOP = 1 or H(KTOP,KTOP-1) = 0 */
  576. /* > and */
  577. /* > either KBOT = N or H(KBOT+1,KBOT) = 0. */
  578. /* > \endverbatim */
  579. /* > */
  580. /* > \param[in] NSHFTS */
  581. /* > \verbatim */
  582. /* > NSHFTS is INTEGER */
  583. /* > NSHFTS gives the number of simultaneous shifts. NSHFTS */
  584. /* > must be positive and even. */
  585. /* > \endverbatim */
  586. /* > */
  587. /* > \param[in,out] SR */
  588. /* > \verbatim */
  589. /* > SR is REAL array, dimension (NSHFTS) */
  590. /* > \endverbatim */
  591. /* > */
  592. /* > \param[in,out] SI */
  593. /* > \verbatim */
  594. /* > SI is REAL array, dimension (NSHFTS) */
  595. /* > SR contains the real parts and SI contains the imaginary */
  596. /* > parts of the NSHFTS shifts of origin that define the */
  597. /* > multi-shift QR sweep. On output SR and SI may be */
  598. /* > reordered. */
  599. /* > \endverbatim */
  600. /* > */
  601. /* > \param[in,out] H */
  602. /* > \verbatim */
  603. /* > H is REAL array, dimension (LDH,N) */
  604. /* > On input H contains a Hessenberg matrix. On output a */
  605. /* > multi-shift QR sweep with shifts SR(J)+i*SI(J) is applied */
  606. /* > to the isolated diagonal block in rows and columns KTOP */
  607. /* > through KBOT. */
  608. /* > \endverbatim */
  609. /* > */
  610. /* > \param[in] LDH */
  611. /* > \verbatim */
  612. /* > LDH is INTEGER */
  613. /* > LDH is the leading dimension of H just as declared in the */
  614. /* > calling procedure. LDH >= MAX(1,N). */
  615. /* > \endverbatim */
  616. /* > */
  617. /* > \param[in] ILOZ */
  618. /* > \verbatim */
  619. /* > ILOZ is INTEGER */
  620. /* > \endverbatim */
  621. /* > */
  622. /* > \param[in] IHIZ */
  623. /* > \verbatim */
  624. /* > IHIZ is INTEGER */
  625. /* > Specify the rows of Z to which transformations must be */
  626. /* > applied if WANTZ is .TRUE.. 1 <= ILOZ <= IHIZ <= N */
  627. /* > \endverbatim */
  628. /* > */
  629. /* > \param[in,out] Z */
  630. /* > \verbatim */
  631. /* > Z is REAL array, dimension (LDZ,IHIZ) */
  632. /* > If WANTZ = .TRUE., then the QR Sweep orthogonal */
  633. /* > similarity transformation is accumulated into */
  634. /* > Z(ILOZ:IHIZ,ILOZ:IHIZ) from the right. */
  635. /* > If WANTZ = .FALSE., then Z is unreferenced. */
  636. /* > \endverbatim */
  637. /* > */
  638. /* > \param[in] LDZ */
  639. /* > \verbatim */
  640. /* > LDZ is INTEGER */
  641. /* > LDA is the leading dimension of Z just as declared in */
  642. /* > the calling procedure. LDZ >= N. */
  643. /* > \endverbatim */
  644. /* > */
  645. /* > \param[out] V */
  646. /* > \verbatim */
  647. /* > V is REAL array, dimension (LDV,NSHFTS/2) */
  648. /* > \endverbatim */
  649. /* > */
  650. /* > \param[in] LDV */
  651. /* > \verbatim */
  652. /* > LDV is INTEGER */
  653. /* > LDV is the leading dimension of V as declared in the */
  654. /* > calling procedure. LDV >= 3. */
  655. /* > \endverbatim */
  656. /* > */
  657. /* > \param[out] U */
  658. /* > \verbatim */
  659. /* > U is REAL array, dimension (LDU,2*NSHFTS) */
  660. /* > \endverbatim */
  661. /* > */
  662. /* > \param[in] LDU */
  663. /* > \verbatim */
  664. /* > LDU is INTEGER */
  665. /* > LDU is the leading dimension of U just as declared in the */
  666. /* > in the calling subroutine. LDU >= 2*NSHFTS. */
  667. /* > \endverbatim */
  668. /* > */
  669. /* > \param[in] NV */
  670. /* > \verbatim */
  671. /* > NV is INTEGER */
  672. /* > NV is the number of rows in WV agailable for workspace. */
  673. /* > NV >= 1. */
  674. /* > \endverbatim */
  675. /* > */
  676. /* > \param[out] WV */
  677. /* > \verbatim */
  678. /* > WV is REAL array, dimension (LDWV,2*NSHFTS) */
  679. /* > \endverbatim */
  680. /* > */
  681. /* > \param[in] LDWV */
  682. /* > \verbatim */
  683. /* > LDWV is INTEGER */
  684. /* > LDWV is the leading dimension of WV as declared in the */
  685. /* > in the calling subroutine. LDWV >= NV. */
  686. /* > \endverbatim */
  687. /* > \param[in] NH */
  688. /* > \verbatim */
  689. /* > NH is INTEGER */
  690. /* > NH is the number of columns in array WH available for */
  691. /* > workspace. NH >= 1. */
  692. /* > \endverbatim */
  693. /* > */
  694. /* > \param[out] WH */
  695. /* > \verbatim */
  696. /* > WH is REAL array, dimension (LDWH,NH) */
  697. /* > \endverbatim */
  698. /* > */
  699. /* > \param[in] LDWH */
  700. /* > \verbatim */
  701. /* > LDWH is INTEGER */
  702. /* > Leading dimension of WH just as declared in the */
  703. /* > calling procedure. LDWH >= 2*NSHFTS. */
  704. /* > \endverbatim */
  705. /* > */
  706. /* Authors: */
  707. /* ======== */
  708. /* > \author Univ. of Tennessee */
  709. /* > \author Univ. of California Berkeley */
  710. /* > \author Univ. of Colorado Denver */
  711. /* > \author NAG Ltd. */
  712. /* > \date January 2021 */
  713. /* > \ingroup realOTHERauxiliary */
  714. /* > \par Contributors: */
  715. /* ================== */
  716. /* > */
  717. /* > Karen Braman and Ralph Byers, Department of Mathematics, */
  718. /* > University of Kansas, USA */
  719. /* > */
  720. /* > Lars Karlsson, Daniel Kressner, and Bruno Lang */
  721. /* > */
  722. /* > Thijs Steel, Department of Computer science, */
  723. /* > KU Leuven, Belgium */
  724. /* > \par References: */
  725. /* ================ */
  726. /* > */
  727. /* > K. Braman, R. Byers and R. Mathias, The Multi-Shift QR */
  728. /* > Algorithm Part I: Maintaining Well Focused Shifts, and Level 3 */
  729. /* > Performance, SIAM Journal of Matrix Analysis, volume 23, pages */
  730. /* > 929--947, 2002. */
  731. /* > */
  732. /* > Lars Karlsson, Daniel Kressner, and Bruno Lang, Optimally packed */
  733. /* > chains of bulges in multishift QR algorithms. */
  734. /* > ACM Trans. Math. Softw. 40, 2, Article 12 (February 2014). */
  735. /* > */
  736. /* ===================================================================== */
  737. /* Subroutine */ int slaqr5_(logical *wantt, logical *wantz, integer *kacc22,
  738. integer *n, integer *ktop, integer *kbot, integer *nshfts, real *sr,
  739. real *si, real *h__, integer *ldh, integer *iloz, integer *ihiz, real
  740. *z__, integer *ldz, real *v, integer *ldv, real *u, integer *ldu,
  741. integer *nv, real *wv, integer *ldwv, integer *nh, real *wh, integer *
  742. ldwh)
  743. {
  744. /* System generated locals */
  745. integer h_dim1, h_offset, u_dim1, u_offset, v_dim1, v_offset, wh_dim1,
  746. wh_offset, wv_dim1, wv_offset, z_dim1, z_offset, i__1, i__2, i__3,
  747. i__4, i__5, i__6, i__7;
  748. real r__1, r__2, r__3, r__4, r__5;
  749. /* Local variables */
  750. real beta;
  751. logical bmp22;
  752. integer jcol, jlen, jbot, mbot;
  753. real swap;
  754. integer jtop, jrow, mtop, i__, j, k, m;
  755. real alpha;
  756. logical accum;
  757. integer ndcol, incol;
  758. extern /* Subroutine */ int sgemm_(char *, char *, integer *, integer *,
  759. integer *, real *, real *, integer *, real *, integer *, real *,
  760. real *, integer *);
  761. integer krcol, nbmps, i2, k1, i4;
  762. extern /* Subroutine */ int slaqr1_(integer *, real *, integer *, real *,
  763. real *, real *, real *, real *);
  764. real h11, h12, h21, h22;
  765. integer m22;
  766. extern /* Subroutine */ int slabad_(real *, real *);
  767. integer ns, nu;
  768. extern real slamch_(char *);
  769. real vt[3], safmin, safmax;
  770. extern /* Subroutine */ int slarfg_(integer *, real *, real *, integer *,
  771. real *), slacpy_(char *, integer *, integer *, real *, integer *,
  772. real *, integer *), slaset_(char *, integer *, integer *,
  773. real *, real *, real *, integer *);
  774. real refsum, smlnum, scl;
  775. integer kdu, kms;
  776. real ulp, tst1, tst2;
  777. /* -- LAPACK auxiliary routine (version 3.7.1) -- */
  778. /* -- LAPACK is a software package provided by Univ. of Tennessee, -- */
  779. /* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- */
  780. /* June 2016 */
  781. /* ================================================================ */
  782. /* ==== If there are no shifts, then there is nothing to do. ==== */
  783. /* Parameter adjustments */
  784. --sr;
  785. --si;
  786. h_dim1 = *ldh;
  787. h_offset = 1 + h_dim1 * 1;
  788. h__ -= h_offset;
  789. z_dim1 = *ldz;
  790. z_offset = 1 + z_dim1 * 1;
  791. z__ -= z_offset;
  792. v_dim1 = *ldv;
  793. v_offset = 1 + v_dim1 * 1;
  794. v -= v_offset;
  795. u_dim1 = *ldu;
  796. u_offset = 1 + u_dim1 * 1;
  797. u -= u_offset;
  798. wv_dim1 = *ldwv;
  799. wv_offset = 1 + wv_dim1 * 1;
  800. wv -= wv_offset;
  801. wh_dim1 = *ldwh;
  802. wh_offset = 1 + wh_dim1 * 1;
  803. wh -= wh_offset;
  804. /* Function Body */
  805. if (*nshfts < 2) {
  806. return 0;
  807. }
  808. /* ==== If the active block is empty or 1-by-1, then there */
  809. /* . is nothing to do. ==== */
  810. if (*ktop >= *kbot) {
  811. return 0;
  812. }
  813. /* ==== Shuffle shifts into pairs of real shifts and pairs */
  814. /* . of complex conjugate shifts assuming complex */
  815. /* . conjugate shifts are already adjacent to one */
  816. /* . another. ==== */
  817. i__1 = *nshfts - 2;
  818. for (i__ = 1; i__ <= i__1; i__ += 2) {
  819. if (si[i__] != -si[i__ + 1]) {
  820. swap = sr[i__];
  821. sr[i__] = sr[i__ + 1];
  822. sr[i__ + 1] = sr[i__ + 2];
  823. sr[i__ + 2] = swap;
  824. swap = si[i__];
  825. si[i__] = si[i__ + 1];
  826. si[i__ + 1] = si[i__ + 2];
  827. si[i__ + 2] = swap;
  828. }
  829. /* L10: */
  830. }
  831. /* ==== NSHFTS is supposed to be even, but if it is odd, */
  832. /* . then simply reduce it by one. The shuffle above */
  833. /* . ensures that the dropped shift is real and that */
  834. /* . the remaining shifts are paired. ==== */
  835. ns = *nshfts - *nshfts % 2;
  836. /* ==== Machine constants for deflation ==== */
  837. safmin = slamch_("SAFE MINIMUM");
  838. safmax = 1.f / safmin;
  839. slabad_(&safmin, &safmax);
  840. ulp = slamch_("PRECISION");
  841. smlnum = safmin * ((real) (*n) / ulp);
  842. /* ==== Use accumulated reflections to update far-from-diagonal */
  843. /* . entries ? ==== */
  844. accum = *kacc22 == 1 || *kacc22 == 2;
  845. /* ==== clear trash ==== */
  846. if (*ktop + 2 <= *kbot) {
  847. h__[*ktop + 2 + *ktop * h_dim1] = 0.f;
  848. }
  849. /* ==== NBMPS = number of 2-shift bulges in the chain ==== */
  850. nbmps = ns / 2;
  851. /* ==== KDU = width of slab ==== */
  852. kdu = nbmps << 2;
  853. /* ==== Create and chase chains of NBMPS bulges ==== */
  854. i__1 = *kbot - 2;
  855. i__2 = nbmps << 1;
  856. for (incol = *ktop - (nbmps << 1) + 1; i__2 < 0 ? incol >= i__1 : incol <=
  857. i__1; incol += i__2) {
  858. /* JTOP = Index from which updates from the right start. */
  859. if (accum) {
  860. jtop = f2cmax(*ktop,incol);
  861. } else if (*wantt) {
  862. jtop = 1;
  863. } else {
  864. jtop = *ktop;
  865. }
  866. ndcol = incol + kdu;
  867. if (accum) {
  868. slaset_("ALL", &kdu, &kdu, &c_b7, &c_b8, &u[u_offset], ldu);
  869. }
  870. /* ==== Near-the-diagonal bulge chase. The following loop */
  871. /* . performs the near-the-diagonal part of a small bulge */
  872. /* . multi-shift QR sweep. Each 4*NBMPS column diagonal */
  873. /* . chunk extends from column INCOL to column NDCOL */
  874. /* . (including both column INCOL and column NDCOL). The */
  875. /* . following loop chases a 2*NBMPS+1 column long chain of */
  876. /* . NBMPS bulges 2*NBMPS-1 columns to the right. (INCOL */
  877. /* . may be less than KTOP and and NDCOL may be greater than */
  878. /* . KBOT indicating phantom columns from which to chase */
  879. /* . bulges before they are actually introduced or to which */
  880. /* . to chase bulges beyond column KBOT.) ==== */
  881. /* Computing MIN */
  882. i__4 = incol + (nbmps << 1) - 1, i__5 = *kbot - 2;
  883. i__3 = f2cmin(i__4,i__5);
  884. for (krcol = incol; krcol <= i__3; ++krcol) {
  885. /* ==== Bulges number MTOP to MBOT are active double implicit */
  886. /* . shift bulges. There may or may not also be small */
  887. /* . 2-by-2 bulge, if there is room. The inactive bulges */
  888. /* . (if any) must wait until the active bulges have moved */
  889. /* . down the diagonal to make room. The phantom matrix */
  890. /* . paradigm described above helps keep track. ==== */
  891. /* Computing MAX */
  892. i__4 = 1, i__5 = (*ktop - krcol) / 2 + 1;
  893. mtop = f2cmax(i__4,i__5);
  894. /* Computing MIN */
  895. i__4 = nbmps, i__5 = (*kbot - krcol - 1) / 2;
  896. mbot = f2cmin(i__4,i__5);
  897. m22 = mbot + 1;
  898. bmp22 = mbot < nbmps && krcol + (m22 - 1 << 1) == *kbot - 2;
  899. /* ==== Generate reflections to chase the chain right */
  900. /* . one column. (The minimum value of K is KTOP-1.) ==== */
  901. if (bmp22) {
  902. /* ==== Special case: 2-by-2 reflection at bottom treated */
  903. /* . separately ==== */
  904. k = krcol + (m22 - 1 << 1);
  905. if (k == *ktop - 1) {
  906. slaqr1_(&c__2, &h__[k + 1 + (k + 1) * h_dim1], ldh, &sr[(
  907. m22 << 1) - 1], &si[(m22 << 1) - 1], &sr[m22 * 2],
  908. &si[m22 * 2], &v[m22 * v_dim1 + 1]);
  909. beta = v[m22 * v_dim1 + 1];
  910. slarfg_(&c__2, &beta, &v[m22 * v_dim1 + 2], &c__1, &v[m22
  911. * v_dim1 + 1]);
  912. } else {
  913. beta = h__[k + 1 + k * h_dim1];
  914. v[m22 * v_dim1 + 2] = h__[k + 2 + k * h_dim1];
  915. slarfg_(&c__2, &beta, &v[m22 * v_dim1 + 2], &c__1, &v[m22
  916. * v_dim1 + 1]);
  917. h__[k + 1 + k * h_dim1] = beta;
  918. h__[k + 2 + k * h_dim1] = 0.f;
  919. }
  920. /* ==== Perform update from right within */
  921. /* . computational window. ==== */
  922. /* Computing MIN */
  923. i__5 = *kbot, i__6 = k + 3;
  924. i__4 = f2cmin(i__5,i__6);
  925. for (j = jtop; j <= i__4; ++j) {
  926. refsum = v[m22 * v_dim1 + 1] * (h__[j + (k + 1) * h_dim1]
  927. + v[m22 * v_dim1 + 2] * h__[j + (k + 2) * h_dim1])
  928. ;
  929. h__[j + (k + 1) * h_dim1] -= refsum;
  930. h__[j + (k + 2) * h_dim1] -= refsum * v[m22 * v_dim1 + 2];
  931. /* L30: */
  932. }
  933. /* ==== Perform update from left within */
  934. /* . computational window. ==== */
  935. if (accum) {
  936. jbot = f2cmin(ndcol,*kbot);
  937. } else if (*wantt) {
  938. jbot = *n;
  939. } else {
  940. jbot = *kbot;
  941. }
  942. i__4 = jbot;
  943. for (j = k + 1; j <= i__4; ++j) {
  944. refsum = v[m22 * v_dim1 + 1] * (h__[k + 1 + j * h_dim1] +
  945. v[m22 * v_dim1 + 2] * h__[k + 2 + j * h_dim1]);
  946. h__[k + 1 + j * h_dim1] -= refsum;
  947. h__[k + 2 + j * h_dim1] -= refsum * v[m22 * v_dim1 + 2];
  948. /* L40: */
  949. }
  950. /* ==== The following convergence test requires that */
  951. /* . the tradition small-compared-to-nearby-diagonals */
  952. /* . criterion and the Ahues & Tisseur (LAWN 122, 1997) */
  953. /* . criteria both be satisfied. The latter improves */
  954. /* . accuracy in some examples. Falling back on an */
  955. /* . alternate convergence criterion when TST1 or TST2 */
  956. /* . is zero (as done here) is traditional but probably */
  957. /* . unnecessary. ==== */
  958. if (k >= *ktop) {
  959. if (h__[k + 1 + k * h_dim1] != 0.f) {
  960. tst1 = (r__1 = h__[k + k * h_dim1], abs(r__1)) + (
  961. r__2 = h__[k + 1 + (k + 1) * h_dim1], abs(
  962. r__2));
  963. if (tst1 == 0.f) {
  964. if (k >= *ktop + 1) {
  965. tst1 += (r__1 = h__[k + (k - 1) * h_dim1],
  966. abs(r__1));
  967. }
  968. if (k >= *ktop + 2) {
  969. tst1 += (r__1 = h__[k + (k - 2) * h_dim1],
  970. abs(r__1));
  971. }
  972. if (k >= *ktop + 3) {
  973. tst1 += (r__1 = h__[k + (k - 3) * h_dim1],
  974. abs(r__1));
  975. }
  976. if (k <= *kbot - 2) {
  977. tst1 += (r__1 = h__[k + 2 + (k + 1) * h_dim1],
  978. abs(r__1));
  979. }
  980. if (k <= *kbot - 3) {
  981. tst1 += (r__1 = h__[k + 3 + (k + 1) * h_dim1],
  982. abs(r__1));
  983. }
  984. if (k <= *kbot - 4) {
  985. tst1 += (r__1 = h__[k + 4 + (k + 1) * h_dim1],
  986. abs(r__1));
  987. }
  988. }
  989. /* Computing MAX */
  990. r__2 = smlnum, r__3 = ulp * tst1;
  991. if ((r__1 = h__[k + 1 + k * h_dim1], abs(r__1)) <=
  992. f2cmax(r__2,r__3)) {
  993. /* Computing MAX */
  994. r__3 = (r__1 = h__[k + 1 + k * h_dim1], abs(r__1))
  995. , r__4 = (r__2 = h__[k + (k + 1) * h_dim1]
  996. , abs(r__2));
  997. h12 = f2cmax(r__3,r__4);
  998. /* Computing MIN */
  999. r__3 = (r__1 = h__[k + 1 + k * h_dim1], abs(r__1))
  1000. , r__4 = (r__2 = h__[k + (k + 1) * h_dim1]
  1001. , abs(r__2));
  1002. h21 = f2cmin(r__3,r__4);
  1003. /* Computing MAX */
  1004. r__3 = (r__1 = h__[k + 1 + (k + 1) * h_dim1], abs(
  1005. r__1)), r__4 = (r__2 = h__[k + k * h_dim1]
  1006. - h__[k + 1 + (k + 1) * h_dim1], abs(
  1007. r__2));
  1008. h11 = f2cmax(r__3,r__4);
  1009. /* Computing MIN */
  1010. r__3 = (r__1 = h__[k + 1 + (k + 1) * h_dim1], abs(
  1011. r__1)), r__4 = (r__2 = h__[k + k * h_dim1]
  1012. - h__[k + 1 + (k + 1) * h_dim1], abs(
  1013. r__2));
  1014. h22 = f2cmin(r__3,r__4);
  1015. scl = h11 + h12;
  1016. tst2 = h22 * (h11 / scl);
  1017. /* Computing MAX */
  1018. r__1 = smlnum, r__2 = ulp * tst2;
  1019. if (tst2 == 0.f || h21 * (h12 / scl) <= f2cmax(r__1,
  1020. r__2)) {
  1021. h__[k + 1 + k * h_dim1] = 0.f;
  1022. }
  1023. }
  1024. }
  1025. }
  1026. /* ==== Accumulate orthogonal transformations. ==== */
  1027. if (accum) {
  1028. kms = k - incol;
  1029. /* Computing MAX */
  1030. i__4 = 1, i__5 = *ktop - incol;
  1031. i__6 = kdu;
  1032. for (j = f2cmax(i__4,i__5); j <= i__6; ++j) {
  1033. refsum = v[m22 * v_dim1 + 1] * (u[j + (kms + 1) *
  1034. u_dim1] + v[m22 * v_dim1 + 2] * u[j + (kms +
  1035. 2) * u_dim1]);
  1036. u[j + (kms + 1) * u_dim1] -= refsum;
  1037. u[j + (kms + 2) * u_dim1] -= refsum * v[m22 * v_dim1
  1038. + 2];
  1039. /* L50: */
  1040. }
  1041. } else if (*wantz) {
  1042. i__6 = *ihiz;
  1043. for (j = *iloz; j <= i__6; ++j) {
  1044. refsum = v[m22 * v_dim1 + 1] * (z__[j + (k + 1) *
  1045. z_dim1] + v[m22 * v_dim1 + 2] * z__[j + (k +
  1046. 2) * z_dim1]);
  1047. z__[j + (k + 1) * z_dim1] -= refsum;
  1048. z__[j + (k + 2) * z_dim1] -= refsum * v[m22 * v_dim1
  1049. + 2];
  1050. /* L60: */
  1051. }
  1052. }
  1053. }
  1054. /* ==== Normal case: Chain of 3-by-3 reflections ==== */
  1055. i__6 = mtop;
  1056. for (m = mbot; m >= i__6; --m) {
  1057. k = krcol + (m - 1 << 1);
  1058. if (k == *ktop - 1) {
  1059. slaqr1_(&c__3, &h__[*ktop + *ktop * h_dim1], ldh, &sr[(m
  1060. << 1) - 1], &si[(m << 1) - 1], &sr[m * 2], &si[m *
  1061. 2], &v[m * v_dim1 + 1]);
  1062. alpha = v[m * v_dim1 + 1];
  1063. slarfg_(&c__3, &alpha, &v[m * v_dim1 + 2], &c__1, &v[m *
  1064. v_dim1 + 1]);
  1065. } else {
  1066. /* ==== Perform delayed transformation of row below */
  1067. /* . Mth bulge. Exploit fact that first two elements */
  1068. /* . of row are actually zero. ==== */
  1069. refsum = v[m * v_dim1 + 1] * v[m * v_dim1 + 3] * h__[k +
  1070. 3 + (k + 2) * h_dim1];
  1071. h__[k + 3 + k * h_dim1] = -refsum;
  1072. h__[k + 3 + (k + 1) * h_dim1] = -refsum * v[m * v_dim1 +
  1073. 2];
  1074. h__[k + 3 + (k + 2) * h_dim1] -= refsum * v[m * v_dim1 +
  1075. 3];
  1076. /* ==== Calculate reflection to move */
  1077. /* . Mth bulge one step. ==== */
  1078. beta = h__[k + 1 + k * h_dim1];
  1079. v[m * v_dim1 + 2] = h__[k + 2 + k * h_dim1];
  1080. v[m * v_dim1 + 3] = h__[k + 3 + k * h_dim1];
  1081. slarfg_(&c__3, &beta, &v[m * v_dim1 + 2], &c__1, &v[m *
  1082. v_dim1 + 1]);
  1083. /* ==== A Bulge may collapse because of vigilant */
  1084. /* . deflation or destructive underflow. In the */
  1085. /* . underflow case, try the two-small-subdiagonals */
  1086. /* . trick to try to reinflate the bulge. ==== */
  1087. if (h__[k + 3 + k * h_dim1] != 0.f || h__[k + 3 + (k + 1)
  1088. * h_dim1] != 0.f || h__[k + 3 + (k + 2) * h_dim1]
  1089. == 0.f) {
  1090. /* ==== Typical case: not collapsed (yet). ==== */
  1091. h__[k + 1 + k * h_dim1] = beta;
  1092. h__[k + 2 + k * h_dim1] = 0.f;
  1093. h__[k + 3 + k * h_dim1] = 0.f;
  1094. } else {
  1095. /* ==== Atypical case: collapsed. Attempt to */
  1096. /* . reintroduce ignoring H(K+1,K) and H(K+2,K). */
  1097. /* . If the fill resulting from the new */
  1098. /* . reflector is too large, then abandon it. */
  1099. /* . Otherwise, use the new one. ==== */
  1100. slaqr1_(&c__3, &h__[k + 1 + (k + 1) * h_dim1], ldh, &
  1101. sr[(m << 1) - 1], &si[(m << 1) - 1], &sr[m *
  1102. 2], &si[m * 2], vt);
  1103. alpha = vt[0];
  1104. slarfg_(&c__3, &alpha, &vt[1], &c__1, vt);
  1105. refsum = vt[0] * (h__[k + 1 + k * h_dim1] + vt[1] *
  1106. h__[k + 2 + k * h_dim1]);
  1107. if ((r__1 = h__[k + 2 + k * h_dim1] - refsum * vt[1],
  1108. abs(r__1)) + (r__2 = refsum * vt[2], abs(r__2)
  1109. ) > ulp * ((r__3 = h__[k + k * h_dim1], abs(
  1110. r__3)) + (r__4 = h__[k + 1 + (k + 1) * h_dim1]
  1111. , abs(r__4)) + (r__5 = h__[k + 2 + (k + 2) *
  1112. h_dim1], abs(r__5)))) {
  1113. /* ==== Starting a new bulge here would */
  1114. /* . create non-negligible fill. Use */
  1115. /* . the old one with trepidation. ==== */
  1116. h__[k + 1 + k * h_dim1] = beta;
  1117. h__[k + 2 + k * h_dim1] = 0.f;
  1118. h__[k + 3 + k * h_dim1] = 0.f;
  1119. } else {
  1120. /* ==== Starting a new bulge here would */
  1121. /* . create only negligible fill. */
  1122. /* . Replace the old reflector with */
  1123. /* . the new one. ==== */
  1124. h__[k + 1 + k * h_dim1] -= refsum;
  1125. h__[k + 2 + k * h_dim1] = 0.f;
  1126. h__[k + 3 + k * h_dim1] = 0.f;
  1127. v[m * v_dim1 + 1] = vt[0];
  1128. v[m * v_dim1 + 2] = vt[1];
  1129. v[m * v_dim1 + 3] = vt[2];
  1130. }
  1131. }
  1132. }
  1133. /* ==== Apply reflection from the right and */
  1134. /* . the first column of update from the left. */
  1135. /* . These updates are required for the vigilant */
  1136. /* . deflation check. We still delay most of the */
  1137. /* . updates from the left for efficiency. ==== */
  1138. /* Computing MIN */
  1139. i__5 = *kbot, i__7 = k + 3;
  1140. i__4 = f2cmin(i__5,i__7);
  1141. for (j = jtop; j <= i__4; ++j) {
  1142. refsum = v[m * v_dim1 + 1] * (h__[j + (k + 1) * h_dim1] +
  1143. v[m * v_dim1 + 2] * h__[j + (k + 2) * h_dim1] + v[
  1144. m * v_dim1 + 3] * h__[j + (k + 3) * h_dim1]);
  1145. h__[j + (k + 1) * h_dim1] -= refsum;
  1146. h__[j + (k + 2) * h_dim1] -= refsum * v[m * v_dim1 + 2];
  1147. h__[j + (k + 3) * h_dim1] -= refsum * v[m * v_dim1 + 3];
  1148. /* L70: */
  1149. }
  1150. /* ==== Perform update from left for subsequent */
  1151. /* . column. ==== */
  1152. refsum = v[m * v_dim1 + 1] * (h__[k + 1 + (k + 1) * h_dim1] +
  1153. v[m * v_dim1 + 2] * h__[k + 2 + (k + 1) * h_dim1] + v[
  1154. m * v_dim1 + 3] * h__[k + 3 + (k + 1) * h_dim1]);
  1155. h__[k + 1 + (k + 1) * h_dim1] -= refsum;
  1156. h__[k + 2 + (k + 1) * h_dim1] -= refsum * v[m * v_dim1 + 2];
  1157. h__[k + 3 + (k + 1) * h_dim1] -= refsum * v[m * v_dim1 + 3];
  1158. /* ==== The following convergence test requires that */
  1159. /* . the tradition small-compared-to-nearby-diagonals */
  1160. /* . criterion and the Ahues & Tisseur (LAWN 122, 1997) */
  1161. /* . criteria both be satisfied. The latter improves */
  1162. /* . accuracy in some examples. Falling back on an */
  1163. /* . alternate convergence criterion when TST1 or TST2 */
  1164. /* . is zero (as done here) is traditional but probably */
  1165. /* . unnecessary. ==== */
  1166. if (k < *ktop) {
  1167. goto L880;
  1168. }
  1169. /* $ CALL MYCYCLE */
  1170. if (h__[k + 1 + k * h_dim1] != 0.f) {
  1171. tst1 = (r__1 = h__[k + k * h_dim1], abs(r__1)) + (r__2 =
  1172. h__[k + 1 + (k + 1) * h_dim1], abs(r__2));
  1173. if (tst1 == 0.f) {
  1174. if (k >= *ktop + 1) {
  1175. tst1 += (r__1 = h__[k + (k - 1) * h_dim1], abs(
  1176. r__1));
  1177. }
  1178. if (k >= *ktop + 2) {
  1179. tst1 += (r__1 = h__[k + (k - 2) * h_dim1], abs(
  1180. r__1));
  1181. }
  1182. if (k >= *ktop + 3) {
  1183. tst1 += (r__1 = h__[k + (k - 3) * h_dim1], abs(
  1184. r__1));
  1185. }
  1186. if (k <= *kbot - 2) {
  1187. tst1 += (r__1 = h__[k + 2 + (k + 1) * h_dim1],
  1188. abs(r__1));
  1189. }
  1190. if (k <= *kbot - 3) {
  1191. tst1 += (r__1 = h__[k + 3 + (k + 1) * h_dim1],
  1192. abs(r__1));
  1193. }
  1194. if (k <= *kbot - 4) {
  1195. tst1 += (r__1 = h__[k + 4 + (k + 1) * h_dim1],
  1196. abs(r__1));
  1197. }
  1198. }
  1199. /* Computing MAX */
  1200. r__2 = smlnum, r__3 = ulp * tst1;
  1201. if ((r__1 = h__[k + 1 + k * h_dim1], abs(r__1)) <= f2cmax(
  1202. r__2,r__3)) {
  1203. /* Computing MAX */
  1204. r__3 = (r__1 = h__[k + 1 + k * h_dim1], abs(r__1)),
  1205. r__4 = (r__2 = h__[k + (k + 1) * h_dim1], abs(
  1206. r__2));
  1207. h12 = f2cmax(r__3,r__4);
  1208. /* Computing MIN */
  1209. r__3 = (r__1 = h__[k + 1 + k * h_dim1], abs(r__1)),
  1210. r__4 = (r__2 = h__[k + (k + 1) * h_dim1], abs(
  1211. r__2));
  1212. h21 = f2cmin(r__3,r__4);
  1213. /* Computing MAX */
  1214. r__3 = (r__1 = h__[k + 1 + (k + 1) * h_dim1], abs(
  1215. r__1)), r__4 = (r__2 = h__[k + k * h_dim1] -
  1216. h__[k + 1 + (k + 1) * h_dim1], abs(r__2));
  1217. h11 = f2cmax(r__3,r__4);
  1218. /* Computing MIN */
  1219. r__3 = (r__1 = h__[k + 1 + (k + 1) * h_dim1], abs(
  1220. r__1)), r__4 = (r__2 = h__[k + k * h_dim1] -
  1221. h__[k + 1 + (k + 1) * h_dim1], abs(r__2));
  1222. h22 = f2cmin(r__3,r__4);
  1223. scl = h11 + h12;
  1224. tst2 = h22 * (h11 / scl);
  1225. /* Computing MAX */
  1226. r__1 = smlnum, r__2 = ulp * tst2;
  1227. if (tst2 == 0.f || h21 * (h12 / scl) <= f2cmax(r__1,r__2)
  1228. ) {
  1229. h__[k + 1 + k * h_dim1] = 0.f;
  1230. }
  1231. }
  1232. }
  1233. L880:
  1234. /* L80: */
  1235. ;
  1236. }
  1237. /* ==== Multiply H by reflections from the left ==== */
  1238. if (accum) {
  1239. jbot = f2cmin(ndcol,*kbot);
  1240. } else if (*wantt) {
  1241. jbot = *n;
  1242. } else {
  1243. jbot = *kbot;
  1244. }
  1245. i__6 = mtop;
  1246. for (m = mbot; m >= i__6; --m) {
  1247. k = krcol + (m - 1 << 1);
  1248. /* Computing MAX */
  1249. i__4 = *ktop, i__5 = krcol + (m << 1);
  1250. i__7 = jbot;
  1251. for (j = f2cmax(i__4,i__5); j <= i__7; ++j) {
  1252. refsum = v[m * v_dim1 + 1] * (h__[k + 1 + j * h_dim1] + v[
  1253. m * v_dim1 + 2] * h__[k + 2 + j * h_dim1] + v[m *
  1254. v_dim1 + 3] * h__[k + 3 + j * h_dim1]);
  1255. h__[k + 1 + j * h_dim1] -= refsum;
  1256. h__[k + 2 + j * h_dim1] -= refsum * v[m * v_dim1 + 2];
  1257. h__[k + 3 + j * h_dim1] -= refsum * v[m * v_dim1 + 3];
  1258. /* L90: */
  1259. }
  1260. /* L100: */
  1261. }
  1262. /* ==== Accumulate orthogonal transformations. ==== */
  1263. if (accum) {
  1264. /* ==== Accumulate U. (If needed, update Z later */
  1265. /* . with an efficient matrix-matrix */
  1266. /* . multiply.) ==== */
  1267. i__6 = mtop;
  1268. for (m = mbot; m >= i__6; --m) {
  1269. k = krcol + (m - 1 << 1);
  1270. kms = k - incol;
  1271. /* Computing MAX */
  1272. i__7 = 1, i__4 = *ktop - incol;
  1273. i2 = f2cmax(i__7,i__4);
  1274. /* Computing MAX */
  1275. i__7 = i2, i__4 = kms - (krcol - incol) + 1;
  1276. i2 = f2cmax(i__7,i__4);
  1277. /* Computing MIN */
  1278. i__7 = kdu, i__4 = krcol + (mbot - 1 << 1) - incol + 5;
  1279. i4 = f2cmin(i__7,i__4);
  1280. i__7 = i4;
  1281. for (j = i2; j <= i__7; ++j) {
  1282. refsum = v[m * v_dim1 + 1] * (u[j + (kms + 1) *
  1283. u_dim1] + v[m * v_dim1 + 2] * u[j + (kms + 2)
  1284. * u_dim1] + v[m * v_dim1 + 3] * u[j + (kms +
  1285. 3) * u_dim1]);
  1286. u[j + (kms + 1) * u_dim1] -= refsum;
  1287. u[j + (kms + 2) * u_dim1] -= refsum * v[m * v_dim1 +
  1288. 2];
  1289. u[j + (kms + 3) * u_dim1] -= refsum * v[m * v_dim1 +
  1290. 3];
  1291. /* L110: */
  1292. }
  1293. /* L120: */
  1294. }
  1295. } else if (*wantz) {
  1296. /* ==== U is not accumulated, so update Z */
  1297. /* . now by multiplying by reflections */
  1298. /* . from the right. ==== */
  1299. i__6 = mtop;
  1300. for (m = mbot; m >= i__6; --m) {
  1301. k = krcol + (m - 1 << 1);
  1302. i__7 = *ihiz;
  1303. for (j = *iloz; j <= i__7; ++j) {
  1304. refsum = v[m * v_dim1 + 1] * (z__[j + (k + 1) *
  1305. z_dim1] + v[m * v_dim1 + 2] * z__[j + (k + 2)
  1306. * z_dim1] + v[m * v_dim1 + 3] * z__[j + (k +
  1307. 3) * z_dim1]);
  1308. z__[j + (k + 1) * z_dim1] -= refsum;
  1309. z__[j + (k + 2) * z_dim1] -= refsum * v[m * v_dim1 +
  1310. 2];
  1311. z__[j + (k + 3) * z_dim1] -= refsum * v[m * v_dim1 +
  1312. 3];
  1313. /* L130: */
  1314. }
  1315. /* L140: */
  1316. }
  1317. }
  1318. /* ==== End of near-the-diagonal bulge chase. ==== */
  1319. /* L145: */
  1320. }
  1321. /* ==== Use U (if accumulated) to update far-from-diagonal */
  1322. /* . entries in H. If required, use U to update Z as */
  1323. /* . well. ==== */
  1324. if (accum) {
  1325. if (*wantt) {
  1326. jtop = 1;
  1327. jbot = *n;
  1328. } else {
  1329. jtop = *ktop;
  1330. jbot = *kbot;
  1331. }
  1332. /* Computing MAX */
  1333. i__3 = 1, i__6 = *ktop - incol;
  1334. k1 = f2cmax(i__3,i__6);
  1335. /* Computing MAX */
  1336. i__3 = 0, i__6 = ndcol - *kbot;
  1337. nu = kdu - f2cmax(i__3,i__6) - k1 + 1;
  1338. /* ==== Horizontal Multiply ==== */
  1339. i__3 = jbot;
  1340. i__6 = *nh;
  1341. for (jcol = f2cmin(ndcol,*kbot) + 1; i__6 < 0 ? jcol >= i__3 : jcol
  1342. <= i__3; jcol += i__6) {
  1343. /* Computing MIN */
  1344. i__7 = *nh, i__4 = jbot - jcol + 1;
  1345. jlen = f2cmin(i__7,i__4);
  1346. sgemm_("C", "N", &nu, &jlen, &nu, &c_b8, &u[k1 + k1 * u_dim1],
  1347. ldu, &h__[incol + k1 + jcol * h_dim1], ldh, &c_b7, &
  1348. wh[wh_offset], ldwh);
  1349. slacpy_("ALL", &nu, &jlen, &wh[wh_offset], ldwh, &h__[incol +
  1350. k1 + jcol * h_dim1], ldh);
  1351. /* L150: */
  1352. }
  1353. /* ==== Vertical multiply ==== */
  1354. i__6 = f2cmax(*ktop,incol) - 1;
  1355. i__3 = *nv;
  1356. for (jrow = jtop; i__3 < 0 ? jrow >= i__6 : jrow <= i__6; jrow +=
  1357. i__3) {
  1358. /* Computing MIN */
  1359. i__7 = *nv, i__4 = f2cmax(*ktop,incol) - jrow;
  1360. jlen = f2cmin(i__7,i__4);
  1361. sgemm_("N", "N", &jlen, &nu, &nu, &c_b8, &h__[jrow + (incol +
  1362. k1) * h_dim1], ldh, &u[k1 + k1 * u_dim1], ldu, &c_b7,
  1363. &wv[wv_offset], ldwv);
  1364. slacpy_("ALL", &jlen, &nu, &wv[wv_offset], ldwv, &h__[jrow + (
  1365. incol + k1) * h_dim1], ldh);
  1366. /* L160: */
  1367. }
  1368. /* ==== Z multiply (also vertical) ==== */
  1369. if (*wantz) {
  1370. i__3 = *ihiz;
  1371. i__6 = *nv;
  1372. for (jrow = *iloz; i__6 < 0 ? jrow >= i__3 : jrow <= i__3;
  1373. jrow += i__6) {
  1374. /* Computing MIN */
  1375. i__7 = *nv, i__4 = *ihiz - jrow + 1;
  1376. jlen = f2cmin(i__7,i__4);
  1377. sgemm_("N", "N", &jlen, &nu, &nu, &c_b8, &z__[jrow + (
  1378. incol + k1) * z_dim1], ldz, &u[k1 + k1 * u_dim1],
  1379. ldu, &c_b7, &wv[wv_offset], ldwv);
  1380. slacpy_("ALL", &jlen, &nu, &wv[wv_offset], ldwv, &z__[
  1381. jrow + (incol + k1) * z_dim1], ldz);
  1382. /* L170: */
  1383. }
  1384. }
  1385. }
  1386. /* L180: */
  1387. }
  1388. /* ==== End of SLAQR5 ==== */
  1389. return 0;
  1390. } /* slaqr5_ */