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