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 34 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202
  1. /* f2c.h -- Standard Fortran to C header file */
  2. /** barf [ba:rf] 2. "He suggested using FORTRAN, and everybody barfed."
  3. - From The Shogakukan DICTIONARY OF NEW ENGLISH (Second edition) */
  4. #ifndef F2C_INCLUDE
  5. #define F2C_INCLUDE
  6. #include <math.h>
  7. #include <stdlib.h>
  8. #include <string.h>
  9. #include <stdio.h>
  10. #include <complex.h>
  11. #ifdef complex
  12. #undef complex
  13. #endif
  14. #ifdef I
  15. #undef I
  16. #endif
  17. #if defined(OS_WINDOWS) && defined(__64BIT__)
  18. typedef long long BLASLONG;
  19. typedef unsigned long long BLASULONG;
  20. #else
  21. typedef long BLASLONG;
  22. typedef unsigned long BLASULONG;
  23. #endif
  24. #ifdef LAPACK_ILP64
  25. typedef BLASLONG blasint;
  26. #if defined(OS_WINDOWS) && defined(__64BIT__)
  27. #define blasabs(x) llabs(x)
  28. #else
  29. #define blasabs(x) labs(x)
  30. #endif
  31. #else
  32. typedef int blasint;
  33. #define blasabs(x) abs(x)
  34. #endif
  35. typedef blasint integer;
  36. typedef unsigned int uinteger;
  37. typedef char *address;
  38. typedef short int shortint;
  39. typedef float real;
  40. typedef double doublereal;
  41. typedef struct { real r, i; } complex;
  42. typedef struct { doublereal r, i; } doublecomplex;
  43. static inline _Complex float Cf(complex *z) {return z->r + z->i*_Complex_I;}
  44. static inline _Complex double Cd(doublecomplex *z) {return z->r + z->i*_Complex_I;}
  45. static inline _Complex float * _pCf(complex *z) {return (_Complex float*)z;}
  46. static inline _Complex double * _pCd(doublecomplex *z) {return (_Complex double*)z;}
  47. #define pCf(z) (*_pCf(z))
  48. #define pCd(z) (*_pCd(z))
  49. typedef int logical;
  50. typedef short int shortlogical;
  51. typedef char logical1;
  52. typedef char integer1;
  53. #define TRUE_ (1)
  54. #define FALSE_ (0)
  55. /* Extern is for use with -E */
  56. #ifndef Extern
  57. #define Extern extern
  58. #endif
  59. /* I/O stuff */
  60. typedef int flag;
  61. typedef int ftnlen;
  62. typedef int ftnint;
  63. /*external read, write*/
  64. typedef struct
  65. { flag cierr;
  66. ftnint ciunit;
  67. flag ciend;
  68. char *cifmt;
  69. ftnint cirec;
  70. } cilist;
  71. /*internal read, write*/
  72. typedef struct
  73. { flag icierr;
  74. char *iciunit;
  75. flag iciend;
  76. char *icifmt;
  77. ftnint icirlen;
  78. ftnint icirnum;
  79. } icilist;
  80. /*open*/
  81. typedef struct
  82. { flag oerr;
  83. ftnint ounit;
  84. char *ofnm;
  85. ftnlen ofnmlen;
  86. char *osta;
  87. char *oacc;
  88. char *ofm;
  89. ftnint orl;
  90. char *oblnk;
  91. } olist;
  92. /*close*/
  93. typedef struct
  94. { flag cerr;
  95. ftnint cunit;
  96. char *csta;
  97. } cllist;
  98. /*rewind, backspace, endfile*/
  99. typedef struct
  100. { flag aerr;
  101. ftnint aunit;
  102. } alist;
  103. /* inquire */
  104. typedef struct
  105. { flag inerr;
  106. ftnint inunit;
  107. char *infile;
  108. ftnlen infilen;
  109. ftnint *inex; /*parameters in standard's order*/
  110. ftnint *inopen;
  111. ftnint *innum;
  112. ftnint *innamed;
  113. char *inname;
  114. ftnlen innamlen;
  115. char *inacc;
  116. ftnlen inacclen;
  117. char *inseq;
  118. ftnlen inseqlen;
  119. char *indir;
  120. ftnlen indirlen;
  121. char *infmt;
  122. ftnlen infmtlen;
  123. char *inform;
  124. ftnint informlen;
  125. char *inunf;
  126. ftnlen inunflen;
  127. ftnint *inrecl;
  128. ftnint *innrec;
  129. char *inblank;
  130. ftnlen inblanklen;
  131. } inlist;
  132. #define VOID void
  133. union Multitype { /* for multiple entry points */
  134. integer1 g;
  135. shortint h;
  136. integer i;
  137. /* longint j; */
  138. real r;
  139. doublereal d;
  140. complex c;
  141. doublecomplex z;
  142. };
  143. typedef union Multitype Multitype;
  144. struct Vardesc { /* for Namelist */
  145. char *name;
  146. char *addr;
  147. ftnlen *dims;
  148. int type;
  149. };
  150. typedef struct Vardesc Vardesc;
  151. struct Namelist {
  152. char *name;
  153. Vardesc **vars;
  154. int nvars;
  155. };
  156. typedef struct Namelist Namelist;
  157. #define abs(x) ((x) >= 0 ? (x) : -(x))
  158. #define dabs(x) (fabs(x))
  159. #define f2cmin(a,b) ((a) <= (b) ? (a) : (b))
  160. #define f2cmax(a,b) ((a) >= (b) ? (a) : (b))
  161. #define dmin(a,b) (f2cmin(a,b))
  162. #define dmax(a,b) (f2cmax(a,b))
  163. #define bit_test(a,b) ((a) >> (b) & 1)
  164. #define bit_clear(a,b) ((a) & ~((uinteger)1 << (b)))
  165. #define bit_set(a,b) ((a) | ((uinteger)1 << (b)))
  166. #define abort_() { sig_die("Fortran abort routine called", 1); }
  167. #define c_abs(z) (cabsf(Cf(z)))
  168. #define c_cos(R,Z) { pCf(R)=ccos(Cf(Z)); }
  169. #define c_div(c, a, b) {pCf(c) = Cf(a)/Cf(b);}
  170. #define z_div(c, a, b) {pCd(c) = Cd(a)/Cd(b);}
  171. #define c_exp(R, Z) {pCf(R) = cexpf(Cf(Z));}
  172. #define c_log(R, Z) {pCf(R) = clogf(Cf(Z));}
  173. #define c_sin(R, Z) {pCf(R) = csinf(Cf(Z));}
  174. //#define c_sqrt(R, Z) {*(R) = csqrtf(Cf(Z));}
  175. #define c_sqrt(R, Z) {pCf(R) = csqrtf(Cf(Z));}
  176. #define d_abs(x) (fabs(*(x)))
  177. #define d_acos(x) (acos(*(x)))
  178. #define d_asin(x) (asin(*(x)))
  179. #define d_atan(x) (atan(*(x)))
  180. #define d_atn2(x, y) (atan2(*(x),*(y)))
  181. #define d_cnjg(R, Z) { pCd(R) = conj(Cd(Z)); }
  182. #define r_cnjg(R, Z) { pCf(R) = conj(Cf(Z)); }
  183. #define d_cos(x) (cos(*(x)))
  184. #define d_cosh(x) (cosh(*(x)))
  185. #define d_dim(__a, __b) ( *(__a) > *(__b) ? *(__a) - *(__b) : 0.0 )
  186. #define d_exp(x) (exp(*(x)))
  187. #define d_imag(z) (cimag(Cd(z)))
  188. #define r_imag(z) (cimag(Cf(z)))
  189. #define d_int(__x) (*(__x)>0 ? floor(*(__x)) : -floor(- *(__x)))
  190. #define r_int(__x) (*(__x)>0 ? floor(*(__x)) : -floor(- *(__x)))
  191. #define d_lg10(x) ( 0.43429448190325182765 * log(*(x)) )
  192. #define r_lg10(x) ( 0.43429448190325182765 * log(*(x)) )
  193. #define d_log(x) (log(*(x)))
  194. #define d_mod(x, y) (fmod(*(x), *(y)))
  195. #define u_nint(__x) ((__x)>=0 ? floor((__x) + .5) : -floor(.5 - (__x)))
  196. #define d_nint(x) u_nint(*(x))
  197. #define u_sign(__a,__b) ((__b) >= 0 ? ((__a) >= 0 ? (__a) : -(__a)) : -((__a) >= 0 ? (__a) : -(__a)))
  198. #define d_sign(a,b) u_sign(*(a),*(b))
  199. #define r_sign(a,b) u_sign(*(a),*(b))
  200. #define d_sin(x) (sin(*(x)))
  201. #define d_sinh(x) (sinh(*(x)))
  202. #define d_sqrt(x) (sqrt(*(x)))
  203. #define d_tan(x) (tan(*(x)))
  204. #define d_tanh(x) (tanh(*(x)))
  205. #define i_abs(x) abs(*(x))
  206. #define i_dnnt(x) ((integer)u_nint(*(x)))
  207. //#define i_len(s, n) (n)
  208. #define i_len(s, n) strlen(s)
  209. #define i_nint(x) ((integer)u_nint(*(x)))
  210. #define i_sign(a,b) ((integer)u_sign((integer)*(a),(integer)*(b)))
  211. #define pow_dd(ap, bp) ( pow(*(ap), *(bp)))
  212. #define pow_si(B,E) spow_ui(*(B),*(E))
  213. #define pow_ri(B,E) spow_ui(*(B),*(E))
  214. #define pow_di(B,E) dpow_ui(*(B),*(E))
  215. #define pow_zi(p, a, b) {pCd(p) = zpow_ui(Cd(a), *(b));}
  216. #define pow_ci(p, a, b) {pCf(p) = cpow_ui(Cf(a), *(b));}
  217. #define pow_zz(R,A,B) {pCd(R) = cpow(Cd(A),*(B));}
  218. #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++ = ' '; }
  219. #define s_cmp(a,b,c,d) ((integer)strncmp((a),(b),f2cmin((c),(d))))
  220. #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]; }
  221. #define sig_die(s, kill) { exit(1); }
  222. #define s_stop(s, n) {exit(0);}
  223. static char junk[] = "\n@(#)LIBF77 VERSION 19990503\n";
  224. #define z_abs(z) (cabs(Cd(z)))
  225. #define z_exp(R, Z) {pCd(R) = cexp(Cd(Z));}
  226. #define z_sqrt(R, Z) {pCd(R) = csqrt(Cd(Z));}
  227. #define myexit_() break;
  228. #define mycycle() continue;
  229. #define myceiling(w) {ceil(w)}
  230. #define myhuge(w) {HUGE_VAL}
  231. //#define mymaxloc_(w,s,e,n) {if (sizeof(*(w)) == sizeof(double)) dmaxloc_((w),*(s),*(e),n); else dmaxloc_((w),*(s),*(e),n);}
  232. #define mymaxloc(w,s,e,n) {dmaxloc_(w,*(s),*(e),n)}
  233. /* procedure parameter types for -A and -C++ */
  234. #define F2C_proc_par_types 1
  235. #ifdef __cplusplus
  236. typedef logical (*L_fp)(...);
  237. #else
  238. typedef logical (*L_fp)();
  239. #endif
  240. static float spow_ui(float x, integer n) {
  241. float pow=1.0; unsigned long int u;
  242. if(n != 0) {
  243. if(n < 0) n = -n, x = 1/x;
  244. for(u = n; ; ) {
  245. if(u & 01) pow *= x;
  246. if(u >>= 1) x *= x;
  247. else break;
  248. }
  249. }
  250. return pow;
  251. }
  252. static double dpow_ui(double x, integer n) {
  253. double pow=1.0; unsigned long int u;
  254. if(n != 0) {
  255. if(n < 0) n = -n, x = 1/x;
  256. for(u = n; ; ) {
  257. if(u & 01) pow *= x;
  258. if(u >>= 1) x *= x;
  259. else break;
  260. }
  261. }
  262. return pow;
  263. }
  264. static _Complex float cpow_ui(_Complex float x, integer n) {
  265. _Complex float pow=1.0; unsigned long int u;
  266. if(n != 0) {
  267. if(n < 0) n = -n, x = 1/x;
  268. for(u = n; ; ) {
  269. if(u & 01) pow *= x;
  270. if(u >>= 1) x *= x;
  271. else break;
  272. }
  273. }
  274. return pow;
  275. }
  276. static _Complex double zpow_ui(_Complex double x, integer n) {
  277. _Complex double pow=1.0; unsigned long int u;
  278. if(n != 0) {
  279. if(n < 0) n = -n, x = 1/x;
  280. for(u = n; ; ) {
  281. if(u & 01) pow *= x;
  282. if(u >>= 1) x *= x;
  283. else break;
  284. }
  285. }
  286. return pow;
  287. }
  288. static integer pow_ii(integer x, integer n) {
  289. integer pow; unsigned long int u;
  290. if (n <= 0) {
  291. if (n == 0 || x == 1) pow = 1;
  292. else if (x != -1) pow = x == 0 ? 1/x : 0;
  293. else n = -n;
  294. }
  295. if ((n > 0) || !(n == 0 || x == 1 || x != -1)) {
  296. u = n;
  297. for(pow = 1; ; ) {
  298. if(u & 01) pow *= x;
  299. if(u >>= 1) x *= x;
  300. else break;
  301. }
  302. }
  303. return pow;
  304. }
  305. static integer dmaxloc_(double *w, integer s, integer e, integer *n)
  306. {
  307. double m; integer i, mi;
  308. for(m=w[s-1], mi=s, i=s+1; i<=e; i++)
  309. if (w[i-1]>m) mi=i ,m=w[i-1];
  310. return mi-s+1;
  311. }
  312. static integer smaxloc_(float *w, integer s, integer e, integer *n)
  313. {
  314. float m; integer i, mi;
  315. for(m=w[s-1], mi=s, i=s+1; i<=e; i++)
  316. if (w[i-1]>m) mi=i ,m=w[i-1];
  317. return mi-s+1;
  318. }
  319. static inline void cdotc_(complex *z, integer *n_, complex *x, integer *incx_, complex *y, integer *incy_) {
  320. integer n = *n_, incx = *incx_, incy = *incy_, i;
  321. _Complex float zdotc = 0.0;
  322. if (incx == 1 && incy == 1) {
  323. for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
  324. zdotc += conjf(Cf(&x[i])) * Cf(&y[i]);
  325. }
  326. } else {
  327. for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
  328. zdotc += conjf(Cf(&x[i*incx])) * Cf(&y[i*incy]);
  329. }
  330. }
  331. pCf(z) = zdotc;
  332. }
  333. static inline void zdotc_(doublecomplex *z, integer *n_, doublecomplex *x, integer *incx_, doublecomplex *y, integer *incy_) {
  334. integer n = *n_, incx = *incx_, incy = *incy_, i;
  335. _Complex double zdotc = 0.0;
  336. if (incx == 1 && incy == 1) {
  337. for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
  338. zdotc += conj(Cd(&x[i])) * Cd(&y[i]);
  339. }
  340. } else {
  341. for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
  342. zdotc += conj(Cd(&x[i*incx])) * Cd(&y[i*incy]);
  343. }
  344. }
  345. pCd(z) = zdotc;
  346. }
  347. static inline void cdotu_(complex *z, integer *n_, complex *x, integer *incx_, complex *y, integer *incy_) {
  348. integer n = *n_, incx = *incx_, incy = *incy_, i;
  349. _Complex float zdotc = 0.0;
  350. if (incx == 1 && incy == 1) {
  351. for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
  352. zdotc += Cf(&x[i]) * Cf(&y[i]);
  353. }
  354. } else {
  355. for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
  356. zdotc += Cf(&x[i*incx]) * Cf(&y[i*incy]);
  357. }
  358. }
  359. pCf(z) = zdotc;
  360. }
  361. static inline void zdotu_(doublecomplex *z, integer *n_, doublecomplex *x, integer *incx_, doublecomplex *y, integer *incy_) {
  362. integer n = *n_, incx = *incx_, incy = *incy_, i;
  363. _Complex double zdotc = 0.0;
  364. if (incx == 1 && incy == 1) {
  365. for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
  366. zdotc += Cd(&x[i]) * Cd(&y[i]);
  367. }
  368. } else {
  369. for (i=0;i<n;i++) { /* zdotc = zdotc + dconjg(x(i))* y(i) */
  370. zdotc += Cd(&x[i*incx]) * Cd(&y[i*incy]);
  371. }
  372. }
  373. pCd(z) = zdotc;
  374. }
  375. #endif
  376. /* -- translated by f2c (version 20000121).
  377. You must link the resulting object file with the libraries:
  378. -lf2c -lm (in that order)
  379. */
  380. /* Table of constant values */
  381. static integer c__1 = 1;
  382. static real c_b174 = 0.f;
  383. static real c_b175 = 1.f;
  384. static integer c__0 = 0;
  385. /* > \brief \b ILAENV */
  386. /* =========== DOCUMENTATION =========== */
  387. /* Online html documentation available at */
  388. /* http://www.netlib.org/lapack/explore-html/ */
  389. /* > \htmlonly */
  390. /* > Download ILAENV + dependencies */
  391. /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/ilaenv.
  392. f"> */
  393. /* > [TGZ]</a> */
  394. /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/ilaenv.
  395. f"> */
  396. /* > [ZIP]</a> */
  397. /* > <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ilaenv.
  398. f"> */
  399. /* > [TXT]</a> */
  400. /* > \endhtmlonly */
  401. /* Definition: */
  402. /* =========== */
  403. /* INTEGER FUNCTION ILAENV( ISPEC, NAME, OPTS, N1, N2, N3, N4 ) */
  404. /* CHARACTER*( * ) NAME, OPTS */
  405. /* INTEGER ISPEC, N1, N2, N3, N4 */
  406. /* > \par Purpose: */
  407. /* ============= */
  408. /* > */
  409. /* > \verbatim */
  410. /* > */
  411. /* > ILAENV is called from the LAPACK routines to choose problem-dependent */
  412. /* > parameters for the local environment. See ISPEC for a description of */
  413. /* > the parameters. */
  414. /* > */
  415. /* > ILAENV returns an INTEGER */
  416. /* > if ILAENV >= 0: ILAENV returns the value of the parameter specified by ISPEC */
  417. /* > if ILAENV < 0: if ILAENV = -k, the k-th argument had an illegal value. */
  418. /* > */
  419. /* > This version provides a set of parameters which should give good, */
  420. /* > but not optimal, performance on many of the currently available */
  421. /* > computers. Users are encouraged to modify this subroutine to set */
  422. /* > the tuning parameters for their particular machine using the option */
  423. /* > and problem size information in the arguments. */
  424. /* > */
  425. /* > This routine will not function correctly if it is converted to all */
  426. /* > lower case. Converting it to all upper case is allowed. */
  427. /* > \endverbatim */
  428. /* Arguments: */
  429. /* ========== */
  430. /* > \param[in] ISPEC */
  431. /* > \verbatim */
  432. /* > ISPEC is INTEGER */
  433. /* > Specifies the parameter to be returned as the value of */
  434. /* > ILAENV. */
  435. /* > = 1: the optimal blocksize; if this value is 1, an unblocked */
  436. /* > algorithm will give the best performance. */
  437. /* > = 2: the minimum block size for which the block routine */
  438. /* > should be used; if the usable block size is less than */
  439. /* > this value, an unblocked routine should be used. */
  440. /* > = 3: the crossover point (in a block routine, for N less */
  441. /* > than this value, an unblocked routine should be used) */
  442. /* > = 4: the number of shifts, used in the nonsymmetric */
  443. /* > eigenvalue routines (DEPRECATED) */
  444. /* > = 5: the minimum column dimension for blocking to be used; */
  445. /* > rectangular blocks must have dimension at least k by m, */
  446. /* > where k is given by ILAENV(2,...) and m by ILAENV(5,...) */
  447. /* > = 6: the crossover point for the SVD (when reducing an m by n */
  448. /* > matrix to bidiagonal form, if f2cmax(m,n)/f2cmin(m,n) exceeds */
  449. /* > this value, a QR factorization is used first to reduce */
  450. /* > the matrix to a triangular form.) */
  451. /* > = 7: the number of processors */
  452. /* > = 8: the crossover point for the multishift QR method */
  453. /* > for nonsymmetric eigenvalue problems (DEPRECATED) */
  454. /* > = 9: maximum size of the subproblems at the bottom of the */
  455. /* > computation tree in the divide-and-conquer algorithm */
  456. /* > (used by xGELSD and xGESDD) */
  457. /* > =10: ieee NaN arithmetic can be trusted not to trap */
  458. /* > =11: infinity arithmetic can be trusted not to trap */
  459. /* > 12 <= ISPEC <= 16: */
  460. /* > xHSEQR or related subroutines, */
  461. /* > see IPARMQ for detailed explanation */
  462. /* > \endverbatim */
  463. /* > */
  464. /* > \param[in] NAME */
  465. /* > \verbatim */
  466. /* > NAME is CHARACTER*(*) */
  467. /* > The name of the calling subroutine, in either upper case or */
  468. /* > lower case. */
  469. /* > \endverbatim */
  470. /* > */
  471. /* > \param[in] OPTS */
  472. /* > \verbatim */
  473. /* > OPTS is CHARACTER*(*) */
  474. /* > The character options to the subroutine NAME, concatenated */
  475. /* > into a single character string. For example, UPLO = 'U', */
  476. /* > TRANS = 'T', and DIAG = 'N' for a triangular routine would */
  477. /* > be specified as OPTS = 'UTN'. */
  478. /* > \endverbatim */
  479. /* > */
  480. /* > \param[in] N1 */
  481. /* > \verbatim */
  482. /* > N1 is INTEGER */
  483. /* > \endverbatim */
  484. /* > */
  485. /* > \param[in] N2 */
  486. /* > \verbatim */
  487. /* > N2 is INTEGER */
  488. /* > \endverbatim */
  489. /* > */
  490. /* > \param[in] N3 */
  491. /* > \verbatim */
  492. /* > N3 is INTEGER */
  493. /* > \endverbatim */
  494. /* > */
  495. /* > \param[in] N4 */
  496. /* > \verbatim */
  497. /* > N4 is INTEGER */
  498. /* > Problem dimensions for the subroutine NAME; these may not all */
  499. /* > be required. */
  500. /* > \endverbatim */
  501. /* Authors: */
  502. /* ======== */
  503. /* > \author Univ. of Tennessee */
  504. /* > \author Univ. of California Berkeley */
  505. /* > \author Univ. of Colorado Denver */
  506. /* > \author NAG Ltd. */
  507. /* > \date November 2019 */
  508. /* > \ingroup OTHERauxiliary */
  509. /* > \par Further Details: */
  510. /* ===================== */
  511. /* > */
  512. /* > \verbatim */
  513. /* > */
  514. /* > The following conventions have been used when calling ILAENV from the */
  515. /* > LAPACK routines: */
  516. /* > 1) OPTS is a concatenation of all of the character options to */
  517. /* > subroutine NAME, in the same order that they appear in the */
  518. /* > argument list for NAME, even if they are not used in determining */
  519. /* > the value of the parameter specified by ISPEC. */
  520. /* > 2) The problem dimensions N1, N2, N3, N4 are specified in the order */
  521. /* > that they appear in the argument list for NAME. N1 is used */
  522. /* > first, N2 second, and so on, and unused problem dimensions are */
  523. /* > passed a value of -1. */
  524. /* > 3) The parameter value returned by ILAENV is checked for validity in */
  525. /* > the calling subroutine. For example, ILAENV is used to retrieve */
  526. /* > the optimal blocksize for STRTRI as follows: */
  527. /* > */
  528. /* > NB = ILAENV( 1, 'STRTRI', UPLO // DIAG, N, -1, -1, -1 ) */
  529. /* > IF( NB.LE.1 ) NB = MAX( 1, N ) */
  530. /* > \endverbatim */
  531. /* > */
  532. /* ===================================================================== */
  533. integer ilaenv_(integer *ispec, char *name__, char *opts, integer *n1,
  534. integer *n2, integer *n3, integer *n4, ftnlen name_len, ftnlen
  535. opts_len)
  536. {
  537. /* System generated locals */
  538. integer ret_val;
  539. /* Local variables */
  540. logical twostage;
  541. integer i__;
  542. logical cname;
  543. integer nbmin;
  544. logical sname;
  545. char c1[1], c2[2], c3[3], c4[2];
  546. integer ic, nb;
  547. extern integer ieeeck_(integer *, real *, real *);
  548. integer iz, nx;
  549. char subnam[16];
  550. extern integer iparmq_(integer *, char *, char *, integer *, integer *,
  551. integer *, integer *);
  552. /* -- LAPACK auxiliary routine (version 3.9.0) -- */
  553. /* -- LAPACK is a software package provided by Univ. of Tennessee, -- */
  554. /* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..-- */
  555. /* November 2019 */
  556. /* ===================================================================== */
  557. switch (*ispec) {
  558. case 1: goto L10;
  559. case 2: goto L10;
  560. case 3: goto L10;
  561. case 4: goto L80;
  562. case 5: goto L90;
  563. case 6: goto L100;
  564. case 7: goto L110;
  565. case 8: goto L120;
  566. case 9: goto L130;
  567. case 10: goto L140;
  568. case 11: goto L150;
  569. case 12: goto L160;
  570. case 13: goto L160;
  571. case 14: goto L160;
  572. case 15: goto L160;
  573. case 16: goto L160;
  574. }
  575. /* Invalid value for ISPEC */
  576. ret_val = -1;
  577. return ret_val;
  578. L10:
  579. /* Convert NAME to upper case if the first character is lower case. */
  580. ret_val = 1;
  581. s_copy(subnam, name__, (ftnlen)16, name_len);
  582. ic = *(unsigned char *)subnam;
  583. iz = 'Z';
  584. if (iz == 90 || iz == 122) {
  585. /* ASCII character set */
  586. if (ic >= 97 && ic <= 122) {
  587. *(unsigned char *)subnam = (char) (ic - 32);
  588. for (i__ = 2; i__ <= 6; ++i__) {
  589. ic = *(unsigned char *)&subnam[i__ - 1];
  590. if (ic >= 97 && ic <= 122) {
  591. *(unsigned char *)&subnam[i__ - 1] = (char) (ic - 32);
  592. }
  593. /* L20: */
  594. }
  595. }
  596. } else if (iz == 233 || iz == 169) {
  597. /* EBCDIC character set */
  598. if (ic >= 129 && ic <= 137 || ic >= 145 && ic <= 153 || ic >= 162 &&
  599. ic <= 169) {
  600. *(unsigned char *)subnam = (char) (ic + 64);
  601. for (i__ = 2; i__ <= 6; ++i__) {
  602. ic = *(unsigned char *)&subnam[i__ - 1];
  603. if (ic >= 129 && ic <= 137 || ic >= 145 && ic <= 153 || ic >=
  604. 162 && ic <= 169) {
  605. *(unsigned char *)&subnam[i__ - 1] = (char) (ic + 64);
  606. }
  607. /* L30: */
  608. }
  609. }
  610. } else if (iz == 218 || iz == 250) {
  611. /* Prime machines: ASCII+128 */
  612. if (ic >= 225 && ic <= 250) {
  613. *(unsigned char *)subnam = (char) (ic - 32);
  614. for (i__ = 2; i__ <= 6; ++i__) {
  615. ic = *(unsigned char *)&subnam[i__ - 1];
  616. if (ic >= 225 && ic <= 250) {
  617. *(unsigned char *)&subnam[i__ - 1] = (char) (ic - 32);
  618. }
  619. /* L40: */
  620. }
  621. }
  622. }
  623. *(unsigned char *)c1 = *(unsigned char *)subnam;
  624. sname = *(unsigned char *)c1 == 'S' || *(unsigned char *)c1 == 'D';
  625. cname = *(unsigned char *)c1 == 'C' || *(unsigned char *)c1 == 'Z';
  626. if (! (cname || sname)) {
  627. return ret_val;
  628. }
  629. s_copy(c2, subnam + 1, (ftnlen)2, (ftnlen)2);
  630. s_copy(c3, subnam + 3, (ftnlen)3, (ftnlen)3);
  631. s_copy(c4, c3 + 1, (ftnlen)2, (ftnlen)2);
  632. twostage = i_len(subnam, (ftnlen)16) >= 11 && *(unsigned char *)&subnam[
  633. 10] == '2';
  634. switch (*ispec) {
  635. case 1: goto L50;
  636. case 2: goto L60;
  637. case 3: goto L70;
  638. }
  639. L50:
  640. /* ISPEC = 1: block size */
  641. /* In these examples, separate code is provided for setting NB for */
  642. /* real and complex. We assume that NB will take the same value in */
  643. /* single or double precision. */
  644. nb = 1;
  645. if (s_cmp(subnam + 1, "LAORH", (ftnlen)5, (ftnlen)5) == 0) {
  646. /* This is for *LAORHR_GETRFNP routine */
  647. if (sname) {
  648. nb = 32;
  649. } else {
  650. nb = 32;
  651. }
  652. } else if (s_cmp(c2, "GE", (ftnlen)2, (ftnlen)2) == 0) {
  653. if (s_cmp(c3, "TRF", (ftnlen)3, (ftnlen)3) == 0) {
  654. if (sname) {
  655. nb = 64;
  656. } else {
  657. nb = 64;
  658. }
  659. } else if (s_cmp(c3, "QRF", (ftnlen)3, (ftnlen)3) == 0 || s_cmp(c3,
  660. "RQF", (ftnlen)3, (ftnlen)3) == 0 || s_cmp(c3, "LQF", (ftnlen)
  661. 3, (ftnlen)3) == 0 || s_cmp(c3, "QLF", (ftnlen)3, (ftnlen)3)
  662. == 0) {
  663. if (sname) {
  664. nb = 32;
  665. } else {
  666. nb = 32;
  667. }
  668. } else if (s_cmp(c3, "QR ", (ftnlen)3, (ftnlen)3) == 0) {
  669. if (*n3 == 1) {
  670. if (sname) {
  671. /* M*N */
  672. if (*n1 * *n2 <= 131072 || *n1 <= 8192) {
  673. nb = *n1;
  674. } else {
  675. nb = 32768 / *n2;
  676. }
  677. } else {
  678. if (*n1 * *n2 <= 131072 || *n1 <= 8192) {
  679. nb = *n1;
  680. } else {
  681. nb = 32768 / *n2;
  682. }
  683. }
  684. } else {
  685. if (sname) {
  686. nb = 1;
  687. } else {
  688. nb = 1;
  689. }
  690. }
  691. } else if (s_cmp(c3, "LQ ", (ftnlen)3, (ftnlen)3) == 0) {
  692. if (*n3 == 2) {
  693. if (sname) {
  694. /* M*N */
  695. if (*n1 * *n2 <= 131072 || *n1 <= 8192) {
  696. nb = *n1;
  697. } else {
  698. nb = 32768 / *n2;
  699. }
  700. } else {
  701. if (*n1 * *n2 <= 131072 || *n1 <= 8192) {
  702. nb = *n1;
  703. } else {
  704. nb = 32768 / *n2;
  705. }
  706. }
  707. } else {
  708. if (sname) {
  709. nb = 1;
  710. } else {
  711. nb = 1;
  712. }
  713. }
  714. } else if (s_cmp(c3, "HRD", (ftnlen)3, (ftnlen)3) == 0) {
  715. if (sname) {
  716. nb = 32;
  717. } else {
  718. nb = 32;
  719. }
  720. } else if (s_cmp(c3, "BRD", (ftnlen)3, (ftnlen)3) == 0) {
  721. if (sname) {
  722. nb = 32;
  723. } else {
  724. nb = 32;
  725. }
  726. } else if (s_cmp(c3, "TRI", (ftnlen)3, (ftnlen)3) == 0) {
  727. if (sname) {
  728. nb = 64;
  729. } else {
  730. nb = 64;
  731. }
  732. }
  733. } else if (s_cmp(c2, "PO", (ftnlen)2, (ftnlen)2) == 0) {
  734. if (s_cmp(c3, "TRF", (ftnlen)3, (ftnlen)3) == 0) {
  735. if (sname) {
  736. nb = 64;
  737. } else {
  738. nb = 64;
  739. }
  740. }
  741. } else if (s_cmp(c2, "SY", (ftnlen)2, (ftnlen)2) == 0) {
  742. if (s_cmp(c3, "TRF", (ftnlen)3, (ftnlen)3) == 0) {
  743. if (sname) {
  744. if (twostage) {
  745. nb = 192;
  746. } else {
  747. nb = 64;
  748. }
  749. } else {
  750. if (twostage) {
  751. nb = 192;
  752. } else {
  753. nb = 64;
  754. }
  755. }
  756. } else if (sname && s_cmp(c3, "TRD", (ftnlen)3, (ftnlen)3) == 0) {
  757. nb = 32;
  758. } else if (sname && s_cmp(c3, "GST", (ftnlen)3, (ftnlen)3) == 0) {
  759. nb = 64;
  760. }
  761. } else if (cname && s_cmp(c2, "HE", (ftnlen)2, (ftnlen)2) == 0) {
  762. if (s_cmp(c3, "TRF", (ftnlen)3, (ftnlen)3) == 0) {
  763. if (twostage) {
  764. nb = 192;
  765. } else {
  766. nb = 64;
  767. }
  768. } else if (s_cmp(c3, "TRD", (ftnlen)3, (ftnlen)3) == 0) {
  769. nb = 32;
  770. } else if (s_cmp(c3, "GST", (ftnlen)3, (ftnlen)3) == 0) {
  771. nb = 64;
  772. }
  773. } else if (sname && s_cmp(c2, "OR", (ftnlen)2, (ftnlen)2) == 0) {
  774. if (*(unsigned char *)c3 == 'G') {
  775. if (s_cmp(c4, "QR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "RQ",
  776. (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "LQ", (ftnlen)2, (
  777. ftnlen)2) == 0 || s_cmp(c4, "QL", (ftnlen)2, (ftnlen)2) ==
  778. 0 || s_cmp(c4, "HR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(
  779. c4, "TR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "BR", (
  780. ftnlen)2, (ftnlen)2) == 0) {
  781. nb = 32;
  782. }
  783. } else if (*(unsigned char *)c3 == 'M') {
  784. if (s_cmp(c4, "QR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "RQ",
  785. (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "LQ", (ftnlen)2, (
  786. ftnlen)2) == 0 || s_cmp(c4, "QL", (ftnlen)2, (ftnlen)2) ==
  787. 0 || s_cmp(c4, "HR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(
  788. c4, "TR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "BR", (
  789. ftnlen)2, (ftnlen)2) == 0) {
  790. nb = 32;
  791. }
  792. }
  793. } else if (cname && s_cmp(c2, "UN", (ftnlen)2, (ftnlen)2) == 0) {
  794. if (*(unsigned char *)c3 == 'G') {
  795. if (s_cmp(c4, "QR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "RQ",
  796. (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "LQ", (ftnlen)2, (
  797. ftnlen)2) == 0 || s_cmp(c4, "QL", (ftnlen)2, (ftnlen)2) ==
  798. 0 || s_cmp(c4, "HR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(
  799. c4, "TR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "BR", (
  800. ftnlen)2, (ftnlen)2) == 0) {
  801. nb = 32;
  802. }
  803. } else if (*(unsigned char *)c3 == 'M') {
  804. if (s_cmp(c4, "QR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "RQ",
  805. (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "LQ", (ftnlen)2, (
  806. ftnlen)2) == 0 || s_cmp(c4, "QL", (ftnlen)2, (ftnlen)2) ==
  807. 0 || s_cmp(c4, "HR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(
  808. c4, "TR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "BR", (
  809. ftnlen)2, (ftnlen)2) == 0) {
  810. nb = 32;
  811. }
  812. }
  813. } else if (s_cmp(c2, "GB", (ftnlen)2, (ftnlen)2) == 0) {
  814. if (s_cmp(c3, "TRF", (ftnlen)3, (ftnlen)3) == 0) {
  815. if (sname) {
  816. if (*n4 <= 64) {
  817. nb = 1;
  818. } else {
  819. nb = 32;
  820. }
  821. } else {
  822. if (*n4 <= 64) {
  823. nb = 1;
  824. } else {
  825. nb = 32;
  826. }
  827. }
  828. }
  829. } else if (s_cmp(c2, "PB", (ftnlen)2, (ftnlen)2) == 0) {
  830. if (s_cmp(c3, "TRF", (ftnlen)3, (ftnlen)3) == 0) {
  831. if (sname) {
  832. if (*n2 <= 64) {
  833. nb = 1;
  834. } else {
  835. nb = 32;
  836. }
  837. } else {
  838. if (*n2 <= 64) {
  839. nb = 1;
  840. } else {
  841. nb = 32;
  842. }
  843. }
  844. }
  845. } else if (s_cmp(c2, "TR", (ftnlen)2, (ftnlen)2) == 0) {
  846. if (s_cmp(c3, "TRI", (ftnlen)3, (ftnlen)3) == 0) {
  847. if (sname) {
  848. nb = 64;
  849. } else {
  850. nb = 64;
  851. }
  852. } else if (s_cmp(c3, "EVC", (ftnlen)3, (ftnlen)3) == 0) {
  853. if (sname) {
  854. nb = 64;
  855. } else {
  856. nb = 64;
  857. }
  858. }
  859. } else if (s_cmp(c2, "LA", (ftnlen)2, (ftnlen)2) == 0) {
  860. if (s_cmp(c3, "UUM", (ftnlen)3, (ftnlen)3) == 0) {
  861. if (sname) {
  862. nb = 64;
  863. } else {
  864. nb = 64;
  865. }
  866. }
  867. } else if (sname && s_cmp(c2, "ST", (ftnlen)2, (ftnlen)2) == 0) {
  868. if (s_cmp(c3, "EBZ", (ftnlen)3, (ftnlen)3) == 0) {
  869. nb = 1;
  870. }
  871. } else if (s_cmp(c2, "GG", (ftnlen)2, (ftnlen)2) == 0) {
  872. nb = 32;
  873. if (s_cmp(c3, "HD3", (ftnlen)3, (ftnlen)3) == 0) {
  874. if (sname) {
  875. nb = 32;
  876. } else {
  877. nb = 32;
  878. }
  879. }
  880. }
  881. ret_val = nb;
  882. return ret_val;
  883. L60:
  884. /* ISPEC = 2: minimum block size */
  885. nbmin = 2;
  886. if (s_cmp(c2, "GE", (ftnlen)2, (ftnlen)2) == 0) {
  887. if (s_cmp(c3, "QRF", (ftnlen)3, (ftnlen)3) == 0 || s_cmp(c3, "RQF", (
  888. ftnlen)3, (ftnlen)3) == 0 || s_cmp(c3, "LQF", (ftnlen)3, (
  889. ftnlen)3) == 0 || s_cmp(c3, "QLF", (ftnlen)3, (ftnlen)3) == 0)
  890. {
  891. if (sname) {
  892. nbmin = 2;
  893. } else {
  894. nbmin = 2;
  895. }
  896. } else if (s_cmp(c3, "HRD", (ftnlen)3, (ftnlen)3) == 0) {
  897. if (sname) {
  898. nbmin = 2;
  899. } else {
  900. nbmin = 2;
  901. }
  902. } else if (s_cmp(c3, "BRD", (ftnlen)3, (ftnlen)3) == 0) {
  903. if (sname) {
  904. nbmin = 2;
  905. } else {
  906. nbmin = 2;
  907. }
  908. } else if (s_cmp(c3, "TRI", (ftnlen)3, (ftnlen)3) == 0) {
  909. if (sname) {
  910. nbmin = 2;
  911. } else {
  912. nbmin = 2;
  913. }
  914. }
  915. } else if (s_cmp(c2, "SY", (ftnlen)2, (ftnlen)2) == 0) {
  916. if (s_cmp(c3, "TRF", (ftnlen)3, (ftnlen)3) == 0) {
  917. if (sname) {
  918. nbmin = 8;
  919. } else {
  920. nbmin = 8;
  921. }
  922. } else if (sname && s_cmp(c3, "TRD", (ftnlen)3, (ftnlen)3) == 0) {
  923. nbmin = 2;
  924. }
  925. } else if (cname && s_cmp(c2, "HE", (ftnlen)2, (ftnlen)2) == 0) {
  926. if (s_cmp(c3, "TRD", (ftnlen)3, (ftnlen)3) == 0) {
  927. nbmin = 2;
  928. }
  929. } else if (sname && s_cmp(c2, "OR", (ftnlen)2, (ftnlen)2) == 0) {
  930. if (*(unsigned char *)c3 == 'G') {
  931. if (s_cmp(c4, "QR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "RQ",
  932. (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "LQ", (ftnlen)2, (
  933. ftnlen)2) == 0 || s_cmp(c4, "QL", (ftnlen)2, (ftnlen)2) ==
  934. 0 || s_cmp(c4, "HR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(
  935. c4, "TR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "BR", (
  936. ftnlen)2, (ftnlen)2) == 0) {
  937. nbmin = 2;
  938. }
  939. } else if (*(unsigned char *)c3 == 'M') {
  940. if (s_cmp(c4, "QR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "RQ",
  941. (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "LQ", (ftnlen)2, (
  942. ftnlen)2) == 0 || s_cmp(c4, "QL", (ftnlen)2, (ftnlen)2) ==
  943. 0 || s_cmp(c4, "HR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(
  944. c4, "TR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "BR", (
  945. ftnlen)2, (ftnlen)2) == 0) {
  946. nbmin = 2;
  947. }
  948. }
  949. } else if (cname && s_cmp(c2, "UN", (ftnlen)2, (ftnlen)2) == 0) {
  950. if (*(unsigned char *)c3 == 'G') {
  951. if (s_cmp(c4, "QR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "RQ",
  952. (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "LQ", (ftnlen)2, (
  953. ftnlen)2) == 0 || s_cmp(c4, "QL", (ftnlen)2, (ftnlen)2) ==
  954. 0 || s_cmp(c4, "HR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(
  955. c4, "TR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "BR", (
  956. ftnlen)2, (ftnlen)2) == 0) {
  957. nbmin = 2;
  958. }
  959. } else if (*(unsigned char *)c3 == 'M') {
  960. if (s_cmp(c4, "QR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "RQ",
  961. (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "LQ", (ftnlen)2, (
  962. ftnlen)2) == 0 || s_cmp(c4, "QL", (ftnlen)2, (ftnlen)2) ==
  963. 0 || s_cmp(c4, "HR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(
  964. c4, "TR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "BR", (
  965. ftnlen)2, (ftnlen)2) == 0) {
  966. nbmin = 2;
  967. }
  968. }
  969. } else if (s_cmp(c2, "GG", (ftnlen)2, (ftnlen)2) == 0) {
  970. nbmin = 2;
  971. if (s_cmp(c3, "HD3", (ftnlen)3, (ftnlen)3) == 0) {
  972. nbmin = 2;
  973. }
  974. }
  975. ret_val = nbmin;
  976. return ret_val;
  977. L70:
  978. /* ISPEC = 3: crossover point */
  979. nx = 0;
  980. if (s_cmp(c2, "GE", (ftnlen)2, (ftnlen)2) == 0) {
  981. if (s_cmp(c3, "QRF", (ftnlen)3, (ftnlen)3) == 0 || s_cmp(c3, "RQF", (
  982. ftnlen)3, (ftnlen)3) == 0 || s_cmp(c3, "LQF", (ftnlen)3, (
  983. ftnlen)3) == 0 || s_cmp(c3, "QLF", (ftnlen)3, (ftnlen)3) == 0)
  984. {
  985. if (sname) {
  986. nx = 128;
  987. } else {
  988. nx = 128;
  989. }
  990. } else if (s_cmp(c3, "HRD", (ftnlen)3, (ftnlen)3) == 0) {
  991. if (sname) {
  992. nx = 128;
  993. } else {
  994. nx = 128;
  995. }
  996. } else if (s_cmp(c3, "BRD", (ftnlen)3, (ftnlen)3) == 0) {
  997. if (sname) {
  998. nx = 128;
  999. } else {
  1000. nx = 128;
  1001. }
  1002. }
  1003. } else if (s_cmp(c2, "SY", (ftnlen)2, (ftnlen)2) == 0) {
  1004. if (sname && s_cmp(c3, "TRD", (ftnlen)3, (ftnlen)3) == 0) {
  1005. nx = 32;
  1006. }
  1007. } else if (cname && s_cmp(c2, "HE", (ftnlen)2, (ftnlen)2) == 0) {
  1008. if (s_cmp(c3, "TRD", (ftnlen)3, (ftnlen)3) == 0) {
  1009. nx = 32;
  1010. }
  1011. } else if (sname && s_cmp(c2, "OR", (ftnlen)2, (ftnlen)2) == 0) {
  1012. if (*(unsigned char *)c3 == 'G') {
  1013. if (s_cmp(c4, "QR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "RQ",
  1014. (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "LQ", (ftnlen)2, (
  1015. ftnlen)2) == 0 || s_cmp(c4, "QL", (ftnlen)2, (ftnlen)2) ==
  1016. 0 || s_cmp(c4, "HR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(
  1017. c4, "TR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "BR", (
  1018. ftnlen)2, (ftnlen)2) == 0) {
  1019. nx = 128;
  1020. }
  1021. }
  1022. } else if (cname && s_cmp(c2, "UN", (ftnlen)2, (ftnlen)2) == 0) {
  1023. if (*(unsigned char *)c3 == 'G') {
  1024. if (s_cmp(c4, "QR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "RQ",
  1025. (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "LQ", (ftnlen)2, (
  1026. ftnlen)2) == 0 || s_cmp(c4, "QL", (ftnlen)2, (ftnlen)2) ==
  1027. 0 || s_cmp(c4, "HR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(
  1028. c4, "TR", (ftnlen)2, (ftnlen)2) == 0 || s_cmp(c4, "BR", (
  1029. ftnlen)2, (ftnlen)2) == 0) {
  1030. nx = 128;
  1031. }
  1032. }
  1033. } else if (s_cmp(c2, "GG", (ftnlen)2, (ftnlen)2) == 0) {
  1034. nx = 128;
  1035. if (s_cmp(c3, "HD3", (ftnlen)3, (ftnlen)3) == 0) {
  1036. nx = 128;
  1037. }
  1038. }
  1039. ret_val = nx;
  1040. return ret_val;
  1041. L80:
  1042. /* ISPEC = 4: number of shifts (used by xHSEQR) */
  1043. ret_val = 6;
  1044. return ret_val;
  1045. L90:
  1046. /* ISPEC = 5: minimum column dimension (not used) */
  1047. ret_val = 2;
  1048. return ret_val;
  1049. L100:
  1050. /* ISPEC = 6: crossover point for SVD (used by xGELSS and xGESVD) */
  1051. ret_val = (integer) ((real) f2cmin(*n1,*n2) * 1.6f);
  1052. return ret_val;
  1053. L110:
  1054. /* ISPEC = 7: number of processors (not used) */
  1055. ret_val = 1;
  1056. return ret_val;
  1057. L120:
  1058. /* ISPEC = 8: crossover point for multishift (used by xHSEQR) */
  1059. ret_val = 50;
  1060. return ret_val;
  1061. L130:
  1062. /* ISPEC = 9: maximum size of the subproblems at the bottom of the */
  1063. /* computation tree in the divide-and-conquer algorithm */
  1064. /* (used by xGELSD and xGESDD) */
  1065. ret_val = 25;
  1066. return ret_val;
  1067. L140:
  1068. /* ISPEC = 10: ieee NaN arithmetic can be trusted not to trap */
  1069. /* ILAENV = 0 */
  1070. ret_val = 1;
  1071. if (ret_val == 1) {
  1072. ret_val = ieeeck_(&c__1, &c_b174, &c_b175);
  1073. }
  1074. return ret_val;
  1075. L150:
  1076. /* ISPEC = 11: infinity arithmetic can be trusted not to trap */
  1077. /* ILAENV = 0 */
  1078. ret_val = 1;
  1079. if (ret_val == 1) {
  1080. ret_val = ieeeck_(&c__0, &c_b174, &c_b175);
  1081. }
  1082. return ret_val;
  1083. L160:
  1084. /* 12 <= ISPEC <= 16: xHSEQR or related subroutines. */
  1085. ret_val = iparmq_(ispec, name__, opts, n1, n2, n3, n4)
  1086. ;
  1087. return ret_val;
  1088. /* End of ILAENV */
  1089. } /* ilaenv_ */