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.

dlaqr5.c 48 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532
  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 doublereal c_b7 = 0.;
  485. static doublereal c_b8 = 1.;
  486. static integer c__2 = 2;
  487. static integer c__1 = 1;
  488. static integer c__3 = 3;
  489. /* > \brief \b DLAQR5 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 DLAQR5 + dependencies */
  495. /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dlaqr5.
  496. f"> */
  497. /* > [TGZ]</a> */
  498. /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dlaqr5.
  499. f"> */
  500. /* > [ZIP]</a> */
  501. /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dlaqr5.
  502. f"> */
  503. /* > [TXT]</a> */
  504. /* > \endhtmlonly */
  505. /* Definition: */
  506. /* =========== */
  507. /* SUBROUTINE DLAQR5( 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. /* DOUBLE PRECISION 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. /* > DLAQR5, called by DLAQR0, 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: DLAQR5 does not accumulate reflections and does not */
  546. /* > use matrix-matrix multiply to update far-from-diagonal */
  547. /* > matrix entries. */
  548. /* > = 1: DLAQR5 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 DOUBLE PRECISION array, dimension (NSHFTS) */
  588. /* > \endverbatim */
  589. /* > */
  590. /* > \param[in,out] SI */
  591. /* > \verbatim */
  592. /* > SI is DOUBLE PRECISION 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 DOUBLE PRECISION 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 DOUBLE PRECISION 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 DOUBLE PRECISION 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 DOUBLE PRECISION 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 DOUBLE PRECISION 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 DOUBLE PRECISION 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 doubleOTHERauxiliary */
  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 dlaqr5_(logical *wantt, logical *wantz, integer *kacc22,
  736. integer *n, integer *ktop, integer *kbot, integer *nshfts, doublereal
  737. *sr, doublereal *si, doublereal *h__, integer *ldh, integer *iloz,
  738. integer *ihiz, doublereal *z__, integer *ldz, doublereal *v, integer *
  739. ldv, doublereal *u, integer *ldu, integer *nv, doublereal *wv,
  740. integer *ldwv, integer *nh, doublereal *wh, integer *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. doublereal d__1, d__2, d__3, d__4, d__5;
  747. /* Local variables */
  748. doublereal beta;
  749. logical bmp22;
  750. integer jcol, jlen, jbot, mbot;
  751. doublereal swap;
  752. integer jtop, jrow, mtop, i__, j, k, m;
  753. doublereal alpha;
  754. logical accum;
  755. extern /* Subroutine */ void dgemm_(char *, char *, integer *, integer *,
  756. integer *, doublereal *, doublereal *, integer *, doublereal *,
  757. integer *, doublereal *, doublereal *, integer *);
  758. integer ndcol, incol, krcol, nbmps, i2, k1, i4;
  759. extern /* Subroutine */ void dlaqr1_(integer *, doublereal *, integer *,
  760. doublereal *, doublereal *, doublereal *, doublereal *,
  761. doublereal *), dlabad_(doublereal *, doublereal *);
  762. doublereal h11, h12, h21, h22;
  763. integer m22;
  764. extern doublereal dlamch_(char *);
  765. extern /* Subroutine */ void dlarfg_(integer *, doublereal *, doublereal *,
  766. integer *, doublereal *);
  767. integer ns, nu;
  768. doublereal vt[3];
  769. extern /* Subroutine */ void dlacpy_(char *, integer *, integer *,
  770. doublereal *, integer *, doublereal *, integer *);
  771. doublereal safmin, safmax;
  772. extern /* Subroutine */ void dlaset_(char *, integer *, integer *,
  773. doublereal *, doublereal *, doublereal *, integer *);
  774. doublereal refsum, smlnum, scl;
  775. integer kdu, kms;
  776. doublereal ulp;
  777. doublereal tst1, tst2;
  778. /* -- LAPACK auxiliary routine (version 3.7.1) -- */
  779. /* -- LAPACK is a software package provided by Univ. of Tennessee, -- */
  780. /* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- */
  781. /* June 2016 */
  782. /* ================================================================ */
  783. /* ==== If there are no shifts, then there is nothing to do. ==== */
  784. /* Parameter adjustments */
  785. --sr;
  786. --si;
  787. h_dim1 = *ldh;
  788. h_offset = 1 + h_dim1 * 1;
  789. h__ -= h_offset;
  790. z_dim1 = *ldz;
  791. z_offset = 1 + z_dim1 * 1;
  792. z__ -= z_offset;
  793. v_dim1 = *ldv;
  794. v_offset = 1 + v_dim1 * 1;
  795. v -= v_offset;
  796. u_dim1 = *ldu;
  797. u_offset = 1 + u_dim1 * 1;
  798. u -= u_offset;
  799. wv_dim1 = *ldwv;
  800. wv_offset = 1 + wv_dim1 * 1;
  801. wv -= wv_offset;
  802. wh_dim1 = *ldwh;
  803. wh_offset = 1 + wh_dim1 * 1;
  804. wh -= wh_offset;
  805. /* Function Body */
  806. if (*nshfts < 2) {
  807. return;
  808. }
  809. /* ==== If the active block is empty or 1-by-1, then there */
  810. /* . is nothing to do. ==== */
  811. if (*ktop >= *kbot) {
  812. return;
  813. }
  814. /* ==== Shuffle shifts into pairs of real shifts and pairs */
  815. /* . of complex conjugate shifts assuming complex */
  816. /* . conjugate shifts are already adjacent to one */
  817. /* . another. ==== */
  818. i__1 = *nshfts - 2;
  819. for (i__ = 1; i__ <= i__1; i__ += 2) {
  820. if (si[i__] != -si[i__ + 1]) {
  821. swap = sr[i__];
  822. sr[i__] = sr[i__ + 1];
  823. sr[i__ + 1] = sr[i__ + 2];
  824. sr[i__ + 2] = swap;
  825. swap = si[i__];
  826. si[i__] = si[i__ + 1];
  827. si[i__ + 1] = si[i__ + 2];
  828. si[i__ + 2] = swap;
  829. }
  830. /* L10: */
  831. }
  832. /* ==== NSHFTS is supposed to be even, but if it is odd, */
  833. /* . then simply reduce it by one. The shuffle above */
  834. /* . ensures that the dropped shift is real and that */
  835. /* . the remaining shifts are paired. ==== */
  836. ns = *nshfts - *nshfts % 2;
  837. /* ==== Machine constants for deflation ==== */
  838. safmin = dlamch_("SAFE MINIMUM");
  839. safmax = 1. / safmin;
  840. dlabad_(&safmin, &safmax);
  841. ulp = dlamch_("PRECISION");
  842. smlnum = safmin * ((doublereal) (*n) / ulp);
  843. /* ==== Use accumulated reflections to update far-from-diagonal */
  844. /* . entries ? ==== */
  845. accum = *kacc22 == 1 || *kacc22 == 2;
  846. /* ==== clear trash ==== */
  847. if (*ktop + 2 <= *kbot) {
  848. h__[*ktop + 2 + *ktop * h_dim1] = 0.;
  849. }
  850. /* ==== NBMPS = number of 2-shift bulges in the chain ==== */
  851. nbmps = ns / 2;
  852. /* ==== KDU = width of slab ==== */
  853. kdu = nbmps << 2;
  854. /* ==== Create and chase chains of NBMPS bulges ==== */
  855. i__1 = *kbot - 2;
  856. i__2 = nbmps << 1;
  857. for (incol = *ktop - (nbmps << 1) + 1; i__2 < 0 ? incol >= i__1 : incol <=
  858. i__1; incol += i__2) {
  859. /* JTOP = Index from which updates from the right start. */
  860. if (accum) {
  861. jtop = f2cmax(*ktop,incol);
  862. } else if (*wantt) {
  863. jtop = 1;
  864. } else {
  865. jtop = *ktop;
  866. }
  867. ndcol = incol + kdu;
  868. if (accum) {
  869. dlaset_("ALL", &kdu, &kdu, &c_b7, &c_b8, &u[u_offset], ldu);
  870. }
  871. /* ==== Near-the-diagonal bulge chase. The following loop */
  872. /* . performs the near-the-diagonal part of a small bulge */
  873. /* . multi-shift QR sweep. Each 4*NBMPS column diagonal */
  874. /* . chunk extends from column INCOL to column NDCOL */
  875. /* . (including both column INCOL and column NDCOL). The */
  876. /* . following loop chases a 2*NBMPS+1 column long chain of */
  877. /* . NBMPS bulges 2*NBMPS columns to the right. (INCOL */
  878. /* . may be less than KTOP and and NDCOL may be greater than */
  879. /* . KBOT indicating phantom columns from which to chase */
  880. /* . bulges before they are actually introduced or to which */
  881. /* . to chase bulges beyond column KBOT.) ==== */
  882. /* Computing MIN */
  883. i__4 = incol + (nbmps << 1) - 1, i__5 = *kbot - 2;
  884. i__3 = f2cmin(i__4,i__5);
  885. for (krcol = incol; krcol <= i__3; ++krcol) {
  886. /* ==== Bulges number MTOP to MBOT are active double implicit */
  887. /* . shift bulges. There may or may not also be small */
  888. /* . 2-by-2 bulge, if there is room. The inactive bulges */
  889. /* . (if any) must wait until the active bulges have moved */
  890. /* . down the diagonal to make room. The phantom matrix */
  891. /* . paradigm described above helps keep track. ==== */
  892. /* Computing MAX */
  893. i__4 = 1, i__5 = (*ktop - krcol) / 2 + 1;
  894. mtop = f2cmax(i__4,i__5);
  895. /* Computing MIN */
  896. i__4 = nbmps, i__5 = (*kbot - krcol - 1) / 2;
  897. mbot = f2cmin(i__4,i__5);
  898. m22 = mbot + 1;
  899. bmp22 = mbot < nbmps && krcol + (m22 - 1 << 1) == *kbot - 2;
  900. /* ==== Generate reflections to chase the chain right */
  901. /* . one column. (The minimum value of K is KTOP-1.) ==== */
  902. if (bmp22) {
  903. /* ==== Special case: 2-by-2 reflection at bottom treated */
  904. /* . separately ==== */
  905. k = krcol + (m22 - 1 << 1);
  906. if (k == *ktop - 1) {
  907. dlaqr1_(&c__2, &h__[k + 1 + (k + 1) * h_dim1], ldh, &sr[(
  908. m22 << 1) - 1], &si[(m22 << 1) - 1], &sr[m22 * 2],
  909. &si[m22 * 2], &v[m22 * v_dim1 + 1]);
  910. beta = v[m22 * v_dim1 + 1];
  911. dlarfg_(&c__2, &beta, &v[m22 * v_dim1 + 2], &c__1, &v[m22
  912. * v_dim1 + 1]);
  913. } else {
  914. beta = h__[k + 1 + k * h_dim1];
  915. v[m22 * v_dim1 + 2] = h__[k + 2 + k * h_dim1];
  916. dlarfg_(&c__2, &beta, &v[m22 * v_dim1 + 2], &c__1, &v[m22
  917. * v_dim1 + 1]);
  918. h__[k + 1 + k * h_dim1] = beta;
  919. h__[k + 2 + k * h_dim1] = 0.;
  920. }
  921. /* ==== Perform update from right within */
  922. /* . computational window. ==== */
  923. /* Computing MIN */
  924. i__5 = *kbot, i__6 = k + 3;
  925. i__4 = f2cmin(i__5,i__6);
  926. for (j = jtop; j <= i__4; ++j) {
  927. refsum = v[m22 * v_dim1 + 1] * (h__[j + (k + 1) * h_dim1]
  928. + v[m22 * v_dim1 + 2] * h__[j + (k + 2) * h_dim1])
  929. ;
  930. h__[j + (k + 1) * h_dim1] -= refsum;
  931. h__[j + (k + 2) * h_dim1] -= refsum * v[m22 * v_dim1 + 2];
  932. /* L30: */
  933. }
  934. /* ==== Perform update from left within */
  935. /* . computational window. ==== */
  936. if (accum) {
  937. jbot = f2cmin(ndcol,*kbot);
  938. } else if (*wantt) {
  939. jbot = *n;
  940. } else {
  941. jbot = *kbot;
  942. }
  943. i__4 = jbot;
  944. for (j = k + 1; j <= i__4; ++j) {
  945. refsum = v[m22 * v_dim1 + 1] * (h__[k + 1 + j * h_dim1] +
  946. v[m22 * v_dim1 + 2] * h__[k + 2 + j * h_dim1]);
  947. h__[k + 1 + j * h_dim1] -= refsum;
  948. h__[k + 2 + j * h_dim1] -= refsum * v[m22 * v_dim1 + 2];
  949. /* L40: */
  950. }
  951. /* ==== The following convergence test requires that */
  952. /* . the tradition small-compared-to-nearby-diagonals */
  953. /* . criterion and the Ahues & Tisseur (LAWN 122, 1997) */
  954. /* . criteria both be satisfied. The latter improves */
  955. /* . accuracy in some examples. Falling back on an */
  956. /* . alternate convergence criterion when TST1 or TST2 */
  957. /* . is zero (as done here) is traditional but probably */
  958. /* . unnecessary. ==== */
  959. if (k >= *ktop) {
  960. if (h__[k + 1 + k * h_dim1] != 0.) {
  961. tst1 = (d__1 = h__[k + k * h_dim1], abs(d__1)) + (
  962. d__2 = h__[k + 1 + (k + 1) * h_dim1], abs(
  963. d__2));
  964. if (tst1 == 0.) {
  965. if (k >= *ktop + 1) {
  966. tst1 += (d__1 = h__[k + (k - 1) * h_dim1],
  967. abs(d__1));
  968. }
  969. if (k >= *ktop + 2) {
  970. tst1 += (d__1 = h__[k + (k - 2) * h_dim1],
  971. abs(d__1));
  972. }
  973. if (k >= *ktop + 3) {
  974. tst1 += (d__1 = h__[k + (k - 3) * h_dim1],
  975. abs(d__1));
  976. }
  977. if (k <= *kbot - 2) {
  978. tst1 += (d__1 = h__[k + 2 + (k + 1) * h_dim1],
  979. abs(d__1));
  980. }
  981. if (k <= *kbot - 3) {
  982. tst1 += (d__1 = h__[k + 3 + (k + 1) * h_dim1],
  983. abs(d__1));
  984. }
  985. if (k <= *kbot - 4) {
  986. tst1 += (d__1 = h__[k + 4 + (k + 1) * h_dim1],
  987. abs(d__1));
  988. }
  989. }
  990. /* Computing MAX */
  991. d__2 = smlnum, d__3 = ulp * tst1;
  992. if ((d__1 = h__[k + 1 + k * h_dim1], abs(d__1)) <=
  993. f2cmax(d__2,d__3)) {
  994. /* Computing MAX */
  995. d__3 = (d__1 = h__[k + 1 + k * h_dim1], abs(d__1))
  996. , d__4 = (d__2 = h__[k + (k + 1) * h_dim1]
  997. , abs(d__2));
  998. h12 = f2cmax(d__3,d__4);
  999. /* Computing MIN */
  1000. d__3 = (d__1 = h__[k + 1 + k * h_dim1], abs(d__1))
  1001. , d__4 = (d__2 = h__[k + (k + 1) * h_dim1]
  1002. , abs(d__2));
  1003. h21 = f2cmin(d__3,d__4);
  1004. /* Computing MAX */
  1005. d__3 = (d__1 = h__[k + 1 + (k + 1) * h_dim1], abs(
  1006. d__1)), d__4 = (d__2 = h__[k + k * h_dim1]
  1007. - h__[k + 1 + (k + 1) * h_dim1], abs(
  1008. d__2));
  1009. h11 = f2cmax(d__3,d__4);
  1010. /* Computing MIN */
  1011. d__3 = (d__1 = h__[k + 1 + (k + 1) * h_dim1], abs(
  1012. d__1)), d__4 = (d__2 = h__[k + k * h_dim1]
  1013. - h__[k + 1 + (k + 1) * h_dim1], abs(
  1014. d__2));
  1015. h22 = f2cmin(d__3,d__4);
  1016. scl = h11 + h12;
  1017. tst2 = h22 * (h11 / scl);
  1018. /* Computing MAX */
  1019. d__1 = smlnum, d__2 = ulp * tst2;
  1020. if (tst2 == 0. || h21 * (h12 / scl) <= f2cmax(d__1,
  1021. d__2)) {
  1022. h__[k + 1 + k * h_dim1] = 0.;
  1023. }
  1024. }
  1025. }
  1026. }
  1027. /* ==== Accumulate orthogonal transformations. ==== */
  1028. if (accum) {
  1029. kms = k - incol;
  1030. /* Computing MAX */
  1031. i__4 = 1, i__5 = *ktop - incol;
  1032. i__6 = kdu;
  1033. for (j = f2cmax(i__4,i__5); j <= i__6; ++j) {
  1034. refsum = v[m22 * v_dim1 + 1] * (u[j + (kms + 1) *
  1035. u_dim1] + v[m22 * v_dim1 + 2] * u[j + (kms +
  1036. 2) * u_dim1]);
  1037. u[j + (kms + 1) * u_dim1] -= refsum;
  1038. u[j + (kms + 2) * u_dim1] -= refsum * v[m22 * v_dim1
  1039. + 2];
  1040. /* L50: */
  1041. }
  1042. } else if (*wantz) {
  1043. i__6 = *ihiz;
  1044. for (j = *iloz; j <= i__6; ++j) {
  1045. refsum = v[m22 * v_dim1 + 1] * (z__[j + (k + 1) *
  1046. z_dim1] + v[m22 * v_dim1 + 2] * z__[j + (k +
  1047. 2) * z_dim1]);
  1048. z__[j + (k + 1) * z_dim1] -= refsum;
  1049. z__[j + (k + 2) * z_dim1] -= refsum * v[m22 * v_dim1
  1050. + 2];
  1051. /* L60: */
  1052. }
  1053. }
  1054. }
  1055. /* ==== Normal case: Chain of 3-by-3 reflections ==== */
  1056. i__6 = mtop;
  1057. for (m = mbot; m >= i__6; --m) {
  1058. k = krcol + (m - 1 << 1);
  1059. if (k == *ktop - 1) {
  1060. dlaqr1_(&c__3, &h__[*ktop + *ktop * h_dim1], ldh, &sr[(m
  1061. << 1) - 1], &si[(m << 1) - 1], &sr[m * 2], &si[m *
  1062. 2], &v[m * v_dim1 + 1]);
  1063. alpha = v[m * v_dim1 + 1];
  1064. dlarfg_(&c__3, &alpha, &v[m * v_dim1 + 2], &c__1, &v[m *
  1065. v_dim1 + 1]);
  1066. } else {
  1067. /* ==== Perform delayed transformation of row below */
  1068. /* . Mth bulge. Exploit fact that first two elements */
  1069. /* . of row are actually zero. ==== */
  1070. refsum = v[m * v_dim1 + 1] * v[m * v_dim1 + 3] * h__[k +
  1071. 3 + (k + 2) * h_dim1];
  1072. h__[k + 3 + k * h_dim1] = -refsum;
  1073. h__[k + 3 + (k + 1) * h_dim1] = -refsum * v[m * v_dim1 +
  1074. 2];
  1075. h__[k + 3 + (k + 2) * h_dim1] -= refsum * v[m * v_dim1 +
  1076. 3];
  1077. /* ==== Calculate reflection to move */
  1078. /* . Mth bulge one step. ==== */
  1079. beta = h__[k + 1 + k * h_dim1];
  1080. v[m * v_dim1 + 2] = h__[k + 2 + k * h_dim1];
  1081. v[m * v_dim1 + 3] = h__[k + 3 + k * h_dim1];
  1082. dlarfg_(&c__3, &beta, &v[m * v_dim1 + 2], &c__1, &v[m *
  1083. v_dim1 + 1]);
  1084. /* ==== A Bulge may collapse because of vigilant */
  1085. /* . deflation or destructive underflow. In the */
  1086. /* . underflow case, try the two-small-subdiagonals */
  1087. /* . trick to try to reinflate the bulge. ==== */
  1088. if (h__[k + 3 + k * h_dim1] != 0. || h__[k + 3 + (k + 1) *
  1089. h_dim1] != 0. || h__[k + 3 + (k + 2) * h_dim1] ==
  1090. 0.) {
  1091. /* ==== Typical case: not collapsed (yet). ==== */
  1092. h__[k + 1 + k * h_dim1] = beta;
  1093. h__[k + 2 + k * h_dim1] = 0.;
  1094. h__[k + 3 + k * h_dim1] = 0.;
  1095. } else {
  1096. /* ==== Atypical case: collapsed. Attempt to */
  1097. /* . reintroduce ignoring H(K+1,K) and H(K+2,K). */
  1098. /* . If the fill resulting from the new */
  1099. /* . reflector is too large, then abandon it. */
  1100. /* . Otherwise, use the new one. ==== */
  1101. dlaqr1_(&c__3, &h__[k + 1 + (k + 1) * h_dim1], ldh, &
  1102. sr[(m << 1) - 1], &si[(m << 1) - 1], &sr[m *
  1103. 2], &si[m * 2], vt);
  1104. alpha = vt[0];
  1105. dlarfg_(&c__3, &alpha, &vt[1], &c__1, vt);
  1106. refsum = vt[0] * (h__[k + 1 + k * h_dim1] + vt[1] *
  1107. h__[k + 2 + k * h_dim1]);
  1108. if ((d__1 = h__[k + 2 + k * h_dim1] - refsum * vt[1],
  1109. abs(d__1)) + (d__2 = refsum * vt[2], abs(d__2)
  1110. ) > ulp * ((d__3 = h__[k + k * h_dim1], abs(
  1111. d__3)) + (d__4 = h__[k + 1 + (k + 1) * h_dim1]
  1112. , abs(d__4)) + (d__5 = h__[k + 2 + (k + 2) *
  1113. h_dim1], abs(d__5)))) {
  1114. /* ==== Starting a new bulge here would */
  1115. /* . create non-negligible fill. Use */
  1116. /* . the old one with trepidation. ==== */
  1117. h__[k + 1 + k * h_dim1] = beta;
  1118. h__[k + 2 + k * h_dim1] = 0.;
  1119. h__[k + 3 + k * h_dim1] = 0.;
  1120. } else {
  1121. /* ==== Starting a new bulge here would */
  1122. /* . create only negligible fill. */
  1123. /* . Replace the old reflector with */
  1124. /* . the new one. ==== */
  1125. h__[k + 1 + k * h_dim1] -= refsum;
  1126. h__[k + 2 + k * h_dim1] = 0.;
  1127. h__[k + 3 + k * h_dim1] = 0.;
  1128. v[m * v_dim1 + 1] = vt[0];
  1129. v[m * v_dim1 + 2] = vt[1];
  1130. v[m * v_dim1 + 3] = vt[2];
  1131. }
  1132. }
  1133. }
  1134. /* ==== Apply reflection from the right and */
  1135. /* . the first column of update from the left. */
  1136. /* . These updates are required for the vigilant */
  1137. /* . deflation check. We still delay most of the */
  1138. /* . updates from the left for efficiency. ==== */
  1139. /* Computing MIN */
  1140. i__5 = *kbot, i__7 = k + 3;
  1141. i__4 = f2cmin(i__5,i__7);
  1142. for (j = jtop; j <= i__4; ++j) {
  1143. refsum = v[m * v_dim1 + 1] * (h__[j + (k + 1) * h_dim1] +
  1144. v[m * v_dim1 + 2] * h__[j + (k + 2) * h_dim1] + v[
  1145. m * v_dim1 + 3] * h__[j + (k + 3) * h_dim1]);
  1146. h__[j + (k + 1) * h_dim1] -= refsum;
  1147. h__[j + (k + 2) * h_dim1] -= refsum * v[m * v_dim1 + 2];
  1148. h__[j + (k + 3) * h_dim1] -= refsum * v[m * v_dim1 + 3];
  1149. /* L70: */
  1150. }
  1151. /* ==== Perform update from left for subsequent */
  1152. /* . column. ==== */
  1153. refsum = v[m * v_dim1 + 1] * (h__[k + 1 + (k + 1) * h_dim1] +
  1154. v[m * v_dim1 + 2] * h__[k + 2 + (k + 1) * h_dim1] + v[
  1155. m * v_dim1 + 3] * h__[k + 3 + (k + 1) * h_dim1]);
  1156. h__[k + 1 + (k + 1) * h_dim1] -= refsum;
  1157. h__[k + 2 + (k + 1) * h_dim1] -= refsum * v[m * v_dim1 + 2];
  1158. h__[k + 3 + (k + 1) * h_dim1] -= refsum * v[m * v_dim1 + 3];
  1159. /* ==== The following convergence test requires that */
  1160. /* . the tradition small-compared-to-nearby-diagonals */
  1161. /* . criterion and the Ahues & Tisseur (LAWN 122, 1997) */
  1162. /* . criteria both be satisfied. The latter improves */
  1163. /* . accuracy in some examples. Falling back on an */
  1164. /* . alternate convergence criterion when TST1 or TST2 */
  1165. /* . is zero (as done here) is traditional but probably */
  1166. /* . unnecessary. ==== */
  1167. if (k < *ktop) {
  1168. mycycle_();
  1169. }
  1170. if (h__[k + 1 + k * h_dim1] != 0.) {
  1171. tst1 = (d__1 = h__[k + k * h_dim1], abs(d__1)) + (d__2 =
  1172. h__[k + 1 + (k + 1) * h_dim1], abs(d__2));
  1173. if (tst1 == 0.) {
  1174. if (k >= *ktop + 1) {
  1175. tst1 += (d__1 = h__[k + (k - 1) * h_dim1], abs(
  1176. d__1));
  1177. }
  1178. if (k >= *ktop + 2) {
  1179. tst1 += (d__1 = h__[k + (k - 2) * h_dim1], abs(
  1180. d__1));
  1181. }
  1182. if (k >= *ktop + 3) {
  1183. tst1 += (d__1 = h__[k + (k - 3) * h_dim1], abs(
  1184. d__1));
  1185. }
  1186. if (k <= *kbot - 2) {
  1187. tst1 += (d__1 = h__[k + 2 + (k + 1) * h_dim1],
  1188. abs(d__1));
  1189. }
  1190. if (k <= *kbot - 3) {
  1191. tst1 += (d__1 = h__[k + 3 + (k + 1) * h_dim1],
  1192. abs(d__1));
  1193. }
  1194. if (k <= *kbot - 4) {
  1195. tst1 += (d__1 = h__[k + 4 + (k + 1) * h_dim1],
  1196. abs(d__1));
  1197. }
  1198. }
  1199. /* Computing MAX */
  1200. d__2 = smlnum, d__3 = ulp * tst1;
  1201. if ((d__1 = h__[k + 1 + k * h_dim1], abs(d__1)) <= f2cmax(
  1202. d__2,d__3)) {
  1203. /* Computing MAX */
  1204. d__3 = (d__1 = h__[k + 1 + k * h_dim1], abs(d__1)),
  1205. d__4 = (d__2 = h__[k + (k + 1) * h_dim1], abs(
  1206. d__2));
  1207. h12 = f2cmax(d__3,d__4);
  1208. /* Computing MIN */
  1209. d__3 = (d__1 = h__[k + 1 + k * h_dim1], abs(d__1)),
  1210. d__4 = (d__2 = h__[k + (k + 1) * h_dim1], abs(
  1211. d__2));
  1212. h21 = f2cmin(d__3,d__4);
  1213. /* Computing MAX */
  1214. d__3 = (d__1 = h__[k + 1 + (k + 1) * h_dim1], abs(
  1215. d__1)), d__4 = (d__2 = h__[k + k * h_dim1] -
  1216. h__[k + 1 + (k + 1) * h_dim1], abs(d__2));
  1217. h11 = f2cmax(d__3,d__4);
  1218. /* Computing MIN */
  1219. d__3 = (d__1 = h__[k + 1 + (k + 1) * h_dim1], abs(
  1220. d__1)), d__4 = (d__2 = h__[k + k * h_dim1] -
  1221. h__[k + 1 + (k + 1) * h_dim1], abs(d__2));
  1222. h22 = f2cmin(d__3,d__4);
  1223. scl = h11 + h12;
  1224. tst2 = h22 * (h11 / scl);
  1225. /* Computing MAX */
  1226. d__1 = smlnum, d__2 = ulp * tst2;
  1227. if (tst2 == 0. || h21 * (h12 / scl) <= f2cmax(d__1,d__2))
  1228. {
  1229. h__[k + 1 + k * h_dim1] = 0.;
  1230. }
  1231. }
  1232. }
  1233. /* L80: */
  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. dgemm_("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. dlacpy_("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. dgemm_("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. dlacpy_("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. dgemm_("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. dlacpy_("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 DLAQR5 ==== */
  1387. return;
  1388. } /* dlaqr5_ */