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.

zunbdb.c 44 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436
  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 integer c__1 = 1;
  485. /* > \brief \b ZUNBDB */
  486. /* =========== DOCUMENTATION =========== */
  487. /* Online html documentation available at */
  488. /* http://www.netlib.org/lapack/explore-html/ */
  489. /* > \htmlonly */
  490. /* > Download ZUNBDB + dependencies */
  491. /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zunbdb.
  492. f"> */
  493. /* > [TGZ]</a> */
  494. /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zunbdb.
  495. f"> */
  496. /* > [ZIP]</a> */
  497. /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zunbdb.
  498. f"> */
  499. /* > [TXT]</a> */
  500. /* > \endhtmlonly */
  501. /* Definition: */
  502. /* =========== */
  503. /* SUBROUTINE ZUNBDB( TRANS, SIGNS, M, P, Q, X11, LDX11, X12, LDX12, */
  504. /* X21, LDX21, X22, LDX22, THETA, PHI, TAUP1, */
  505. /* TAUP2, TAUQ1, TAUQ2, WORK, LWORK, INFO ) */
  506. /* CHARACTER SIGNS, TRANS */
  507. /* INTEGER INFO, LDX11, LDX12, LDX21, LDX22, LWORK, M, P, */
  508. /* $ Q */
  509. /* DOUBLE PRECISION PHI( * ), THETA( * ) */
  510. /* COMPLEX*16 TAUP1( * ), TAUP2( * ), TAUQ1( * ), TAUQ2( * ), */
  511. /* $ WORK( * ), X11( LDX11, * ), X12( LDX12, * ), */
  512. /* $ X21( LDX21, * ), X22( LDX22, * ) */
  513. /* > \par Purpose: */
  514. /* ============= */
  515. /* > */
  516. /* > \verbatim */
  517. /* > */
  518. /* > ZUNBDB simultaneously bidiagonalizes the blocks of an M-by-M */
  519. /* > partitioned unitary matrix X: */
  520. /* > */
  521. /* > [ B11 | B12 0 0 ] */
  522. /* > [ X11 | X12 ] [ P1 | ] [ 0 | 0 -I 0 ] [ Q1 | ]**H */
  523. /* > X = [-----------] = [---------] [----------------] [---------] . */
  524. /* > [ X21 | X22 ] [ | P2 ] [ B21 | B22 0 0 ] [ | Q2 ] */
  525. /* > [ 0 | 0 0 I ] */
  526. /* > */
  527. /* > X11 is P-by-Q. Q must be no larger than P, M-P, or M-Q. (If this is */
  528. /* > not the case, then X must be transposed and/or permuted. This can be */
  529. /* > done in constant time using the TRANS and SIGNS options. See ZUNCSD */
  530. /* > for details.) */
  531. /* > */
  532. /* > The unitary matrices P1, P2, Q1, and Q2 are P-by-P, (M-P)-by- */
  533. /* > (M-P), Q-by-Q, and (M-Q)-by-(M-Q), respectively. They are */
  534. /* > represented implicitly by Householder vectors. */
  535. /* > */
  536. /* > B11, B12, B21, and B22 are Q-by-Q bidiagonal matrices represented */
  537. /* > implicitly by angles THETA, PHI. */
  538. /* > \endverbatim */
  539. /* Arguments: */
  540. /* ========== */
  541. /* > \param[in] TRANS */
  542. /* > \verbatim */
  543. /* > TRANS is CHARACTER */
  544. /* > = 'T': X, U1, U2, V1T, and V2T are stored in row-major */
  545. /* > order; */
  546. /* > otherwise: X, U1, U2, V1T, and V2T are stored in column- */
  547. /* > major order. */
  548. /* > \endverbatim */
  549. /* > */
  550. /* > \param[in] SIGNS */
  551. /* > \verbatim */
  552. /* > SIGNS is CHARACTER */
  553. /* > = 'O': The lower-left block is made nonpositive (the */
  554. /* > "other" convention); */
  555. /* > otherwise: The upper-right block is made nonpositive (the */
  556. /* > "default" convention). */
  557. /* > \endverbatim */
  558. /* > */
  559. /* > \param[in] M */
  560. /* > \verbatim */
  561. /* > M is INTEGER */
  562. /* > The number of rows and columns in X. */
  563. /* > \endverbatim */
  564. /* > */
  565. /* > \param[in] P */
  566. /* > \verbatim */
  567. /* > P is INTEGER */
  568. /* > The number of rows in X11 and X12. 0 <= P <= M. */
  569. /* > \endverbatim */
  570. /* > */
  571. /* > \param[in] Q */
  572. /* > \verbatim */
  573. /* > Q is INTEGER */
  574. /* > The number of columns in X11 and X21. 0 <= Q <= */
  575. /* > MIN(P,M-P,M-Q). */
  576. /* > \endverbatim */
  577. /* > */
  578. /* > \param[in,out] X11 */
  579. /* > \verbatim */
  580. /* > X11 is COMPLEX*16 array, dimension (LDX11,Q) */
  581. /* > On entry, the top-left block of the unitary matrix to be */
  582. /* > reduced. On exit, the form depends on TRANS: */
  583. /* > If TRANS = 'N', then */
  584. /* > the columns of tril(X11) specify reflectors for P1, */
  585. /* > the rows of triu(X11,1) specify reflectors for Q1; */
  586. /* > else TRANS = 'T', and */
  587. /* > the rows of triu(X11) specify reflectors for P1, */
  588. /* > the columns of tril(X11,-1) specify reflectors for Q1. */
  589. /* > \endverbatim */
  590. /* > */
  591. /* > \param[in] LDX11 */
  592. /* > \verbatim */
  593. /* > LDX11 is INTEGER */
  594. /* > The leading dimension of X11. If TRANS = 'N', then LDX11 >= */
  595. /* > P; else LDX11 >= Q. */
  596. /* > \endverbatim */
  597. /* > */
  598. /* > \param[in,out] X12 */
  599. /* > \verbatim */
  600. /* > X12 is COMPLEX*16 array, dimension (LDX12,M-Q) */
  601. /* > On entry, the top-right block of the unitary matrix to */
  602. /* > be reduced. On exit, the form depends on TRANS: */
  603. /* > If TRANS = 'N', then */
  604. /* > the rows of triu(X12) specify the first P reflectors for */
  605. /* > Q2; */
  606. /* > else TRANS = 'T', and */
  607. /* > the columns of tril(X12) specify the first P reflectors */
  608. /* > for Q2. */
  609. /* > \endverbatim */
  610. /* > */
  611. /* > \param[in] LDX12 */
  612. /* > \verbatim */
  613. /* > LDX12 is INTEGER */
  614. /* > The leading dimension of X12. If TRANS = 'N', then LDX12 >= */
  615. /* > P; else LDX11 >= M-Q. */
  616. /* > \endverbatim */
  617. /* > */
  618. /* > \param[in,out] X21 */
  619. /* > \verbatim */
  620. /* > X21 is COMPLEX*16 array, dimension (LDX21,Q) */
  621. /* > On entry, the bottom-left block of the unitary matrix to */
  622. /* > be reduced. On exit, the form depends on TRANS: */
  623. /* > If TRANS = 'N', then */
  624. /* > the columns of tril(X21) specify reflectors for P2; */
  625. /* > else TRANS = 'T', and */
  626. /* > the rows of triu(X21) specify reflectors for P2. */
  627. /* > \endverbatim */
  628. /* > */
  629. /* > \param[in] LDX21 */
  630. /* > \verbatim */
  631. /* > LDX21 is INTEGER */
  632. /* > The leading dimension of X21. If TRANS = 'N', then LDX21 >= */
  633. /* > M-P; else LDX21 >= Q. */
  634. /* > \endverbatim */
  635. /* > */
  636. /* > \param[in,out] X22 */
  637. /* > \verbatim */
  638. /* > X22 is COMPLEX*16 array, dimension (LDX22,M-Q) */
  639. /* > On entry, the bottom-right block of the unitary matrix to */
  640. /* > be reduced. On exit, the form depends on TRANS: */
  641. /* > If TRANS = 'N', then */
  642. /* > the rows of triu(X22(Q+1:M-P,P+1:M-Q)) specify the last */
  643. /* > M-P-Q reflectors for Q2, */
  644. /* > else TRANS = 'T', and */
  645. /* > the columns of tril(X22(P+1:M-Q,Q+1:M-P)) specify the last */
  646. /* > M-P-Q reflectors for P2. */
  647. /* > \endverbatim */
  648. /* > */
  649. /* > \param[in] LDX22 */
  650. /* > \verbatim */
  651. /* > LDX22 is INTEGER */
  652. /* > The leading dimension of X22. If TRANS = 'N', then LDX22 >= */
  653. /* > M-P; else LDX22 >= M-Q. */
  654. /* > \endverbatim */
  655. /* > */
  656. /* > \param[out] THETA */
  657. /* > \verbatim */
  658. /* > THETA is DOUBLE PRECISION array, dimension (Q) */
  659. /* > The entries of the bidiagonal blocks B11, B12, B21, B22 can */
  660. /* > be computed from the angles THETA and PHI. See Further */
  661. /* > Details. */
  662. /* > \endverbatim */
  663. /* > */
  664. /* > \param[out] PHI */
  665. /* > \verbatim */
  666. /* > PHI is DOUBLE PRECISION array, dimension (Q-1) */
  667. /* > The entries of the bidiagonal blocks B11, B12, B21, B22 can */
  668. /* > be computed from the angles THETA and PHI. See Further */
  669. /* > Details. */
  670. /* > \endverbatim */
  671. /* > */
  672. /* > \param[out] TAUP1 */
  673. /* > \verbatim */
  674. /* > TAUP1 is COMPLEX*16 array, dimension (P) */
  675. /* > The scalar factors of the elementary reflectors that define */
  676. /* > P1. */
  677. /* > \endverbatim */
  678. /* > */
  679. /* > \param[out] TAUP2 */
  680. /* > \verbatim */
  681. /* > TAUP2 is COMPLEX*16 array, dimension (M-P) */
  682. /* > The scalar factors of the elementary reflectors that define */
  683. /* > P2. */
  684. /* > \endverbatim */
  685. /* > */
  686. /* > \param[out] TAUQ1 */
  687. /* > \verbatim */
  688. /* > TAUQ1 is COMPLEX*16 array, dimension (Q) */
  689. /* > The scalar factors of the elementary reflectors that define */
  690. /* > Q1. */
  691. /* > \endverbatim */
  692. /* > */
  693. /* > \param[out] TAUQ2 */
  694. /* > \verbatim */
  695. /* > TAUQ2 is COMPLEX*16 array, dimension (M-Q) */
  696. /* > The scalar factors of the elementary reflectors that define */
  697. /* > Q2. */
  698. /* > \endverbatim */
  699. /* > */
  700. /* > \param[out] WORK */
  701. /* > \verbatim */
  702. /* > WORK is COMPLEX*16 array, dimension (LWORK) */
  703. /* > \endverbatim */
  704. /* > */
  705. /* > \param[in] LWORK */
  706. /* > \verbatim */
  707. /* > LWORK is INTEGER */
  708. /* > The dimension of the array WORK. LWORK >= M-Q. */
  709. /* > */
  710. /* > If LWORK = -1, then a workspace query is assumed; the routine */
  711. /* > only calculates the optimal size of the WORK array, returns */
  712. /* > this value as the first entry of the WORK array, and no error */
  713. /* > message related to LWORK is issued by XERBLA. */
  714. /* > \endverbatim */
  715. /* > */
  716. /* > \param[out] INFO */
  717. /* > \verbatim */
  718. /* > INFO is INTEGER */
  719. /* > = 0: successful exit. */
  720. /* > < 0: if INFO = -i, the i-th argument had an illegal value. */
  721. /* > \endverbatim */
  722. /* Authors: */
  723. /* ======== */
  724. /* > \author Univ. of Tennessee */
  725. /* > \author Univ. of California Berkeley */
  726. /* > \author Univ. of Colorado Denver */
  727. /* > \author NAG Ltd. */
  728. /* > \date December 2016 */
  729. /* > \ingroup complex16OTHERcomputational */
  730. /* > \par Further Details: */
  731. /* ===================== */
  732. /* > */
  733. /* > \verbatim */
  734. /* > */
  735. /* > The bidiagonal blocks B11, B12, B21, and B22 are represented */
  736. /* > implicitly by angles THETA(1), ..., THETA(Q) and PHI(1), ..., */
  737. /* > PHI(Q-1). B11 and B21 are upper bidiagonal, while B21 and B22 are */
  738. /* > lower bidiagonal. Every entry in each bidiagonal band is a product */
  739. /* > of a sine or cosine of a THETA with a sine or cosine of a PHI. See */
  740. /* > [1] or ZUNCSD for details. */
  741. /* > */
  742. /* > P1, P2, Q1, and Q2 are represented as products of elementary */
  743. /* > reflectors. See ZUNCSD for details on generating P1, P2, Q1, and Q2 */
  744. /* > using ZUNGQR and ZUNGLQ. */
  745. /* > \endverbatim */
  746. /* > \par References: */
  747. /* ================ */
  748. /* > */
  749. /* > [1] Brian D. Sutton. Computing the complete CS decomposition. Numer. */
  750. /* > Algorithms, 50(1):33-65, 2009. */
  751. /* > */
  752. /* ===================================================================== */
  753. /* Subroutine */ void zunbdb_(char *trans, char *signs, integer *m, integer *p,
  754. integer *q, doublecomplex *x11, integer *ldx11, doublecomplex *x12,
  755. integer *ldx12, doublecomplex *x21, integer *ldx21, doublecomplex *
  756. x22, integer *ldx22, doublereal *theta, doublereal *phi,
  757. doublecomplex *taup1, doublecomplex *taup2, doublecomplex *tauq1,
  758. doublecomplex *tauq2, doublecomplex *work, integer *lwork, integer *
  759. info)
  760. {
  761. /* System generated locals */
  762. integer x11_dim1, x11_offset, x12_dim1, x12_offset, x21_dim1, x21_offset,
  763. x22_dim1, x22_offset, i__1, i__2, i__3;
  764. doublereal d__1;
  765. doublecomplex z__1;
  766. /* Local variables */
  767. logical colmajor;
  768. integer lworkmin, lworkopt, i__;
  769. extern logical lsame_(char *, char *);
  770. extern /* Subroutine */ void zscal_(integer *, doublecomplex *,
  771. doublecomplex *, integer *), zlarf_(char *, integer *, integer *,
  772. doublecomplex *, integer *, doublecomplex *, doublecomplex *,
  773. integer *, doublecomplex *);
  774. doublereal z1, z2, z3, z4;
  775. extern /* Subroutine */ void zaxpy_(integer *, doublecomplex *,
  776. doublecomplex *, integer *, doublecomplex *, integer *);
  777. extern doublereal dznrm2_(integer *, doublecomplex *, integer *);
  778. extern /* Subroutine */ int xerbla_(char *, integer *, ftnlen);
  779. extern void zlacgv_(
  780. integer *, doublecomplex *, integer *);
  781. logical lquery;
  782. extern /* Subroutine */ void zlarfgp_(integer *, doublecomplex *,
  783. doublecomplex *, integer *, doublecomplex *);
  784. /* -- LAPACK computational routine (version 3.7.0) -- */
  785. /* -- LAPACK is a software package provided by Univ. of Tennessee, -- */
  786. /* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- */
  787. /* December 2016 */
  788. /* ==================================================================== */
  789. /* Test input arguments */
  790. /* Parameter adjustments */
  791. x11_dim1 = *ldx11;
  792. x11_offset = 1 + x11_dim1 * 1;
  793. x11 -= x11_offset;
  794. x12_dim1 = *ldx12;
  795. x12_offset = 1 + x12_dim1 * 1;
  796. x12 -= x12_offset;
  797. x21_dim1 = *ldx21;
  798. x21_offset = 1 + x21_dim1 * 1;
  799. x21 -= x21_offset;
  800. x22_dim1 = *ldx22;
  801. x22_offset = 1 + x22_dim1 * 1;
  802. x22 -= x22_offset;
  803. --theta;
  804. --phi;
  805. --taup1;
  806. --taup2;
  807. --tauq1;
  808. --tauq2;
  809. --work;
  810. /* Function Body */
  811. *info = 0;
  812. colmajor = ! lsame_(trans, "T");
  813. if (! lsame_(signs, "O")) {
  814. z1 = 1.;
  815. z2 = 1.;
  816. z3 = 1.;
  817. z4 = 1.;
  818. } else {
  819. z1 = 1.;
  820. z2 = -1.;
  821. z3 = 1.;
  822. z4 = -1.;
  823. }
  824. lquery = *lwork == -1;
  825. if (*m < 0) {
  826. *info = -3;
  827. } else if (*p < 0 || *p > *m) {
  828. *info = -4;
  829. } else if (*q < 0 || *q > *p || *q > *m - *p || *q > *m - *q) {
  830. *info = -5;
  831. } else if (colmajor && *ldx11 < f2cmax(1,*p)) {
  832. *info = -7;
  833. } else if (! colmajor && *ldx11 < f2cmax(1,*q)) {
  834. *info = -7;
  835. } else if (colmajor && *ldx12 < f2cmax(1,*p)) {
  836. *info = -9;
  837. } else /* if(complicated condition) */ {
  838. /* Computing MAX */
  839. i__1 = 1, i__2 = *m - *q;
  840. if (! colmajor && *ldx12 < f2cmax(i__1,i__2)) {
  841. *info = -9;
  842. } else /* if(complicated condition) */ {
  843. /* Computing MAX */
  844. i__1 = 1, i__2 = *m - *p;
  845. if (colmajor && *ldx21 < f2cmax(i__1,i__2)) {
  846. *info = -11;
  847. } else if (! colmajor && *ldx21 < f2cmax(1,*q)) {
  848. *info = -11;
  849. } else /* if(complicated condition) */ {
  850. /* Computing MAX */
  851. i__1 = 1, i__2 = *m - *p;
  852. if (colmajor && *ldx22 < f2cmax(i__1,i__2)) {
  853. *info = -13;
  854. } else /* if(complicated condition) */ {
  855. /* Computing MAX */
  856. i__1 = 1, i__2 = *m - *q;
  857. if (! colmajor && *ldx22 < f2cmax(i__1,i__2)) {
  858. *info = -13;
  859. }
  860. }
  861. }
  862. }
  863. }
  864. /* Compute workspace */
  865. if (*info == 0) {
  866. lworkopt = *m - *q;
  867. lworkmin = *m - *q;
  868. work[1].r = (doublereal) lworkopt, work[1].i = 0.;
  869. if (*lwork < lworkmin && ! lquery) {
  870. *info = -21;
  871. }
  872. }
  873. if (*info != 0) {
  874. i__1 = -(*info);
  875. xerbla_("xORBDB", &i__1, (ftnlen)6);
  876. return;
  877. } else if (lquery) {
  878. return;
  879. }
  880. /* Handle column-major and row-major separately */
  881. if (colmajor) {
  882. /* Reduce columns 1, ..., Q of X11, X12, X21, and X22 */
  883. i__1 = *q;
  884. for (i__ = 1; i__ <= i__1; ++i__) {
  885. if (i__ == 1) {
  886. i__2 = *p - i__ + 1;
  887. z__1.r = z1, z__1.i = 0.;
  888. zscal_(&i__2, &z__1, &x11[i__ + i__ * x11_dim1], &c__1);
  889. } else {
  890. i__2 = *p - i__ + 1;
  891. d__1 = z1 * cos(phi[i__ - 1]);
  892. z__1.r = d__1, z__1.i = 0.;
  893. zscal_(&i__2, &z__1, &x11[i__ + i__ * x11_dim1], &c__1);
  894. i__2 = *p - i__ + 1;
  895. d__1 = -z1 * z3 * z4 * sin(phi[i__ - 1]);
  896. z__1.r = d__1, z__1.i = 0.;
  897. zaxpy_(&i__2, &z__1, &x12[i__ + (i__ - 1) * x12_dim1], &c__1,
  898. &x11[i__ + i__ * x11_dim1], &c__1);
  899. }
  900. if (i__ == 1) {
  901. i__2 = *m - *p - i__ + 1;
  902. z__1.r = z2, z__1.i = 0.;
  903. zscal_(&i__2, &z__1, &x21[i__ + i__ * x21_dim1], &c__1);
  904. } else {
  905. i__2 = *m - *p - i__ + 1;
  906. d__1 = z2 * cos(phi[i__ - 1]);
  907. z__1.r = d__1, z__1.i = 0.;
  908. zscal_(&i__2, &z__1, &x21[i__ + i__ * x21_dim1], &c__1);
  909. i__2 = *m - *p - i__ + 1;
  910. d__1 = -z2 * z3 * z4 * sin(phi[i__ - 1]);
  911. z__1.r = d__1, z__1.i = 0.;
  912. zaxpy_(&i__2, &z__1, &x22[i__ + (i__ - 1) * x22_dim1], &c__1,
  913. &x21[i__ + i__ * x21_dim1], &c__1);
  914. }
  915. i__2 = *m - *p - i__ + 1;
  916. i__3 = *p - i__ + 1;
  917. theta[i__] = atan2(dznrm2_(&i__2, &x21[i__ + i__ * x21_dim1], &
  918. c__1), dznrm2_(&i__3, &x11[i__ + i__ * x11_dim1], &c__1));
  919. if (*p > i__) {
  920. i__2 = *p - i__ + 1;
  921. zlarfgp_(&i__2, &x11[i__ + i__ * x11_dim1], &x11[i__ + 1 +
  922. i__ * x11_dim1], &c__1, &taup1[i__]);
  923. } else if (*p == i__) {
  924. i__2 = *p - i__ + 1;
  925. zlarfgp_(&i__2, &x11[i__ + i__ * x11_dim1], &x11[i__ + i__ *
  926. x11_dim1], &c__1, &taup1[i__]);
  927. }
  928. i__2 = i__ + i__ * x11_dim1;
  929. x11[i__2].r = 1., x11[i__2].i = 0.;
  930. if (*m - *p > i__) {
  931. i__2 = *m - *p - i__ + 1;
  932. zlarfgp_(&i__2, &x21[i__ + i__ * x21_dim1], &x21[i__ + 1 +
  933. i__ * x21_dim1], &c__1, &taup2[i__]);
  934. } else if (*m - *p == i__) {
  935. i__2 = *m - *p - i__ + 1;
  936. zlarfgp_(&i__2, &x21[i__ + i__ * x21_dim1], &x21[i__ + i__ *
  937. x21_dim1], &c__1, &taup2[i__]);
  938. }
  939. i__2 = i__ + i__ * x21_dim1;
  940. x21[i__2].r = 1., x21[i__2].i = 0.;
  941. if (*q > i__) {
  942. i__2 = *p - i__ + 1;
  943. i__3 = *q - i__;
  944. d_cnjg(&z__1, &taup1[i__]);
  945. zlarf_("L", &i__2, &i__3, &x11[i__ + i__ * x11_dim1], &c__1, &
  946. z__1, &x11[i__ + (i__ + 1) * x11_dim1], ldx11, &work[
  947. 1]);
  948. i__2 = *m - *p - i__ + 1;
  949. i__3 = *q - i__;
  950. d_cnjg(&z__1, &taup2[i__]);
  951. zlarf_("L", &i__2, &i__3, &x21[i__ + i__ * x21_dim1], &c__1, &
  952. z__1, &x21[i__ + (i__ + 1) * x21_dim1], ldx21, &work[
  953. 1]);
  954. }
  955. if (*m - *q + 1 > i__) {
  956. i__2 = *p - i__ + 1;
  957. i__3 = *m - *q - i__ + 1;
  958. d_cnjg(&z__1, &taup1[i__]);
  959. zlarf_("L", &i__2, &i__3, &x11[i__ + i__ * x11_dim1], &c__1, &
  960. z__1, &x12[i__ + i__ * x12_dim1], ldx12, &work[1]);
  961. i__2 = *m - *p - i__ + 1;
  962. i__3 = *m - *q - i__ + 1;
  963. d_cnjg(&z__1, &taup2[i__]);
  964. zlarf_("L", &i__2, &i__3, &x21[i__ + i__ * x21_dim1], &c__1, &
  965. z__1, &x22[i__ + i__ * x22_dim1], ldx22, &work[1]);
  966. }
  967. if (i__ < *q) {
  968. i__2 = *q - i__;
  969. d__1 = -z1 * z3 * sin(theta[i__]);
  970. z__1.r = d__1, z__1.i = 0.;
  971. zscal_(&i__2, &z__1, &x11[i__ + (i__ + 1) * x11_dim1], ldx11);
  972. i__2 = *q - i__;
  973. d__1 = z2 * z3 * cos(theta[i__]);
  974. z__1.r = d__1, z__1.i = 0.;
  975. zaxpy_(&i__2, &z__1, &x21[i__ + (i__ + 1) * x21_dim1], ldx21,
  976. &x11[i__ + (i__ + 1) * x11_dim1], ldx11);
  977. }
  978. i__2 = *m - *q - i__ + 1;
  979. d__1 = -z1 * z4 * sin(theta[i__]);
  980. z__1.r = d__1, z__1.i = 0.;
  981. zscal_(&i__2, &z__1, &x12[i__ + i__ * x12_dim1], ldx12);
  982. i__2 = *m - *q - i__ + 1;
  983. d__1 = z2 * z4 * cos(theta[i__]);
  984. z__1.r = d__1, z__1.i = 0.;
  985. zaxpy_(&i__2, &z__1, &x22[i__ + i__ * x22_dim1], ldx22, &x12[i__
  986. + i__ * x12_dim1], ldx12);
  987. if (i__ < *q) {
  988. i__2 = *q - i__;
  989. i__3 = *m - *q - i__ + 1;
  990. phi[i__] = atan2(dznrm2_(&i__2, &x11[i__ + (i__ + 1) *
  991. x11_dim1], ldx11), dznrm2_(&i__3, &x12[i__ + i__ *
  992. x12_dim1], ldx12));
  993. }
  994. if (i__ < *q) {
  995. i__2 = *q - i__;
  996. zlacgv_(&i__2, &x11[i__ + (i__ + 1) * x11_dim1], ldx11);
  997. if (i__ == *q - 1) {
  998. i__2 = *q - i__;
  999. zlarfgp_(&i__2, &x11[i__ + (i__ + 1) * x11_dim1], &x11[
  1000. i__ + (i__ + 1) * x11_dim1], ldx11, &tauq1[i__]);
  1001. } else {
  1002. i__2 = *q - i__;
  1003. zlarfgp_(&i__2, &x11[i__ + (i__ + 1) * x11_dim1], &x11[
  1004. i__ + (i__ + 2) * x11_dim1], ldx11, &tauq1[i__]);
  1005. }
  1006. i__2 = i__ + (i__ + 1) * x11_dim1;
  1007. x11[i__2].r = 1., x11[i__2].i = 0.;
  1008. }
  1009. if (*m - *q + 1 > i__) {
  1010. i__2 = *m - *q - i__ + 1;
  1011. zlacgv_(&i__2, &x12[i__ + i__ * x12_dim1], ldx12);
  1012. if (*m - *q == i__) {
  1013. i__2 = *m - *q - i__ + 1;
  1014. zlarfgp_(&i__2, &x12[i__ + i__ * x12_dim1], &x12[i__ +
  1015. i__ * x12_dim1], ldx12, &tauq2[i__]);
  1016. } else {
  1017. i__2 = *m - *q - i__ + 1;
  1018. zlarfgp_(&i__2, &x12[i__ + i__ * x12_dim1], &x12[i__ + (
  1019. i__ + 1) * x12_dim1], ldx12, &tauq2[i__]);
  1020. }
  1021. }
  1022. i__2 = i__ + i__ * x12_dim1;
  1023. x12[i__2].r = 1., x12[i__2].i = 0.;
  1024. if (i__ < *q) {
  1025. i__2 = *p - i__;
  1026. i__3 = *q - i__;
  1027. zlarf_("R", &i__2, &i__3, &x11[i__ + (i__ + 1) * x11_dim1],
  1028. ldx11, &tauq1[i__], &x11[i__ + 1 + (i__ + 1) *
  1029. x11_dim1], ldx11, &work[1]);
  1030. i__2 = *m - *p - i__;
  1031. i__3 = *q - i__;
  1032. zlarf_("R", &i__2, &i__3, &x11[i__ + (i__ + 1) * x11_dim1],
  1033. ldx11, &tauq1[i__], &x21[i__ + 1 + (i__ + 1) *
  1034. x21_dim1], ldx21, &work[1]);
  1035. }
  1036. if (*p > i__) {
  1037. i__2 = *p - i__;
  1038. i__3 = *m - *q - i__ + 1;
  1039. zlarf_("R", &i__2, &i__3, &x12[i__ + i__ * x12_dim1], ldx12, &
  1040. tauq2[i__], &x12[i__ + 1 + i__ * x12_dim1], ldx12, &
  1041. work[1]);
  1042. }
  1043. if (*m - *p > i__) {
  1044. i__2 = *m - *p - i__;
  1045. i__3 = *m - *q - i__ + 1;
  1046. zlarf_("R", &i__2, &i__3, &x12[i__ + i__ * x12_dim1], ldx12, &
  1047. tauq2[i__], &x22[i__ + 1 + i__ * x22_dim1], ldx22, &
  1048. work[1]);
  1049. }
  1050. if (i__ < *q) {
  1051. i__2 = *q - i__;
  1052. zlacgv_(&i__2, &x11[i__ + (i__ + 1) * x11_dim1], ldx11);
  1053. }
  1054. i__2 = *m - *q - i__ + 1;
  1055. zlacgv_(&i__2, &x12[i__ + i__ * x12_dim1], ldx12);
  1056. }
  1057. /* Reduce columns Q + 1, ..., P of X12, X22 */
  1058. i__1 = *p;
  1059. for (i__ = *q + 1; i__ <= i__1; ++i__) {
  1060. i__2 = *m - *q - i__ + 1;
  1061. d__1 = -z1 * z4;
  1062. z__1.r = d__1, z__1.i = 0.;
  1063. zscal_(&i__2, &z__1, &x12[i__ + i__ * x12_dim1], ldx12);
  1064. i__2 = *m - *q - i__ + 1;
  1065. zlacgv_(&i__2, &x12[i__ + i__ * x12_dim1], ldx12);
  1066. if (i__ >= *m - *q) {
  1067. i__2 = *m - *q - i__ + 1;
  1068. zlarfgp_(&i__2, &x12[i__ + i__ * x12_dim1], &x12[i__ + i__ *
  1069. x12_dim1], ldx12, &tauq2[i__]);
  1070. } else {
  1071. i__2 = *m - *q - i__ + 1;
  1072. zlarfgp_(&i__2, &x12[i__ + i__ * x12_dim1], &x12[i__ + (i__ +
  1073. 1) * x12_dim1], ldx12, &tauq2[i__]);
  1074. }
  1075. i__2 = i__ + i__ * x12_dim1;
  1076. x12[i__2].r = 1., x12[i__2].i = 0.;
  1077. if (*p > i__) {
  1078. i__2 = *p - i__;
  1079. i__3 = *m - *q - i__ + 1;
  1080. zlarf_("R", &i__2, &i__3, &x12[i__ + i__ * x12_dim1], ldx12, &
  1081. tauq2[i__], &x12[i__ + 1 + i__ * x12_dim1], ldx12, &
  1082. work[1]);
  1083. }
  1084. if (*m - *p - *q >= 1) {
  1085. i__2 = *m - *p - *q;
  1086. i__3 = *m - *q - i__ + 1;
  1087. zlarf_("R", &i__2, &i__3, &x12[i__ + i__ * x12_dim1], ldx12, &
  1088. tauq2[i__], &x22[*q + 1 + i__ * x22_dim1], ldx22, &
  1089. work[1]);
  1090. }
  1091. i__2 = *m - *q - i__ + 1;
  1092. zlacgv_(&i__2, &x12[i__ + i__ * x12_dim1], ldx12);
  1093. }
  1094. /* Reduce columns P + 1, ..., M - Q of X12, X22 */
  1095. i__1 = *m - *p - *q;
  1096. for (i__ = 1; i__ <= i__1; ++i__) {
  1097. i__2 = *m - *p - *q - i__ + 1;
  1098. d__1 = z2 * z4;
  1099. z__1.r = d__1, z__1.i = 0.;
  1100. zscal_(&i__2, &z__1, &x22[*q + i__ + (*p + i__) * x22_dim1],
  1101. ldx22);
  1102. i__2 = *m - *p - *q - i__ + 1;
  1103. zlacgv_(&i__2, &x22[*q + i__ + (*p + i__) * x22_dim1], ldx22);
  1104. i__2 = *m - *p - *q - i__ + 1;
  1105. zlarfgp_(&i__2, &x22[*q + i__ + (*p + i__) * x22_dim1], &x22[*q +
  1106. i__ + (*p + i__ + 1) * x22_dim1], ldx22, &tauq2[*p + i__])
  1107. ;
  1108. i__2 = *q + i__ + (*p + i__) * x22_dim1;
  1109. x22[i__2].r = 1., x22[i__2].i = 0.;
  1110. i__2 = *m - *p - *q - i__;
  1111. i__3 = *m - *p - *q - i__ + 1;
  1112. zlarf_("R", &i__2, &i__3, &x22[*q + i__ + (*p + i__) * x22_dim1],
  1113. ldx22, &tauq2[*p + i__], &x22[*q + i__ + 1 + (*p + i__) *
  1114. x22_dim1], ldx22, &work[1]);
  1115. i__2 = *m - *p - *q - i__ + 1;
  1116. zlacgv_(&i__2, &x22[*q + i__ + (*p + i__) * x22_dim1], ldx22);
  1117. }
  1118. } else {
  1119. /* Reduce columns 1, ..., Q of X11, X12, X21, X22 */
  1120. i__1 = *q;
  1121. for (i__ = 1; i__ <= i__1; ++i__) {
  1122. if (i__ == 1) {
  1123. i__2 = *p - i__ + 1;
  1124. z__1.r = z1, z__1.i = 0.;
  1125. zscal_(&i__2, &z__1, &x11[i__ + i__ * x11_dim1], ldx11);
  1126. } else {
  1127. i__2 = *p - i__ + 1;
  1128. d__1 = z1 * cos(phi[i__ - 1]);
  1129. z__1.r = d__1, z__1.i = 0.;
  1130. zscal_(&i__2, &z__1, &x11[i__ + i__ * x11_dim1], ldx11);
  1131. i__2 = *p - i__ + 1;
  1132. d__1 = -z1 * z3 * z4 * sin(phi[i__ - 1]);
  1133. z__1.r = d__1, z__1.i = 0.;
  1134. zaxpy_(&i__2, &z__1, &x12[i__ - 1 + i__ * x12_dim1], ldx12, &
  1135. x11[i__ + i__ * x11_dim1], ldx11);
  1136. }
  1137. if (i__ == 1) {
  1138. i__2 = *m - *p - i__ + 1;
  1139. z__1.r = z2, z__1.i = 0.;
  1140. zscal_(&i__2, &z__1, &x21[i__ + i__ * x21_dim1], ldx21);
  1141. } else {
  1142. i__2 = *m - *p - i__ + 1;
  1143. d__1 = z2 * cos(phi[i__ - 1]);
  1144. z__1.r = d__1, z__1.i = 0.;
  1145. zscal_(&i__2, &z__1, &x21[i__ + i__ * x21_dim1], ldx21);
  1146. i__2 = *m - *p - i__ + 1;
  1147. d__1 = -z2 * z3 * z4 * sin(phi[i__ - 1]);
  1148. z__1.r = d__1, z__1.i = 0.;
  1149. zaxpy_(&i__2, &z__1, &x22[i__ - 1 + i__ * x22_dim1], ldx22, &
  1150. x21[i__ + i__ * x21_dim1], ldx21);
  1151. }
  1152. i__2 = *m - *p - i__ + 1;
  1153. i__3 = *p - i__ + 1;
  1154. theta[i__] = atan2(dznrm2_(&i__2, &x21[i__ + i__ * x21_dim1],
  1155. ldx21), dznrm2_(&i__3, &x11[i__ + i__ * x11_dim1], ldx11))
  1156. ;
  1157. i__2 = *p - i__ + 1;
  1158. zlacgv_(&i__2, &x11[i__ + i__ * x11_dim1], ldx11);
  1159. i__2 = *m - *p - i__ + 1;
  1160. zlacgv_(&i__2, &x21[i__ + i__ * x21_dim1], ldx21);
  1161. i__2 = *p - i__ + 1;
  1162. zlarfgp_(&i__2, &x11[i__ + i__ * x11_dim1], &x11[i__ + (i__ + 1) *
  1163. x11_dim1], ldx11, &taup1[i__]);
  1164. i__2 = i__ + i__ * x11_dim1;
  1165. x11[i__2].r = 1., x11[i__2].i = 0.;
  1166. if (i__ == *m - *p) {
  1167. i__2 = *m - *p - i__ + 1;
  1168. zlarfgp_(&i__2, &x21[i__ + i__ * x21_dim1], &x21[i__ + i__ *
  1169. x21_dim1], ldx21, &taup2[i__]);
  1170. } else {
  1171. i__2 = *m - *p - i__ + 1;
  1172. zlarfgp_(&i__2, &x21[i__ + i__ * x21_dim1], &x21[i__ + (i__ +
  1173. 1) * x21_dim1], ldx21, &taup2[i__]);
  1174. }
  1175. i__2 = i__ + i__ * x21_dim1;
  1176. x21[i__2].r = 1., x21[i__2].i = 0.;
  1177. i__2 = *q - i__;
  1178. i__3 = *p - i__ + 1;
  1179. zlarf_("R", &i__2, &i__3, &x11[i__ + i__ * x11_dim1], ldx11, &
  1180. taup1[i__], &x11[i__ + 1 + i__ * x11_dim1], ldx11, &work[
  1181. 1]);
  1182. i__2 = *m - *q - i__ + 1;
  1183. i__3 = *p - i__ + 1;
  1184. zlarf_("R", &i__2, &i__3, &x11[i__ + i__ * x11_dim1], ldx11, &
  1185. taup1[i__], &x12[i__ + i__ * x12_dim1], ldx12, &work[1]);
  1186. i__2 = *q - i__;
  1187. i__3 = *m - *p - i__ + 1;
  1188. zlarf_("R", &i__2, &i__3, &x21[i__ + i__ * x21_dim1], ldx21, &
  1189. taup2[i__], &x21[i__ + 1 + i__ * x21_dim1], ldx21, &work[
  1190. 1]);
  1191. i__2 = *m - *q - i__ + 1;
  1192. i__3 = *m - *p - i__ + 1;
  1193. zlarf_("R", &i__2, &i__3, &x21[i__ + i__ * x21_dim1], ldx21, &
  1194. taup2[i__], &x22[i__ + i__ * x22_dim1], ldx22, &work[1]);
  1195. i__2 = *p - i__ + 1;
  1196. zlacgv_(&i__2, &x11[i__ + i__ * x11_dim1], ldx11);
  1197. i__2 = *m - *p - i__ + 1;
  1198. zlacgv_(&i__2, &x21[i__ + i__ * x21_dim1], ldx21);
  1199. if (i__ < *q) {
  1200. i__2 = *q - i__;
  1201. d__1 = -z1 * z3 * sin(theta[i__]);
  1202. z__1.r = d__1, z__1.i = 0.;
  1203. zscal_(&i__2, &z__1, &x11[i__ + 1 + i__ * x11_dim1], &c__1);
  1204. i__2 = *q - i__;
  1205. d__1 = z2 * z3 * cos(theta[i__]);
  1206. z__1.r = d__1, z__1.i = 0.;
  1207. zaxpy_(&i__2, &z__1, &x21[i__ + 1 + i__ * x21_dim1], &c__1, &
  1208. x11[i__ + 1 + i__ * x11_dim1], &c__1);
  1209. }
  1210. i__2 = *m - *q - i__ + 1;
  1211. d__1 = -z1 * z4 * sin(theta[i__]);
  1212. z__1.r = d__1, z__1.i = 0.;
  1213. zscal_(&i__2, &z__1, &x12[i__ + i__ * x12_dim1], &c__1);
  1214. i__2 = *m - *q - i__ + 1;
  1215. d__1 = z2 * z4 * cos(theta[i__]);
  1216. z__1.r = d__1, z__1.i = 0.;
  1217. zaxpy_(&i__2, &z__1, &x22[i__ + i__ * x22_dim1], &c__1, &x12[i__
  1218. + i__ * x12_dim1], &c__1);
  1219. if (i__ < *q) {
  1220. i__2 = *q - i__;
  1221. i__3 = *m - *q - i__ + 1;
  1222. phi[i__] = atan2(dznrm2_(&i__2, &x11[i__ + 1 + i__ * x11_dim1]
  1223. , &c__1), dznrm2_(&i__3, &x12[i__ + i__ * x12_dim1], &
  1224. c__1));
  1225. }
  1226. if (i__ < *q) {
  1227. i__2 = *q - i__;
  1228. zlarfgp_(&i__2, &x11[i__ + 1 + i__ * x11_dim1], &x11[i__ + 2
  1229. + i__ * x11_dim1], &c__1, &tauq1[i__]);
  1230. i__2 = i__ + 1 + i__ * x11_dim1;
  1231. x11[i__2].r = 1., x11[i__2].i = 0.;
  1232. }
  1233. i__2 = *m - *q - i__ + 1;
  1234. zlarfgp_(&i__2, &x12[i__ + i__ * x12_dim1], &x12[i__ + 1 + i__ *
  1235. x12_dim1], &c__1, &tauq2[i__]);
  1236. i__2 = i__ + i__ * x12_dim1;
  1237. x12[i__2].r = 1., x12[i__2].i = 0.;
  1238. if (i__ < *q) {
  1239. i__2 = *q - i__;
  1240. i__3 = *p - i__;
  1241. d_cnjg(&z__1, &tauq1[i__]);
  1242. zlarf_("L", &i__2, &i__3, &x11[i__ + 1 + i__ * x11_dim1], &
  1243. c__1, &z__1, &x11[i__ + 1 + (i__ + 1) * x11_dim1],
  1244. ldx11, &work[1]);
  1245. i__2 = *q - i__;
  1246. i__3 = *m - *p - i__;
  1247. d_cnjg(&z__1, &tauq1[i__]);
  1248. zlarf_("L", &i__2, &i__3, &x11[i__ + 1 + i__ * x11_dim1], &
  1249. c__1, &z__1, &x21[i__ + 1 + (i__ + 1) * x21_dim1],
  1250. ldx21, &work[1]);
  1251. }
  1252. i__2 = *m - *q - i__ + 1;
  1253. i__3 = *p - i__;
  1254. d_cnjg(&z__1, &tauq2[i__]);
  1255. zlarf_("L", &i__2, &i__3, &x12[i__ + i__ * x12_dim1], &c__1, &
  1256. z__1, &x12[i__ + (i__ + 1) * x12_dim1], ldx12, &work[1]);
  1257. if (*m - *p > i__) {
  1258. i__2 = *m - *q - i__ + 1;
  1259. i__3 = *m - *p - i__;
  1260. d_cnjg(&z__1, &tauq2[i__]);
  1261. zlarf_("L", &i__2, &i__3, &x12[i__ + i__ * x12_dim1], &c__1, &
  1262. z__1, &x22[i__ + (i__ + 1) * x22_dim1], ldx22, &work[
  1263. 1]);
  1264. }
  1265. }
  1266. /* Reduce columns Q + 1, ..., P of X12, X22 */
  1267. i__1 = *p;
  1268. for (i__ = *q + 1; i__ <= i__1; ++i__) {
  1269. i__2 = *m - *q - i__ + 1;
  1270. d__1 = -z1 * z4;
  1271. z__1.r = d__1, z__1.i = 0.;
  1272. zscal_(&i__2, &z__1, &x12[i__ + i__ * x12_dim1], &c__1);
  1273. i__2 = *m - *q - i__ + 1;
  1274. zlarfgp_(&i__2, &x12[i__ + i__ * x12_dim1], &x12[i__ + 1 + i__ *
  1275. x12_dim1], &c__1, &tauq2[i__]);
  1276. i__2 = i__ + i__ * x12_dim1;
  1277. x12[i__2].r = 1., x12[i__2].i = 0.;
  1278. if (*p > i__) {
  1279. i__2 = *m - *q - i__ + 1;
  1280. i__3 = *p - i__;
  1281. d_cnjg(&z__1, &tauq2[i__]);
  1282. zlarf_("L", &i__2, &i__3, &x12[i__ + i__ * x12_dim1], &c__1, &
  1283. z__1, &x12[i__ + (i__ + 1) * x12_dim1], ldx12, &work[
  1284. 1]);
  1285. }
  1286. if (*m - *p - *q >= 1) {
  1287. i__2 = *m - *q - i__ + 1;
  1288. i__3 = *m - *p - *q;
  1289. d_cnjg(&z__1, &tauq2[i__]);
  1290. zlarf_("L", &i__2, &i__3, &x12[i__ + i__ * x12_dim1], &c__1, &
  1291. z__1, &x22[i__ + (*q + 1) * x22_dim1], ldx22, &work[1]
  1292. );
  1293. }
  1294. }
  1295. /* Reduce columns P + 1, ..., M - Q of X12, X22 */
  1296. i__1 = *m - *p - *q;
  1297. for (i__ = 1; i__ <= i__1; ++i__) {
  1298. i__2 = *m - *p - *q - i__ + 1;
  1299. d__1 = z2 * z4;
  1300. z__1.r = d__1, z__1.i = 0.;
  1301. zscal_(&i__2, &z__1, &x22[*p + i__ + (*q + i__) * x22_dim1], &
  1302. c__1);
  1303. i__2 = *m - *p - *q - i__ + 1;
  1304. zlarfgp_(&i__2, &x22[*p + i__ + (*q + i__) * x22_dim1], &x22[*p +
  1305. i__ + 1 + (*q + i__) * x22_dim1], &c__1, &tauq2[*p + i__])
  1306. ;
  1307. i__2 = *p + i__ + (*q + i__) * x22_dim1;
  1308. x22[i__2].r = 1., x22[i__2].i = 0.;
  1309. if (*m - *p - *q != i__) {
  1310. i__2 = *m - *p - *q - i__ + 1;
  1311. i__3 = *m - *p - *q - i__;
  1312. d_cnjg(&z__1, &tauq2[*p + i__]);
  1313. zlarf_("L", &i__2, &i__3, &x22[*p + i__ + (*q + i__) *
  1314. x22_dim1], &c__1, &z__1, &x22[*p + i__ + (*q + i__ +
  1315. 1) * x22_dim1], ldx22, &work[1]);
  1316. }
  1317. }
  1318. }
  1319. return;
  1320. /* End of ZUNBDB */
  1321. } /* zunbdb_ */