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