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.

ilaenv.c 38 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347
  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. /* -- translated by f2c (version 20000121).
  484. You must link the resulting object file with the libraries:
  485. -lf2c -lm (in that order)
  486. */
  487. /* Table of constant values */
  488. static integer c__1 = 1;
  489. static real c_b179 = 0.f;
  490. static real c_b180 = 1.f;
  491. static integer c__0 = 0;
  492. /* > \brief \b ILAENV */
  493. /* =========== DOCUMENTATION =========== */
  494. /* Online html documentation available at */
  495. /* http://www.netlib.org/lapack/explore-html/ */
  496. /* > \htmlonly */
  497. /* > Download ILAENV + dependencies */
  498. /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/ilaenv.
  499. f"> */
  500. /* > [TGZ]</a> */
  501. /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/ilaenv.
  502. f"> */
  503. /* > [ZIP]</a> */
  504. /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ilaenv.
  505. f"> */
  506. /* > [TXT]</a> */
  507. /* > \endhtmlonly */
  508. /* Definition: */
  509. /* =========== */
  510. /* INTEGER FUNCTION ILAENV( ISPEC, NAME, OPTS, N1, N2, N3, N4 ) */
  511. /* CHARACTER*( * ) NAME, OPTS */
  512. /* INTEGER ISPEC, N1, N2, N3, N4 */
  513. /* > \par Purpose: */
  514. /* ============= */
  515. /* > */
  516. /* > \verbatim */
  517. /* > */
  518. /* > ILAENV is called from the LAPACK routines to choose problem-dependent */
  519. /* > parameters for the local environment. See ISPEC for a description of */
  520. /* > the parameters. */
  521. /* > */
  522. /* > ILAENV returns an INTEGER */
  523. /* > if ILAENV >= 0: ILAENV returns the value of the parameter specified by ISPEC */
  524. /* > if ILAENV < 0: if ILAENV = -k, the k-th argument had an illegal value. */
  525. /* > */
  526. /* > This version provides a set of parameters which should give good, */
  527. /* > but not optimal, performance on many of the currently available */
  528. /* > computers. Users are encouraged to modify this subroutine to set */
  529. /* > the tuning parameters for their particular machine using the option */
  530. /* > and problem size information in the arguments. */
  531. /* > */
  532. /* > This routine will not function correctly if it is converted to all */
  533. /* > lower case. Converting it to all upper case is allowed. */
  534. /* > \endverbatim */
  535. /* Arguments: */
  536. /* ========== */
  537. /* > \param[in] ISPEC */
  538. /* > \verbatim */
  539. /* > ISPEC is INTEGER */
  540. /* > Specifies the parameter to be returned as the value of */
  541. /* > ILAENV. */
  542. /* > = 1: the optimal blocksize; if this value is 1, an unblocked */
  543. /* > algorithm will give the best performance. */
  544. /* > = 2: the minimum block size for which the block routine */
  545. /* > should be used; if the usable block size is less than */
  546. /* > this value, an unblocked routine should be used. */
  547. /* > = 3: the crossover point (in a block routine, for N less */
  548. /* > than this value, an unblocked routine should be used) */
  549. /* > = 4: the number of shifts, used in the nonsymmetric */
  550. /* > eigenvalue routines (DEPRECATED) */
  551. /* > = 5: the minimum column dimension for blocking to be used; */
  552. /* > rectangular blocks must have dimension at least k by m, */
  553. /* > where k is given by ILAENV(2,...) and m by ILAENV(5,...) */
  554. /* > = 6: the crossover point for the SVD (when reducing an m by n */
  555. /* > matrix to bidiagonal form, if f2cmax(m,n)/f2cmin(m,n) exceeds */
  556. /* > this value, a QR factorization is used first to reduce */
  557. /* > the matrix to a triangular form.) */
  558. /* > = 7: the number of processors */
  559. /* > = 8: the crossover point for the multishift QR method */
  560. /* > for nonsymmetric eigenvalue problems (DEPRECATED) */
  561. /* > = 9: maximum size of the subproblems at the bottom of the */
  562. /* > computation tree in the divide-and-conquer algorithm */
  563. /* > (used by xGELSD and xGESDD) */
  564. /* > =10: ieee infinity and NaN arithmetic can be trusted not to trap */
  565. /* > =11: infinity arithmetic can be trusted not to trap */
  566. /* > 12 <= ISPEC <= 17: */
  567. /* > xHSEQR or related subroutines, */
  568. /* > see IPARMQ for detailed explanation */
  569. /* > \endverbatim */
  570. /* > */
  571. /* > \param[in] NAME */
  572. /* > \verbatim */
  573. /* > NAME is CHARACTER*(*) */
  574. /* > The name of the calling subroutine, in either upper case or */
  575. /* > lower case. */
  576. /* > \endverbatim */
  577. /* > */
  578. /* > \param[in] OPTS */
  579. /* > \verbatim */
  580. /* > OPTS is CHARACTER*(*) */
  581. /* > The character options to the subroutine NAME, concatenated */
  582. /* > into a single character string. For example, UPLO = 'U', */
  583. /* > TRANS = 'T', and DIAG = 'N' for a triangular routine would */
  584. /* > be specified as OPTS = 'UTN'. */
  585. /* > \endverbatim */
  586. /* > */
  587. /* > \param[in] N1 */
  588. /* > \verbatim */
  589. /* > N1 is INTEGER */
  590. /* > \endverbatim */
  591. /* > */
  592. /* > \param[in] N2 */
  593. /* > \verbatim */
  594. /* > N2 is INTEGER */
  595. /* > \endverbatim */
  596. /* > */
  597. /* > \param[in] N3 */
  598. /* > \verbatim */
  599. /* > N3 is INTEGER */
  600. /* > \endverbatim */
  601. /* > */
  602. /* > \param[in] N4 */
  603. /* > \verbatim */
  604. /* > N4 is INTEGER */
  605. /* > Problem dimensions for the subroutine NAME; these may not all */
  606. /* > be required. */
  607. /* > \endverbatim */
  608. /* Authors: */
  609. /* ======== */
  610. /* > \author Univ. of Tennessee */
  611. /* > \author Univ. of California Berkeley */
  612. /* > \author Univ. of Colorado Denver */
  613. /* > \author NAG Ltd. */
  614. /* > \ingroup ilaenv */
  615. /* > \par Further Details: */
  616. /* ===================== */
  617. /* > */
  618. /* > \verbatim */
  619. /* > */
  620. /* > The following conventions have been used when calling ILAENV from the */
  621. /* > LAPACK routines: */
  622. /* > 1) OPTS is a concatenation of all of the character options to */
  623. /* > subroutine NAME, in the same order that they appear in the */
  624. /* > argument list for NAME, even if they are not used in determining */
  625. /* > the value of the parameter specified by ISPEC. */
  626. /* > 2) The problem dimensions N1, N2, N3, N4 are specified in the order */
  627. /* > that they appear in the argument list for NAME. N1 is used */
  628. /* > first, N2 second, and so on, and unused problem dimensions are */
  629. /* > passed a value of -1. */
  630. /* > 3) The parameter value returned by ILAENV is checked for validity in */
  631. /* > the calling subroutine. For example, ILAENV is used to retrieve */
  632. /* > the optimal blocksize for STRTRI as follows: */
  633. /* > */
  634. /* > NB = ILAENV( 1, 'STRTRI', UPLO // DIAG, N, -1, -1, -1 ) */
  635. /* > IF( NB.LE.1 ) NB = MAX( 1, N ) */
  636. /* > \endverbatim */
  637. /* > */
  638. /* ===================================================================== */
  639. integer ilaenv_(integer *ispec, char *name__, char *opts, integer *n1,
  640. integer *n2, integer *n3, integer *n4, ftnlen name_len, ftnlen
  641. opts_len)
  642. {
  643. /* System generated locals */
  644. integer ret_val, i__1, i__2, i__3;
  645. /* Local variables */
  646. logical twostage;
  647. integer i__;
  648. logical cname;
  649. integer nbmin;
  650. logical sname;
  651. char c1[1], c2[2], c3[3], c4[2];
  652. integer ic, nb;
  653. extern integer ieeeck_(integer *, real *, real *);
  654. integer iz, nx;
  655. char subnam[16];
  656. extern integer iparmq_(integer *, char *, char *, integer *, integer *,
  657. integer *, integer *);
  658. /* -- LAPACK auxiliary routine -- */
  659. /* -- LAPACK is a software package provided by Univ. of Tennessee, -- */
  660. /* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- */
  661. /* ===================================================================== */
  662. switch (*ispec) {
  663. case 1: goto L10;
  664. case 2: goto L10;
  665. case 3: goto L10;
  666. case 4: goto L80;
  667. case 5: goto L90;
  668. case 6: goto L100;
  669. case 7: goto L110;
  670. case 8: goto L120;
  671. case 9: goto L130;
  672. case 10: goto L140;
  673. case 11: goto L150;
  674. case 12: goto L160;
  675. case 13: goto L160;
  676. case 14: goto L160;
  677. case 15: goto L160;
  678. case 16: goto L160;
  679. case 17: goto L160;
  680. }
  681. /* Invalid value for ISPEC */
  682. ret_val = -1;
  683. return ret_val;
  684. L10:
  685. /* Convert NAME to upper case if the first character is lower case. */
  686. ret_val = 1;
  687. s_copy(subnam, name__, (ftnlen)16, name_len);
  688. ic = *(unsigned char *)subnam;
  689. iz = 'Z';
  690. if (iz == 90 || iz == 122) {
  691. /* ASCII character set */
  692. if (ic >= 97 && ic <= 122) {
  693. *(unsigned char *)subnam = (char) (ic - 32);
  694. for (i__ = 2; i__ <= 6; ++i__) {
  695. ic = *(unsigned char *)&subnam[i__ - 1];
  696. if (ic >= 97 && ic <= 122) {
  697. *(unsigned char *)&subnam[i__ - 1] = (char) (ic - 32);
  698. }
  699. /* L20: */
  700. }
  701. }
  702. } else if (iz == 233 || iz == 169) {
  703. /* EBCDIC character set */
  704. if (ic >= 129 && ic <= 137 || ic >= 145 && ic <= 153 || ic >= 162 &&
  705. ic <= 169) {
  706. *(unsigned char *)subnam = (char) (ic + 64);
  707. for (i__ = 2; i__ <= 6; ++i__) {
  708. ic = *(unsigned char *)&subnam[i__ - 1];
  709. if (ic >= 129 && ic <= 137 || ic >= 145 && ic <= 153 || ic >=
  710. 162 && ic <= 169) {
  711. *(unsigned char *)&subnam[i__ - 1] = (char) (ic + 64);
  712. }
  713. /* L30: */
  714. }
  715. }
  716. } else if (iz == 218 || iz == 250) {
  717. /* Prime machines: ASCII+128 */
  718. if (ic >= 225 && ic <= 250) {
  719. *(unsigned char *)subnam = (char) (ic - 32);
  720. for (i__ = 2; i__ <= 6; ++i__) {
  721. ic = *(unsigned char *)&subnam[i__ - 1];
  722. if (ic >= 225 && ic <= 250) {
  723. *(unsigned char *)&subnam[i__ - 1] = (char) (ic - 32);
  724. }
  725. /* L40: */
  726. }
  727. }
  728. }
  729. *(unsigned char *)c1 = *(unsigned char *)subnam;
  730. sname = *(unsigned char *)c1 == 'S' || *(unsigned char *)c1 == 'D';
  731. cname = *(unsigned char *)c1 == 'C' || *(unsigned char *)c1 == 'Z';
  732. if (! (cname || sname)) {
  733. return ret_val;
  734. }
  735. s_copy(c2, subnam + 1, (ftnlen)2, (ftnlen)2);
  736. s_copy(c3, subnam + 3, (ftnlen)3, (ftnlen)3);
  737. s_copy(c4, c3 + 1, (ftnlen)2, (ftnlen)2);
  738. twostage = i_len(subnam, (ftnlen)16) >= 11 && *(unsigned char *)&subnam[
  739. 10] == '2';
  740. switch (*ispec) {
  741. case 1: goto L50;
  742. case 2: goto L60;
  743. case 3: goto L70;
  744. }
  745. L50:
  746. /* ISPEC = 1: block size */
  747. /* In these examples, separate code is provided for setting NB for */
  748. /* real and complex. We assume that NB will take the same value in */
  749. /* single or double precision. */
  750. nb = 1;
  751. if (s_cmp(subnam + 1, "LAORH", (ftnlen)5, (ftnlen)5) == 0) {
  752. /* This is for *LAORHR_GETRFNP routine */
  753. if (sname) {
  754. nb = 32;
  755. } else {
  756. nb = 32;
  757. }
  758. } else if (s_cmp(c2, "GE", (ftnlen)2, (ftnlen)2) == 0) {
  759. if (s_cmp(c3, "TRF", (ftnlen)3, (ftnlen)3) == 0) {
  760. if (sname) {
  761. nb = 64;
  762. } else {
  763. nb = 64;
  764. }
  765. } else if (s_cmp(c3, "QRF", (ftnlen)3, (ftnlen)3) == 0 || s_cmp(c3,
  766. "RQF", (ftnlen)3, (ftnlen)3) == 0 || s_cmp(c3, "LQF", (ftnlen)
  767. 3, (ftnlen)3) == 0 || s_cmp(c3, "QLF", (ftnlen)3, (ftnlen)3)
  768. == 0) {
  769. if (sname) {
  770. nb = 32;
  771. } else {
  772. nb = 32;
  773. }
  774. } else if (s_cmp(c3, "QR ", (ftnlen)3, (ftnlen)3) == 0) {
  775. if (*n3 == 1) {
  776. if (sname) {
  777. /* M*N */
  778. if (*n1 * *n2 <= 131072 || *n1 <= 8192) {
  779. nb = *n1;
  780. } else {
  781. nb = 32768 / *n2;
  782. }
  783. } else {
  784. if (*n1 * *n2 <= 131072 || *n1 <= 8192) {
  785. nb = *n1;
  786. } else {
  787. nb = 32768 / *n2;
  788. }
  789. }
  790. } else {
  791. if (sname) {
  792. nb = 1;
  793. } else {
  794. nb = 1;
  795. }
  796. }
  797. } else if (s_cmp(c3, "LQ ", (ftnlen)3, (ftnlen)3) == 0) {
  798. if (*n3 == 2) {
  799. if (sname) {
  800. /* M*N */
  801. if (*n1 * *n2 <= 131072 || *n1 <= 8192) {
  802. nb = *n1;
  803. } else {
  804. nb = 32768 / *n2;
  805. }
  806. } else {
  807. if (*n1 * *n2 <= 131072 || *n1 <= 8192) {
  808. nb = *n1;
  809. } else {
  810. nb = 32768 / *n2;
  811. }
  812. }
  813. } else {
  814. if (sname) {
  815. nb = 1;
  816. } else {
  817. nb = 1;
  818. }
  819. }
  820. } else if (s_cmp(c3, "HRD", (ftnlen)3, (ftnlen)3) == 0) {
  821. if (sname) {
  822. nb = 32;
  823. } else {
  824. nb = 32;
  825. }
  826. } else if (s_cmp(c3, "BRD", (ftnlen)3, (ftnlen)3) == 0) {
  827. if (sname) {
  828. nb = 32;
  829. } else {
  830. nb = 32;
  831. }
  832. } else if (s_cmp(c3, "TRI", (ftnlen)3, (ftnlen)3) == 0) {
  833. if (sname) {
  834. nb = 64;
  835. } else {
  836. nb = 64;
  837. }
  838. } else if (s_cmp(subnam + 3, "QP3RK", (ftnlen)4, (ftnlen)5) == 0) {
  839. if (sname) {
  840. nb = 32;
  841. } else {
  842. nb = 32;
  843. }
  844. }
  845. } else if (s_cmp(c2, "PO", (ftnlen)2, (ftnlen)2) == 0) {
  846. if (s_cmp(c3, "TRF", (ftnlen)3, (ftnlen)3) == 0) {
  847. if (sname) {
  848. nb = 64;
  849. } else {
  850. nb = 64;
  851. }
  852. }
  853. } else if (s_cmp(c2, "SY", (ftnlen)2, (ftnlen)2) == 0) {
  854. if (s_cmp(c3, "TRF", (ftnlen)3, (ftnlen)3) == 0) {
  855. if (sname) {
  856. if (twostage) {
  857. nb = 192;
  858. } else {
  859. nb = 64;
  860. }
  861. } else {
  862. if (twostage) {
  863. nb = 192;
  864. } else {
  865. nb = 64;
  866. }
  867. }
  868. } else if (sname && s_cmp(c3, "TRD", (ftnlen)3, (ftnlen)3) == 0) {
  869. nb = 32;
  870. } else if (sname && s_cmp(c3, "GST", (ftnlen)3, (ftnlen)3) == 0) {
  871. nb = 64;
  872. }
  873. } else if (cname && s_cmp(c2, "HE", (ftnlen)2, (ftnlen)2) == 0) {
  874. if (s_cmp(c3, "TRF", (ftnlen)3, (ftnlen)3) == 0) {
  875. if (twostage) {
  876. nb = 192;
  877. } else {
  878. nb = 64;
  879. }
  880. } else if (s_cmp(c3, "TRD", (ftnlen)3, (ftnlen)3) == 0) {
  881. nb = 32;
  882. } else if (s_cmp(c3, "GST", (ftnlen)3, (ftnlen)3) == 0) {
  883. nb = 64;
  884. }
  885. } else if (sname && s_cmp(c2, "OR", (ftnlen)2, (ftnlen)2) == 0) {
  886. if (*(unsigned char *)c3 == 'G') {
  887. if (s_cmp(c4, "QR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "RQ",
  888. (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "LQ", (ftnlen)2, (
  889. ftnlen)2) == 0 || s_cmp(c4, "QL", (ftnlen)2, (ftnlen)2) ==
  890. 0 || s_cmp(c4, "HR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(
  891. c4, "TR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "BR", (
  892. ftnlen)2, (ftnlen)2) == 0) {
  893. nb = 32;
  894. }
  895. } else if (*(unsigned char *)c3 == 'M') {
  896. if (s_cmp(c4, "QR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "RQ",
  897. (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "LQ", (ftnlen)2, (
  898. ftnlen)2) == 0 || s_cmp(c4, "QL", (ftnlen)2, (ftnlen)2) ==
  899. 0 || s_cmp(c4, "HR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(
  900. c4, "TR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "BR", (
  901. ftnlen)2, (ftnlen)2) == 0) {
  902. nb = 32;
  903. }
  904. }
  905. } else if (cname && s_cmp(c2, "UN", (ftnlen)2, (ftnlen)2) == 0) {
  906. if (*(unsigned char *)c3 == 'G') {
  907. if (s_cmp(c4, "QR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "RQ",
  908. (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "LQ", (ftnlen)2, (
  909. ftnlen)2) == 0 || s_cmp(c4, "QL", (ftnlen)2, (ftnlen)2) ==
  910. 0 || s_cmp(c4, "HR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(
  911. c4, "TR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "BR", (
  912. ftnlen)2, (ftnlen)2) == 0) {
  913. nb = 32;
  914. }
  915. } else if (*(unsigned char *)c3 == 'M') {
  916. if (s_cmp(c4, "QR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "RQ",
  917. (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "LQ", (ftnlen)2, (
  918. ftnlen)2) == 0 || s_cmp(c4, "QL", (ftnlen)2, (ftnlen)2) ==
  919. 0 || s_cmp(c4, "HR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(
  920. c4, "TR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "BR", (
  921. ftnlen)2, (ftnlen)2) == 0) {
  922. nb = 32;
  923. }
  924. }
  925. } else if (s_cmp(c2, "GB", (ftnlen)2, (ftnlen)2) == 0) {
  926. if (s_cmp(c3, "TRF", (ftnlen)3, (ftnlen)3) == 0) {
  927. if (sname) {
  928. if (*n4 <= 64) {
  929. nb = 1;
  930. } else {
  931. nb = 32;
  932. }
  933. } else {
  934. if (*n4 <= 64) {
  935. nb = 1;
  936. } else {
  937. nb = 32;
  938. }
  939. }
  940. }
  941. } else if (s_cmp(c2, "PB", (ftnlen)2, (ftnlen)2) == 0) {
  942. if (s_cmp(c3, "TRF", (ftnlen)3, (ftnlen)3) == 0) {
  943. if (sname) {
  944. if (*n2 <= 64) {
  945. nb = 1;
  946. } else {
  947. nb = 32;
  948. }
  949. } else {
  950. if (*n2 <= 64) {
  951. nb = 1;
  952. } else {
  953. nb = 32;
  954. }
  955. }
  956. }
  957. } else if (s_cmp(c2, "TR", (ftnlen)2, (ftnlen)2) == 0) {
  958. if (s_cmp(c3, "TRI", (ftnlen)3, (ftnlen)3) == 0) {
  959. if (sname) {
  960. nb = 64;
  961. } else {
  962. nb = 64;
  963. }
  964. } else if (s_cmp(c3, "EVC", (ftnlen)3, (ftnlen)3) == 0) {
  965. if (sname) {
  966. nb = 64;
  967. } else {
  968. nb = 64;
  969. }
  970. } else if (s_cmp(c3, "SYL", (ftnlen)3, (ftnlen)3) == 0) {
  971. /* The upper bound is to prevent overly aggressive scaling. */
  972. if (sname) {
  973. /* Computing MIN */
  974. /* Computing MAX */
  975. i__2 = 48, i__3 = (f2cmin(*n1,*n2) << 4) / 100;
  976. i__1 = f2cmax(i__2,i__3);
  977. nb = f2cmin(i__1,240);
  978. } else {
  979. /* Computing MIN */
  980. /* Computing MAX */
  981. i__2 = 24, i__3 = (f2cmin(*n1,*n2) << 3) / 100;
  982. i__1 = f2cmax(i__2,i__3);
  983. nb = f2cmin(i__1,80);
  984. }
  985. }
  986. } else if (s_cmp(c2, "LA", (ftnlen)2, (ftnlen)2) == 0) {
  987. if (s_cmp(c3, "UUM", (ftnlen)3, (ftnlen)3) == 0) {
  988. if (sname) {
  989. nb = 64;
  990. } else {
  991. nb = 64;
  992. }
  993. } else if (s_cmp(c3, "TRS", (ftnlen)3, (ftnlen)3) == 0) {
  994. if (sname) {
  995. nb = 32;
  996. } else {
  997. nb = 32;
  998. }
  999. }
  1000. } else if (sname && s_cmp(c2, "ST", (ftnlen)2, (ftnlen)2) == 0) {
  1001. if (s_cmp(c3, "EBZ", (ftnlen)3, (ftnlen)3) == 0) {
  1002. nb = 1;
  1003. }
  1004. } else if (s_cmp(c2, "GG", (ftnlen)2, (ftnlen)2) == 0) {
  1005. nb = 32;
  1006. if (s_cmp(c3, "HD3", (ftnlen)3, (ftnlen)3) == 0) {
  1007. if (sname) {
  1008. nb = 32;
  1009. } else {
  1010. nb = 32;
  1011. }
  1012. }
  1013. }
  1014. ret_val = nb;
  1015. return ret_val;
  1016. L60:
  1017. /* ISPEC = 2: minimum block size */
  1018. nbmin = 2;
  1019. if (s_cmp(c2, "GE", (ftnlen)2, (ftnlen)2) == 0) {
  1020. if (s_cmp(c3, "QRF", (ftnlen)3, (ftnlen)3) == 0 || s_cmp(c3, "RQF", (
  1021. ftnlen)3, (ftnlen)3) == 0 || s_cmp(c3, "LQF", (ftnlen)3, (
  1022. ftnlen)3) == 0 || s_cmp(c3, "QLF", (ftnlen)3, (ftnlen)3) == 0)
  1023. {
  1024. if (sname) {
  1025. nbmin = 2;
  1026. } else {
  1027. nbmin = 2;
  1028. }
  1029. } else if (s_cmp(c3, "HRD", (ftnlen)3, (ftnlen)3) == 0) {
  1030. if (sname) {
  1031. nbmin = 2;
  1032. } else {
  1033. nbmin = 2;
  1034. }
  1035. } else if (s_cmp(c3, "BRD", (ftnlen)3, (ftnlen)3) == 0) {
  1036. if (sname) {
  1037. nbmin = 2;
  1038. } else {
  1039. nbmin = 2;
  1040. }
  1041. } else if (s_cmp(c3, "TRI", (ftnlen)3, (ftnlen)3) == 0) {
  1042. if (sname) {
  1043. nbmin = 2;
  1044. } else {
  1045. nbmin = 2;
  1046. }
  1047. } else if (s_cmp(subnam + 3, "QP3RK", (ftnlen)4, (ftnlen)5) == 0) {
  1048. if (sname) {
  1049. nbmin = 2;
  1050. } else {
  1051. nbmin = 2;
  1052. }
  1053. }
  1054. } else if (s_cmp(c2, "SY", (ftnlen)2, (ftnlen)2) == 0) {
  1055. if (s_cmp(c3, "TRF", (ftnlen)3, (ftnlen)3) == 0) {
  1056. if (sname) {
  1057. nbmin = 8;
  1058. } else {
  1059. nbmin = 8;
  1060. }
  1061. } else if (sname && s_cmp(c3, "TRD", (ftnlen)3, (ftnlen)3) == 0) {
  1062. nbmin = 2;
  1063. }
  1064. } else if (cname && s_cmp(c2, "HE", (ftnlen)2, (ftnlen)2) == 0) {
  1065. if (s_cmp(c3, "TRD", (ftnlen)3, (ftnlen)3) == 0) {
  1066. nbmin = 2;
  1067. }
  1068. } else if (sname && s_cmp(c2, "OR", (ftnlen)2, (ftnlen)2) == 0) {
  1069. if (*(unsigned char *)c3 == 'G') {
  1070. if (s_cmp(c4, "QR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "RQ",
  1071. (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "LQ", (ftnlen)2, (
  1072. ftnlen)2) == 0 || s_cmp(c4, "QL", (ftnlen)2, (ftnlen)2) ==
  1073. 0 || s_cmp(c4, "HR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(
  1074. c4, "TR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "BR", (
  1075. ftnlen)2, (ftnlen)2) == 0) {
  1076. nbmin = 2;
  1077. }
  1078. } else if (*(unsigned char *)c3 == 'M') {
  1079. if (s_cmp(c4, "QR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "RQ",
  1080. (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "LQ", (ftnlen)2, (
  1081. ftnlen)2) == 0 || s_cmp(c4, "QL", (ftnlen)2, (ftnlen)2) ==
  1082. 0 || s_cmp(c4, "HR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(
  1083. c4, "TR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "BR", (
  1084. ftnlen)2, (ftnlen)2) == 0) {
  1085. nbmin = 2;
  1086. }
  1087. }
  1088. } else if (cname && s_cmp(c2, "UN", (ftnlen)2, (ftnlen)2) == 0) {
  1089. if (*(unsigned char *)c3 == 'G') {
  1090. if (s_cmp(c4, "QR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "RQ",
  1091. (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "LQ", (ftnlen)2, (
  1092. ftnlen)2) == 0 || s_cmp(c4, "QL", (ftnlen)2, (ftnlen)2) ==
  1093. 0 || s_cmp(c4, "HR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(
  1094. c4, "TR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "BR", (
  1095. ftnlen)2, (ftnlen)2) == 0) {
  1096. nbmin = 2;
  1097. }
  1098. } else if (*(unsigned char *)c3 == 'M') {
  1099. if (s_cmp(c4, "QR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "RQ",
  1100. (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "LQ", (ftnlen)2, (
  1101. ftnlen)2) == 0 || s_cmp(c4, "QL", (ftnlen)2, (ftnlen)2) ==
  1102. 0 || s_cmp(c4, "HR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(
  1103. c4, "TR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "BR", (
  1104. ftnlen)2, (ftnlen)2) == 0) {
  1105. nbmin = 2;
  1106. }
  1107. }
  1108. } else if (s_cmp(c2, "GG", (ftnlen)2, (ftnlen)2) == 0) {
  1109. nbmin = 2;
  1110. if (s_cmp(c3, "HD3", (ftnlen)3, (ftnlen)3) == 0) {
  1111. nbmin = 2;
  1112. }
  1113. }
  1114. ret_val = nbmin;
  1115. return ret_val;
  1116. L70:
  1117. /* ISPEC = 3: crossover point */
  1118. nx = 0;
  1119. if (s_cmp(c2, "GE", (ftnlen)2, (ftnlen)2) == 0) {
  1120. if (s_cmp(c3, "QRF", (ftnlen)3, (ftnlen)3) == 0 || s_cmp(c3, "RQF", (
  1121. ftnlen)3, (ftnlen)3) == 0 || s_cmp(c3, "LQF", (ftnlen)3, (
  1122. ftnlen)3) == 0 || s_cmp(c3, "QLF", (ftnlen)3, (ftnlen)3) == 0)
  1123. {
  1124. if (sname) {
  1125. nx = 128;
  1126. } else {
  1127. nx = 128;
  1128. }
  1129. } else if (s_cmp(c3, "HRD", (ftnlen)3, (ftnlen)3) == 0) {
  1130. if (sname) {
  1131. nx = 128;
  1132. } else {
  1133. nx = 128;
  1134. }
  1135. } else if (s_cmp(c3, "BRD", (ftnlen)3, (ftnlen)3) == 0) {
  1136. if (sname) {
  1137. nx = 128;
  1138. } else {
  1139. nx = 128;
  1140. }
  1141. } else if (s_cmp(subnam + 3, "QP3RK", (ftnlen)4, (ftnlen)5) == 0) {
  1142. if (sname) {
  1143. nx = 128;
  1144. } else {
  1145. nx = 128;
  1146. }
  1147. }
  1148. } else if (s_cmp(c2, "SY", (ftnlen)2, (ftnlen)2) == 0) {
  1149. if (sname && s_cmp(c3, "TRD", (ftnlen)3, (ftnlen)3) == 0) {
  1150. nx = 32;
  1151. }
  1152. } else if (cname && s_cmp(c2, "HE", (ftnlen)2, (ftnlen)2) == 0) {
  1153. if (s_cmp(c3, "TRD", (ftnlen)3, (ftnlen)3) == 0) {
  1154. nx = 32;
  1155. }
  1156. } else if (sname && s_cmp(c2, "OR", (ftnlen)2, (ftnlen)2) == 0) {
  1157. if (*(unsigned char *)c3 == 'G') {
  1158. if (s_cmp(c4, "QR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "RQ",
  1159. (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "LQ", (ftnlen)2, (
  1160. ftnlen)2) == 0 || s_cmp(c4, "QL", (ftnlen)2, (ftnlen)2) ==
  1161. 0 || s_cmp(c4, "HR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(
  1162. c4, "TR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "BR", (
  1163. ftnlen)2, (ftnlen)2) == 0) {
  1164. nx = 128;
  1165. }
  1166. }
  1167. } else if (cname && s_cmp(c2, "UN", (ftnlen)2, (ftnlen)2) == 0) {
  1168. if (*(unsigned char *)c3 == 'G') {
  1169. if (s_cmp(c4, "QR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "RQ",
  1170. (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "LQ", (ftnlen)2, (
  1171. ftnlen)2) == 0 || s_cmp(c4, "QL", (ftnlen)2, (ftnlen)2) ==
  1172. 0 || s_cmp(c4, "HR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(
  1173. c4, "TR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "BR", (
  1174. ftnlen)2, (ftnlen)2) == 0) {
  1175. nx = 128;
  1176. }
  1177. }
  1178. } else if (s_cmp(c2, "GG", (ftnlen)2, (ftnlen)2) == 0) {
  1179. nx = 128;
  1180. if (s_cmp(c3, "HD3", (ftnlen)3, (ftnlen)3) == 0) {
  1181. nx = 128;
  1182. }
  1183. }
  1184. ret_val = nx;
  1185. return ret_val;
  1186. L80:
  1187. /* ISPEC = 4: number of shifts (used by xHSEQR) */
  1188. ret_val = 6;
  1189. return ret_val;
  1190. L90:
  1191. /* ISPEC = 5: minimum column dimension (not used) */
  1192. ret_val = 2;
  1193. return ret_val;
  1194. L100:
  1195. /* ISPEC = 6: crossover point for SVD (used by xGELSS and xGESVD) */
  1196. ret_val = (integer) ((real) f2cmin(*n1,*n2) * 1.6f);
  1197. return ret_val;
  1198. L110:
  1199. /* ISPEC = 7: number of processors (not used) */
  1200. ret_val = 1;
  1201. return ret_val;
  1202. L120:
  1203. /* ISPEC = 8: crossover point for multishift (used by xHSEQR) */
  1204. ret_val = 50;
  1205. return ret_val;
  1206. L130:
  1207. /* ISPEC = 9: maximum size of the subproblems at the bottom of the */
  1208. /* computation tree in the divide-and-conquer algorithm */
  1209. /* (used by xGELSD and xGESDD) */
  1210. ret_val = 25;
  1211. return ret_val;
  1212. L140:
  1213. /* ISPEC = 10: ieee and infinity NaN arithmetic can be trusted not to trap */
  1214. /* ILAENV = 0 */
  1215. ret_val = 1;
  1216. if (ret_val == 1) {
  1217. ret_val = ieeeck_(&c__1, &c_b179, &c_b180);
  1218. }
  1219. return ret_val;
  1220. L150:
  1221. /* ISPEC = 11: ieee infinity arithmetic can be trusted not to trap */
  1222. /* ILAENV = 0 */
  1223. ret_val = 1;
  1224. if (ret_val == 1) {
  1225. ret_val = ieeeck_(&c__0, &c_b179, &c_b180);
  1226. }
  1227. return ret_val;
  1228. L160:
  1229. /* 12 <= ISPEC <= 17: xHSEQR or related subroutines. */
  1230. ret_val = iparmq_(ispec, name__, opts, n1, n2, n3, n4)
  1231. ;
  1232. return ret_val;
  1233. /* End of ILAENV */
  1234. } /* ilaenv_ */