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.

slarfx.c 33 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287
  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]/df(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 SLARFX applies an elementary reflector to a general rectangular matrix, with loop unrolling whe
  486. n the reflector has order ≤ 10. */
  487. /* =========== DOCUMENTATION =========== */
  488. /* Online html documentation available at */
  489. /* http://www.netlib.org/lapack/explore-html/ */
  490. /* > \htmlonly */
  491. /* > Download SLARFX + dependencies */
  492. /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/slarfx.
  493. f"> */
  494. /* > [TGZ]</a> */
  495. /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/slarfx.
  496. f"> */
  497. /* > [ZIP]</a> */
  498. /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/slarfx.
  499. f"> */
  500. /* > [TXT]</a> */
  501. /* > \endhtmlonly */
  502. /* Definition: */
  503. /* =========== */
  504. /* SUBROUTINE SLARFX( SIDE, M, N, V, TAU, C, LDC, WORK ) */
  505. /* CHARACTER SIDE */
  506. /* INTEGER LDC, M, N */
  507. /* REAL TAU */
  508. /* REAL C( LDC, * ), V( * ), WORK( * ) */
  509. /* > \par Purpose: */
  510. /* ============= */
  511. /* > */
  512. /* > \verbatim */
  513. /* > */
  514. /* > SLARFX applies a real elementary reflector H to a real m by n */
  515. /* > matrix C, from either the left or the right. H is represented in the */
  516. /* > form */
  517. /* > */
  518. /* > H = I - tau * v * v**T */
  519. /* > */
  520. /* > where tau is a real scalar and v is a real vector. */
  521. /* > */
  522. /* > If tau = 0, then H is taken to be the unit matrix */
  523. /* > */
  524. /* > This version uses inline code if H has order < 11. */
  525. /* > \endverbatim */
  526. /* Arguments: */
  527. /* ========== */
  528. /* > \param[in] SIDE */
  529. /* > \verbatim */
  530. /* > SIDE is CHARACTER*1 */
  531. /* > = 'L': form H * C */
  532. /* > = 'R': form C * H */
  533. /* > \endverbatim */
  534. /* > */
  535. /* > \param[in] M */
  536. /* > \verbatim */
  537. /* > M is INTEGER */
  538. /* > The number of rows of the matrix C. */
  539. /* > \endverbatim */
  540. /* > */
  541. /* > \param[in] N */
  542. /* > \verbatim */
  543. /* > N is INTEGER */
  544. /* > The number of columns of the matrix C. */
  545. /* > \endverbatim */
  546. /* > */
  547. /* > \param[in] V */
  548. /* > \verbatim */
  549. /* > V is REAL array, dimension (M) if SIDE = 'L' */
  550. /* > or (N) if SIDE = 'R' */
  551. /* > The vector v in the representation of H. */
  552. /* > \endverbatim */
  553. /* > */
  554. /* > \param[in] TAU */
  555. /* > \verbatim */
  556. /* > TAU is REAL */
  557. /* > The value tau in the representation of H. */
  558. /* > \endverbatim */
  559. /* > */
  560. /* > \param[in,out] C */
  561. /* > \verbatim */
  562. /* > C is REAL array, dimension (LDC,N) */
  563. /* > On entry, the m by n matrix C. */
  564. /* > On exit, C is overwritten by the matrix H * C if SIDE = 'L', */
  565. /* > or C * H if SIDE = 'R'. */
  566. /* > \endverbatim */
  567. /* > */
  568. /* > \param[in] LDC */
  569. /* > \verbatim */
  570. /* > LDC is INTEGER */
  571. /* > The leading dimension of the array C. LDC >= (1,M). */
  572. /* > \endverbatim */
  573. /* > */
  574. /* > \param[out] WORK */
  575. /* > \verbatim */
  576. /* > WORK is REAL array, dimension */
  577. /* > (N) if SIDE = 'L' */
  578. /* > or (M) if SIDE = 'R' */
  579. /* > WORK is not referenced if H has order < 11. */
  580. /* > \endverbatim */
  581. /* Authors: */
  582. /* ======== */
  583. /* > \author Univ. of Tennessee */
  584. /* > \author Univ. of California Berkeley */
  585. /* > \author Univ. of Colorado Denver */
  586. /* > \author NAG Ltd. */
  587. /* > \date December 2016 */
  588. /* > \ingroup realOTHERauxiliary */
  589. /* ===================================================================== */
  590. /* Subroutine */ void slarfx_(char *side, integer *m, integer *n, real *v,
  591. real *tau, real *c__, integer *ldc, real *work)
  592. {
  593. /* System generated locals */
  594. integer c_dim1, c_offset, i__1;
  595. /* Local variables */
  596. integer j;
  597. extern logical lsame_(char *, char *);
  598. extern /* Subroutine */ void slarf_(char *, integer *, integer *, real *,
  599. integer *, real *, real *, integer *, real *);
  600. real t1, t2, t3, t4, t5, t6, t7, t8, t9, v1, v2, v3, v4, v5, v6, v7, v8,
  601. v9, t10, v10, sum;
  602. /* -- LAPACK auxiliary routine (version 3.7.0) -- */
  603. /* -- LAPACK is a software package provided by Univ. of Tennessee, -- */
  604. /* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- */
  605. /* December 2016 */
  606. /* ===================================================================== */
  607. /* Parameter adjustments */
  608. --v;
  609. c_dim1 = *ldc;
  610. c_offset = 1 + c_dim1 * 1;
  611. c__ -= c_offset;
  612. --work;
  613. /* Function Body */
  614. if (*tau == 0.f) {
  615. return;
  616. }
  617. if (lsame_(side, "L")) {
  618. /* Form H * C, where H has order m. */
  619. switch (*m) {
  620. case 1: goto L10;
  621. case 2: goto L30;
  622. case 3: goto L50;
  623. case 4: goto L70;
  624. case 5: goto L90;
  625. case 6: goto L110;
  626. case 7: goto L130;
  627. case 8: goto L150;
  628. case 9: goto L170;
  629. case 10: goto L190;
  630. }
  631. /* Code for general M */
  632. slarf_(side, m, n, &v[1], &c__1, tau, &c__[c_offset], ldc, &work[1]);
  633. goto L410;
  634. L10:
  635. /* Special code for 1 x 1 Householder */
  636. t1 = 1.f - *tau * v[1] * v[1];
  637. i__1 = *n;
  638. for (j = 1; j <= i__1; ++j) {
  639. c__[j * c_dim1 + 1] = t1 * c__[j * c_dim1 + 1];
  640. /* L20: */
  641. }
  642. goto L410;
  643. L30:
  644. /* Special code for 2 x 2 Householder */
  645. v1 = v[1];
  646. t1 = *tau * v1;
  647. v2 = v[2];
  648. t2 = *tau * v2;
  649. i__1 = *n;
  650. for (j = 1; j <= i__1; ++j) {
  651. sum = v1 * c__[j * c_dim1 + 1] + v2 * c__[j * c_dim1 + 2];
  652. c__[j * c_dim1 + 1] -= sum * t1;
  653. c__[j * c_dim1 + 2] -= sum * t2;
  654. /* L40: */
  655. }
  656. goto L410;
  657. L50:
  658. /* Special code for 3 x 3 Householder */
  659. v1 = v[1];
  660. t1 = *tau * v1;
  661. v2 = v[2];
  662. t2 = *tau * v2;
  663. v3 = v[3];
  664. t3 = *tau * v3;
  665. i__1 = *n;
  666. for (j = 1; j <= i__1; ++j) {
  667. sum = v1 * c__[j * c_dim1 + 1] + v2 * c__[j * c_dim1 + 2] + v3 *
  668. c__[j * c_dim1 + 3];
  669. c__[j * c_dim1 + 1] -= sum * t1;
  670. c__[j * c_dim1 + 2] -= sum * t2;
  671. c__[j * c_dim1 + 3] -= sum * t3;
  672. /* L60: */
  673. }
  674. goto L410;
  675. L70:
  676. /* Special code for 4 x 4 Householder */
  677. v1 = v[1];
  678. t1 = *tau * v1;
  679. v2 = v[2];
  680. t2 = *tau * v2;
  681. v3 = v[3];
  682. t3 = *tau * v3;
  683. v4 = v[4];
  684. t4 = *tau * v4;
  685. i__1 = *n;
  686. for (j = 1; j <= i__1; ++j) {
  687. sum = v1 * c__[j * c_dim1 + 1] + v2 * c__[j * c_dim1 + 2] + v3 *
  688. c__[j * c_dim1 + 3] + v4 * c__[j * c_dim1 + 4];
  689. c__[j * c_dim1 + 1] -= sum * t1;
  690. c__[j * c_dim1 + 2] -= sum * t2;
  691. c__[j * c_dim1 + 3] -= sum * t3;
  692. c__[j * c_dim1 + 4] -= sum * t4;
  693. /* L80: */
  694. }
  695. goto L410;
  696. L90:
  697. /* Special code for 5 x 5 Householder */
  698. v1 = v[1];
  699. t1 = *tau * v1;
  700. v2 = v[2];
  701. t2 = *tau * v2;
  702. v3 = v[3];
  703. t3 = *tau * v3;
  704. v4 = v[4];
  705. t4 = *tau * v4;
  706. v5 = v[5];
  707. t5 = *tau * v5;
  708. i__1 = *n;
  709. for (j = 1; j <= i__1; ++j) {
  710. sum = v1 * c__[j * c_dim1 + 1] + v2 * c__[j * c_dim1 + 2] + v3 *
  711. c__[j * c_dim1 + 3] + v4 * c__[j * c_dim1 + 4] + v5 * c__[
  712. j * c_dim1 + 5];
  713. c__[j * c_dim1 + 1] -= sum * t1;
  714. c__[j * c_dim1 + 2] -= sum * t2;
  715. c__[j * c_dim1 + 3] -= sum * t3;
  716. c__[j * c_dim1 + 4] -= sum * t4;
  717. c__[j * c_dim1 + 5] -= sum * t5;
  718. /* L100: */
  719. }
  720. goto L410;
  721. L110:
  722. /* Special code for 6 x 6 Householder */
  723. v1 = v[1];
  724. t1 = *tau * v1;
  725. v2 = v[2];
  726. t2 = *tau * v2;
  727. v3 = v[3];
  728. t3 = *tau * v3;
  729. v4 = v[4];
  730. t4 = *tau * v4;
  731. v5 = v[5];
  732. t5 = *tau * v5;
  733. v6 = v[6];
  734. t6 = *tau * v6;
  735. i__1 = *n;
  736. for (j = 1; j <= i__1; ++j) {
  737. sum = v1 * c__[j * c_dim1 + 1] + v2 * c__[j * c_dim1 + 2] + v3 *
  738. c__[j * c_dim1 + 3] + v4 * c__[j * c_dim1 + 4] + v5 * c__[
  739. j * c_dim1 + 5] + v6 * c__[j * c_dim1 + 6];
  740. c__[j * c_dim1 + 1] -= sum * t1;
  741. c__[j * c_dim1 + 2] -= sum * t2;
  742. c__[j * c_dim1 + 3] -= sum * t3;
  743. c__[j * c_dim1 + 4] -= sum * t4;
  744. c__[j * c_dim1 + 5] -= sum * t5;
  745. c__[j * c_dim1 + 6] -= sum * t6;
  746. /* L120: */
  747. }
  748. goto L410;
  749. L130:
  750. /* Special code for 7 x 7 Householder */
  751. v1 = v[1];
  752. t1 = *tau * v1;
  753. v2 = v[2];
  754. t2 = *tau * v2;
  755. v3 = v[3];
  756. t3 = *tau * v3;
  757. v4 = v[4];
  758. t4 = *tau * v4;
  759. v5 = v[5];
  760. t5 = *tau * v5;
  761. v6 = v[6];
  762. t6 = *tau * v6;
  763. v7 = v[7];
  764. t7 = *tau * v7;
  765. i__1 = *n;
  766. for (j = 1; j <= i__1; ++j) {
  767. sum = v1 * c__[j * c_dim1 + 1] + v2 * c__[j * c_dim1 + 2] + v3 *
  768. c__[j * c_dim1 + 3] + v4 * c__[j * c_dim1 + 4] + v5 * c__[
  769. j * c_dim1 + 5] + v6 * c__[j * c_dim1 + 6] + v7 * c__[j *
  770. c_dim1 + 7];
  771. c__[j * c_dim1 + 1] -= sum * t1;
  772. c__[j * c_dim1 + 2] -= sum * t2;
  773. c__[j * c_dim1 + 3] -= sum * t3;
  774. c__[j * c_dim1 + 4] -= sum * t4;
  775. c__[j * c_dim1 + 5] -= sum * t5;
  776. c__[j * c_dim1 + 6] -= sum * t6;
  777. c__[j * c_dim1 + 7] -= sum * t7;
  778. /* L140: */
  779. }
  780. goto L410;
  781. L150:
  782. /* Special code for 8 x 8 Householder */
  783. v1 = v[1];
  784. t1 = *tau * v1;
  785. v2 = v[2];
  786. t2 = *tau * v2;
  787. v3 = v[3];
  788. t3 = *tau * v3;
  789. v4 = v[4];
  790. t4 = *tau * v4;
  791. v5 = v[5];
  792. t5 = *tau * v5;
  793. v6 = v[6];
  794. t6 = *tau * v6;
  795. v7 = v[7];
  796. t7 = *tau * v7;
  797. v8 = v[8];
  798. t8 = *tau * v8;
  799. i__1 = *n;
  800. for (j = 1; j <= i__1; ++j) {
  801. sum = v1 * c__[j * c_dim1 + 1] + v2 * c__[j * c_dim1 + 2] + v3 *
  802. c__[j * c_dim1 + 3] + v4 * c__[j * c_dim1 + 4] + v5 * c__[
  803. j * c_dim1 + 5] + v6 * c__[j * c_dim1 + 6] + v7 * c__[j *
  804. c_dim1 + 7] + v8 * c__[j * c_dim1 + 8];
  805. c__[j * c_dim1 + 1] -= sum * t1;
  806. c__[j * c_dim1 + 2] -= sum * t2;
  807. c__[j * c_dim1 + 3] -= sum * t3;
  808. c__[j * c_dim1 + 4] -= sum * t4;
  809. c__[j * c_dim1 + 5] -= sum * t5;
  810. c__[j * c_dim1 + 6] -= sum * t6;
  811. c__[j * c_dim1 + 7] -= sum * t7;
  812. c__[j * c_dim1 + 8] -= sum * t8;
  813. /* L160: */
  814. }
  815. goto L410;
  816. L170:
  817. /* Special code for 9 x 9 Householder */
  818. v1 = v[1];
  819. t1 = *tau * v1;
  820. v2 = v[2];
  821. t2 = *tau * v2;
  822. v3 = v[3];
  823. t3 = *tau * v3;
  824. v4 = v[4];
  825. t4 = *tau * v4;
  826. v5 = v[5];
  827. t5 = *tau * v5;
  828. v6 = v[6];
  829. t6 = *tau * v6;
  830. v7 = v[7];
  831. t7 = *tau * v7;
  832. v8 = v[8];
  833. t8 = *tau * v8;
  834. v9 = v[9];
  835. t9 = *tau * v9;
  836. i__1 = *n;
  837. for (j = 1; j <= i__1; ++j) {
  838. sum = v1 * c__[j * c_dim1 + 1] + v2 * c__[j * c_dim1 + 2] + v3 *
  839. c__[j * c_dim1 + 3] + v4 * c__[j * c_dim1 + 4] + v5 * c__[
  840. j * c_dim1 + 5] + v6 * c__[j * c_dim1 + 6] + v7 * c__[j *
  841. c_dim1 + 7] + v8 * c__[j * c_dim1 + 8] + v9 * c__[j *
  842. c_dim1 + 9];
  843. c__[j * c_dim1 + 1] -= sum * t1;
  844. c__[j * c_dim1 + 2] -= sum * t2;
  845. c__[j * c_dim1 + 3] -= sum * t3;
  846. c__[j * c_dim1 + 4] -= sum * t4;
  847. c__[j * c_dim1 + 5] -= sum * t5;
  848. c__[j * c_dim1 + 6] -= sum * t6;
  849. c__[j * c_dim1 + 7] -= sum * t7;
  850. c__[j * c_dim1 + 8] -= sum * t8;
  851. c__[j * c_dim1 + 9] -= sum * t9;
  852. /* L180: */
  853. }
  854. goto L410;
  855. L190:
  856. /* Special code for 10 x 10 Householder */
  857. v1 = v[1];
  858. t1 = *tau * v1;
  859. v2 = v[2];
  860. t2 = *tau * v2;
  861. v3 = v[3];
  862. t3 = *tau * v3;
  863. v4 = v[4];
  864. t4 = *tau * v4;
  865. v5 = v[5];
  866. t5 = *tau * v5;
  867. v6 = v[6];
  868. t6 = *tau * v6;
  869. v7 = v[7];
  870. t7 = *tau * v7;
  871. v8 = v[8];
  872. t8 = *tau * v8;
  873. v9 = v[9];
  874. t9 = *tau * v9;
  875. v10 = v[10];
  876. t10 = *tau * v10;
  877. i__1 = *n;
  878. for (j = 1; j <= i__1; ++j) {
  879. sum = v1 * c__[j * c_dim1 + 1] + v2 * c__[j * c_dim1 + 2] + v3 *
  880. c__[j * c_dim1 + 3] + v4 * c__[j * c_dim1 + 4] + v5 * c__[
  881. j * c_dim1 + 5] + v6 * c__[j * c_dim1 + 6] + v7 * c__[j *
  882. c_dim1 + 7] + v8 * c__[j * c_dim1 + 8] + v9 * c__[j *
  883. c_dim1 + 9] + v10 * c__[j * c_dim1 + 10];
  884. c__[j * c_dim1 + 1] -= sum * t1;
  885. c__[j * c_dim1 + 2] -= sum * t2;
  886. c__[j * c_dim1 + 3] -= sum * t3;
  887. c__[j * c_dim1 + 4] -= sum * t4;
  888. c__[j * c_dim1 + 5] -= sum * t5;
  889. c__[j * c_dim1 + 6] -= sum * t6;
  890. c__[j * c_dim1 + 7] -= sum * t7;
  891. c__[j * c_dim1 + 8] -= sum * t8;
  892. c__[j * c_dim1 + 9] -= sum * t9;
  893. c__[j * c_dim1 + 10] -= sum * t10;
  894. /* L200: */
  895. }
  896. goto L410;
  897. } else {
  898. /* Form C * H, where H has order n. */
  899. switch (*n) {
  900. case 1: goto L210;
  901. case 2: goto L230;
  902. case 3: goto L250;
  903. case 4: goto L270;
  904. case 5: goto L290;
  905. case 6: goto L310;
  906. case 7: goto L330;
  907. case 8: goto L350;
  908. case 9: goto L370;
  909. case 10: goto L390;
  910. }
  911. /* Code for general N */
  912. slarf_(side, m, n, &v[1], &c__1, tau, &c__[c_offset], ldc, &work[1]);
  913. goto L410;
  914. L210:
  915. /* Special code for 1 x 1 Householder */
  916. t1 = 1.f - *tau * v[1] * v[1];
  917. i__1 = *m;
  918. for (j = 1; j <= i__1; ++j) {
  919. c__[j + c_dim1] = t1 * c__[j + c_dim1];
  920. /* L220: */
  921. }
  922. goto L410;
  923. L230:
  924. /* Special code for 2 x 2 Householder */
  925. v1 = v[1];
  926. t1 = *tau * v1;
  927. v2 = v[2];
  928. t2 = *tau * v2;
  929. i__1 = *m;
  930. for (j = 1; j <= i__1; ++j) {
  931. sum = v1 * c__[j + c_dim1] + v2 * c__[j + (c_dim1 << 1)];
  932. c__[j + c_dim1] -= sum * t1;
  933. c__[j + (c_dim1 << 1)] -= sum * t2;
  934. /* L240: */
  935. }
  936. goto L410;
  937. L250:
  938. /* Special code for 3 x 3 Householder */
  939. v1 = v[1];
  940. t1 = *tau * v1;
  941. v2 = v[2];
  942. t2 = *tau * v2;
  943. v3 = v[3];
  944. t3 = *tau * v3;
  945. i__1 = *m;
  946. for (j = 1; j <= i__1; ++j) {
  947. sum = v1 * c__[j + c_dim1] + v2 * c__[j + (c_dim1 << 1)] + v3 *
  948. c__[j + c_dim1 * 3];
  949. c__[j + c_dim1] -= sum * t1;
  950. c__[j + (c_dim1 << 1)] -= sum * t2;
  951. c__[j + c_dim1 * 3] -= sum * t3;
  952. /* L260: */
  953. }
  954. goto L410;
  955. L270:
  956. /* Special code for 4 x 4 Householder */
  957. v1 = v[1];
  958. t1 = *tau * v1;
  959. v2 = v[2];
  960. t2 = *tau * v2;
  961. v3 = v[3];
  962. t3 = *tau * v3;
  963. v4 = v[4];
  964. t4 = *tau * v4;
  965. i__1 = *m;
  966. for (j = 1; j <= i__1; ++j) {
  967. sum = v1 * c__[j + c_dim1] + v2 * c__[j + (c_dim1 << 1)] + v3 *
  968. c__[j + c_dim1 * 3] + v4 * c__[j + (c_dim1 << 2)];
  969. c__[j + c_dim1] -= sum * t1;
  970. c__[j + (c_dim1 << 1)] -= sum * t2;
  971. c__[j + c_dim1 * 3] -= sum * t3;
  972. c__[j + (c_dim1 << 2)] -= sum * t4;
  973. /* L280: */
  974. }
  975. goto L410;
  976. L290:
  977. /* Special code for 5 x 5 Householder */
  978. v1 = v[1];
  979. t1 = *tau * v1;
  980. v2 = v[2];
  981. t2 = *tau * v2;
  982. v3 = v[3];
  983. t3 = *tau * v3;
  984. v4 = v[4];
  985. t4 = *tau * v4;
  986. v5 = v[5];
  987. t5 = *tau * v5;
  988. i__1 = *m;
  989. for (j = 1; j <= i__1; ++j) {
  990. sum = v1 * c__[j + c_dim1] + v2 * c__[j + (c_dim1 << 1)] + v3 *
  991. c__[j + c_dim1 * 3] + v4 * c__[j + (c_dim1 << 2)] + v5 *
  992. c__[j + c_dim1 * 5];
  993. c__[j + c_dim1] -= sum * t1;
  994. c__[j + (c_dim1 << 1)] -= sum * t2;
  995. c__[j + c_dim1 * 3] -= sum * t3;
  996. c__[j + (c_dim1 << 2)] -= sum * t4;
  997. c__[j + c_dim1 * 5] -= sum * t5;
  998. /* L300: */
  999. }
  1000. goto L410;
  1001. L310:
  1002. /* Special code for 6 x 6 Householder */
  1003. v1 = v[1];
  1004. t1 = *tau * v1;
  1005. v2 = v[2];
  1006. t2 = *tau * v2;
  1007. v3 = v[3];
  1008. t3 = *tau * v3;
  1009. v4 = v[4];
  1010. t4 = *tau * v4;
  1011. v5 = v[5];
  1012. t5 = *tau * v5;
  1013. v6 = v[6];
  1014. t6 = *tau * v6;
  1015. i__1 = *m;
  1016. for (j = 1; j <= i__1; ++j) {
  1017. sum = v1 * c__[j + c_dim1] + v2 * c__[j + (c_dim1 << 1)] + v3 *
  1018. c__[j + c_dim1 * 3] + v4 * c__[j + (c_dim1 << 2)] + v5 *
  1019. c__[j + c_dim1 * 5] + v6 * c__[j + c_dim1 * 6];
  1020. c__[j + c_dim1] -= sum * t1;
  1021. c__[j + (c_dim1 << 1)] -= sum * t2;
  1022. c__[j + c_dim1 * 3] -= sum * t3;
  1023. c__[j + (c_dim1 << 2)] -= sum * t4;
  1024. c__[j + c_dim1 * 5] -= sum * t5;
  1025. c__[j + c_dim1 * 6] -= sum * t6;
  1026. /* L320: */
  1027. }
  1028. goto L410;
  1029. L330:
  1030. /* Special code for 7 x 7 Householder */
  1031. v1 = v[1];
  1032. t1 = *tau * v1;
  1033. v2 = v[2];
  1034. t2 = *tau * v2;
  1035. v3 = v[3];
  1036. t3 = *tau * v3;
  1037. v4 = v[4];
  1038. t4 = *tau * v4;
  1039. v5 = v[5];
  1040. t5 = *tau * v5;
  1041. v6 = v[6];
  1042. t6 = *tau * v6;
  1043. v7 = v[7];
  1044. t7 = *tau * v7;
  1045. i__1 = *m;
  1046. for (j = 1; j <= i__1; ++j) {
  1047. sum = v1 * c__[j + c_dim1] + v2 * c__[j + (c_dim1 << 1)] + v3 *
  1048. c__[j + c_dim1 * 3] + v4 * c__[j + (c_dim1 << 2)] + v5 *
  1049. c__[j + c_dim1 * 5] + v6 * c__[j + c_dim1 * 6] + v7 * c__[
  1050. j + c_dim1 * 7];
  1051. c__[j + c_dim1] -= sum * t1;
  1052. c__[j + (c_dim1 << 1)] -= sum * t2;
  1053. c__[j + c_dim1 * 3] -= sum * t3;
  1054. c__[j + (c_dim1 << 2)] -= sum * t4;
  1055. c__[j + c_dim1 * 5] -= sum * t5;
  1056. c__[j + c_dim1 * 6] -= sum * t6;
  1057. c__[j + c_dim1 * 7] -= sum * t7;
  1058. /* L340: */
  1059. }
  1060. goto L410;
  1061. L350:
  1062. /* Special code for 8 x 8 Householder */
  1063. v1 = v[1];
  1064. t1 = *tau * v1;
  1065. v2 = v[2];
  1066. t2 = *tau * v2;
  1067. v3 = v[3];
  1068. t3 = *tau * v3;
  1069. v4 = v[4];
  1070. t4 = *tau * v4;
  1071. v5 = v[5];
  1072. t5 = *tau * v5;
  1073. v6 = v[6];
  1074. t6 = *tau * v6;
  1075. v7 = v[7];
  1076. t7 = *tau * v7;
  1077. v8 = v[8];
  1078. t8 = *tau * v8;
  1079. i__1 = *m;
  1080. for (j = 1; j <= i__1; ++j) {
  1081. sum = v1 * c__[j + c_dim1] + v2 * c__[j + (c_dim1 << 1)] + v3 *
  1082. c__[j + c_dim1 * 3] + v4 * c__[j + (c_dim1 << 2)] + v5 *
  1083. c__[j + c_dim1 * 5] + v6 * c__[j + c_dim1 * 6] + v7 * c__[
  1084. j + c_dim1 * 7] + v8 * c__[j + (c_dim1 << 3)];
  1085. c__[j + c_dim1] -= sum * t1;
  1086. c__[j + (c_dim1 << 1)] -= sum * t2;
  1087. c__[j + c_dim1 * 3] -= sum * t3;
  1088. c__[j + (c_dim1 << 2)] -= sum * t4;
  1089. c__[j + c_dim1 * 5] -= sum * t5;
  1090. c__[j + c_dim1 * 6] -= sum * t6;
  1091. c__[j + c_dim1 * 7] -= sum * t7;
  1092. c__[j + (c_dim1 << 3)] -= sum * t8;
  1093. /* L360: */
  1094. }
  1095. goto L410;
  1096. L370:
  1097. /* Special code for 9 x 9 Householder */
  1098. v1 = v[1];
  1099. t1 = *tau * v1;
  1100. v2 = v[2];
  1101. t2 = *tau * v2;
  1102. v3 = v[3];
  1103. t3 = *tau * v3;
  1104. v4 = v[4];
  1105. t4 = *tau * v4;
  1106. v5 = v[5];
  1107. t5 = *tau * v5;
  1108. v6 = v[6];
  1109. t6 = *tau * v6;
  1110. v7 = v[7];
  1111. t7 = *tau * v7;
  1112. v8 = v[8];
  1113. t8 = *tau * v8;
  1114. v9 = v[9];
  1115. t9 = *tau * v9;
  1116. i__1 = *m;
  1117. for (j = 1; j <= i__1; ++j) {
  1118. sum = v1 * c__[j + c_dim1] + v2 * c__[j + (c_dim1 << 1)] + v3 *
  1119. c__[j + c_dim1 * 3] + v4 * c__[j + (c_dim1 << 2)] + v5 *
  1120. c__[j + c_dim1 * 5] + v6 * c__[j + c_dim1 * 6] + v7 * c__[
  1121. j + c_dim1 * 7] + v8 * c__[j + (c_dim1 << 3)] + v9 * c__[
  1122. j + c_dim1 * 9];
  1123. c__[j + c_dim1] -= sum * t1;
  1124. c__[j + (c_dim1 << 1)] -= sum * t2;
  1125. c__[j + c_dim1 * 3] -= sum * t3;
  1126. c__[j + (c_dim1 << 2)] -= sum * t4;
  1127. c__[j + c_dim1 * 5] -= sum * t5;
  1128. c__[j + c_dim1 * 6] -= sum * t6;
  1129. c__[j + c_dim1 * 7] -= sum * t7;
  1130. c__[j + (c_dim1 << 3)] -= sum * t8;
  1131. c__[j + c_dim1 * 9] -= sum * t9;
  1132. /* L380: */
  1133. }
  1134. goto L410;
  1135. L390:
  1136. /* Special code for 10 x 10 Householder */
  1137. v1 = v[1];
  1138. t1 = *tau * v1;
  1139. v2 = v[2];
  1140. t2 = *tau * v2;
  1141. v3 = v[3];
  1142. t3 = *tau * v3;
  1143. v4 = v[4];
  1144. t4 = *tau * v4;
  1145. v5 = v[5];
  1146. t5 = *tau * v5;
  1147. v6 = v[6];
  1148. t6 = *tau * v6;
  1149. v7 = v[7];
  1150. t7 = *tau * v7;
  1151. v8 = v[8];
  1152. t8 = *tau * v8;
  1153. v9 = v[9];
  1154. t9 = *tau * v9;
  1155. v10 = v[10];
  1156. t10 = *tau * v10;
  1157. i__1 = *m;
  1158. for (j = 1; j <= i__1; ++j) {
  1159. sum = v1 * c__[j + c_dim1] + v2 * c__[j + (c_dim1 << 1)] + v3 *
  1160. c__[j + c_dim1 * 3] + v4 * c__[j + (c_dim1 << 2)] + v5 *
  1161. c__[j + c_dim1 * 5] + v6 * c__[j + c_dim1 * 6] + v7 * c__[
  1162. j + c_dim1 * 7] + v8 * c__[j + (c_dim1 << 3)] + v9 * c__[
  1163. j + c_dim1 * 9] + v10 * c__[j + c_dim1 * 10];
  1164. c__[j + c_dim1] -= sum * t1;
  1165. c__[j + (c_dim1 << 1)] -= sum * t2;
  1166. c__[j + c_dim1 * 3] -= sum * t3;
  1167. c__[j + (c_dim1 << 2)] -= sum * t4;
  1168. c__[j + c_dim1 * 5] -= sum * t5;
  1169. c__[j + c_dim1 * 6] -= sum * t6;
  1170. c__[j + c_dim1 * 7] -= sum * t7;
  1171. c__[j + (c_dim1 << 3)] -= sum * t8;
  1172. c__[j + c_dim1 * 9] -= sum * t9;
  1173. c__[j + c_dim1 * 10] -= sum * t10;
  1174. /* L400: */
  1175. }
  1176. goto L410;
  1177. }
  1178. L410:
  1179. return;
  1180. /* End of SLARFX */
  1181. } /* slarfx_ */