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.

c_cblat1c.c 40 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018
  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. #include "common.h"
  13. typedef blasint integer;
  14. typedef unsigned int uinteger;
  15. typedef char *address;
  16. typedef short int shortint;
  17. typedef float real;
  18. typedef double doublereal;
  19. typedef struct { real r, i; } complex;
  20. typedef struct { doublereal r, i; } doublecomplex;
  21. #ifdef _MSC_VER
  22. static inline _Fcomplex Cf(complex *z) {_Fcomplex zz={z->r , z->i}; return zz;}
  23. static inline _Dcomplex Cd(doublecomplex *z) {_Dcomplex zz={z->r , z->i};return zz;}
  24. static inline _Fcomplex * _pCf(complex *z) {return (_Fcomplex*)z;}
  25. static inline _Dcomplex * _pCd(doublecomplex *z) {return (_Dcomplex*)z;}
  26. #else
  27. static inline _Complex float Cf(complex *z) {return z->r + z->i*_Complex_I;}
  28. static inline _Complex double Cd(doublecomplex *z) {return z->r + z->i*_Complex_I;}
  29. static inline _Complex float * _pCf(complex *z) {return (_Complex float*)z;}
  30. static inline _Complex double * _pCd(doublecomplex *z) {return (_Complex double*)z;}
  31. #endif
  32. #define pCf(z) (*_pCf(z))
  33. #define pCd(z) (*_pCd(z))
  34. typedef int logical;
  35. typedef short int shortlogical;
  36. typedef char logical1;
  37. typedef char integer1;
  38. #define TRUE_ (1)
  39. #define FALSE_ (0)
  40. /* Extern is for use with -E */
  41. #ifndef Extern
  42. #define Extern extern
  43. #endif
  44. /* I/O stuff */
  45. typedef int flag;
  46. typedef int ftnlen;
  47. typedef int ftnint;
  48. /*external read, write*/
  49. typedef struct
  50. { flag cierr;
  51. ftnint ciunit;
  52. flag ciend;
  53. char *cifmt;
  54. ftnint cirec;
  55. } cilist;
  56. /*internal read, write*/
  57. typedef struct
  58. { flag icierr;
  59. char *iciunit;
  60. flag iciend;
  61. char *icifmt;
  62. ftnint icirlen;
  63. ftnint icirnum;
  64. } icilist;
  65. /*open*/
  66. typedef struct
  67. { flag oerr;
  68. ftnint ounit;
  69. char *ofnm;
  70. ftnlen ofnmlen;
  71. char *osta;
  72. char *oacc;
  73. char *ofm;
  74. ftnint orl;
  75. char *oblnk;
  76. } olist;
  77. /*close*/
  78. typedef struct
  79. { flag cerr;
  80. ftnint cunit;
  81. char *csta;
  82. } cllist;
  83. /*rewind, backspace, endfile*/
  84. typedef struct
  85. { flag aerr;
  86. ftnint aunit;
  87. } alist;
  88. /* inquire */
  89. typedef struct
  90. { flag inerr;
  91. ftnint inunit;
  92. char *infile;
  93. ftnlen infilen;
  94. ftnint *inex; /*parameters in standard's order*/
  95. ftnint *inopen;
  96. ftnint *innum;
  97. ftnint *innamed;
  98. char *inname;
  99. ftnlen innamlen;
  100. char *inacc;
  101. ftnlen inacclen;
  102. char *inseq;
  103. ftnlen inseqlen;
  104. char *indir;
  105. ftnlen indirlen;
  106. char *infmt;
  107. ftnlen infmtlen;
  108. char *inform;
  109. ftnint informlen;
  110. char *inunf;
  111. ftnlen inunflen;
  112. ftnint *inrecl;
  113. ftnint *innrec;
  114. char *inblank;
  115. ftnlen inblanklen;
  116. } inlist;
  117. #define VOID void
  118. union Multitype { /* for multiple entry points */
  119. integer1 g;
  120. shortint h;
  121. integer i;
  122. /* longint j; */
  123. real r;
  124. doublereal d;
  125. complex c;
  126. doublecomplex z;
  127. };
  128. typedef union Multitype Multitype;
  129. struct Vardesc { /* for Namelist */
  130. char *name;
  131. char *addr;
  132. ftnlen *dims;
  133. int type;
  134. };
  135. typedef struct Vardesc Vardesc;
  136. struct Namelist {
  137. char *name;
  138. Vardesc **vars;
  139. int nvars;
  140. };
  141. typedef struct Namelist Namelist;
  142. #define abs(x) ((x) >= 0 ? (x) : -(x))
  143. #define dabs(x) (fabs(x))
  144. #define f2cmin(a,b) ((a) <= (b) ? (a) : (b))
  145. #define f2cmax(a,b) ((a) >= (b) ? (a) : (b))
  146. #define dmin(a,b) (f2cmin(a,b))
  147. #define dmax(a,b) (f2cmax(a,b))
  148. #define bit_test(a,b) ((a) >> (b) & 1)
  149. #define bit_clear(a,b) ((a) & ~((uinteger)1 << (b)))
  150. #define bit_set(a,b) ((a) | ((uinteger)1 << (b)))
  151. #define abort_() { sig_die("Fortran abort routine called", 1); }
  152. #define c_abs(z) (cabsf(Cf(z)))
  153. #define c_cos(R,Z) { pCf(R)=ccos(Cf(Z)); }
  154. #ifdef _MSC_VER
  155. #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]);}
  156. #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]);}
  157. #else
  158. #define c_div(c, a, b) {pCf(c) = Cf(a)/Cf(b);}
  159. #define z_div(c, a, b) {pCd(c) = Cd(a)/Cd(b);}
  160. #endif
  161. #define c_exp(R, Z) {pCf(R) = cexpf(Cf(Z));}
  162. #define c_log(R, Z) {pCf(R) = clogf(Cf(Z));}
  163. #define c_sin(R, Z) {pCf(R) = csinf(Cf(Z));}
  164. //#define c_sqrt(R, Z) {*(R) = csqrtf(Cf(Z));}
  165. #define c_sqrt(R, Z) {pCf(R) = csqrtf(Cf(Z));}
  166. #define d_abs(x) (fabs(*(x)))
  167. #define d_acos(x) (acos(*(x)))
  168. #define d_asin(x) (asin(*(x)))
  169. #define d_atan(x) (atan(*(x)))
  170. #define d_atn2(x, y) (atan2(*(x),*(y)))
  171. #define d_cnjg(R, Z) { pCd(R) = conj(Cd(Z)); }
  172. #define r_cnjg(R, Z) { pCf(R) = conjf(Cf(Z)); }
  173. #define d_cos(x) (cos(*(x)))
  174. #define d_cosh(x) (cosh(*(x)))
  175. #define d_dim(__a, __b) ( *(__a) > *(__b) ? *(__a) - *(__b) : 0.0 )
  176. #define d_exp(x) (exp(*(x)))
  177. #define d_imag(z) (cimag(Cd(z)))
  178. #define r_imag(z) (cimagf(Cf(z)))
  179. #define d_int(__x) (*(__x)>0 ? floor(*(__x)) : -floor(- *(__x)))
  180. #define r_int(__x) (*(__x)>0 ? floor(*(__x)) : -floor(- *(__x)))
  181. #define d_lg10(x) ( 0.43429448190325182765 * log(*(x)) )
  182. #define r_lg10(x) ( 0.43429448190325182765 * log(*(x)) )
  183. #define d_log(x) (log(*(x)))
  184. #define d_mod(x, y) (fmod(*(x), *(y)))
  185. #define u_nint(__x) ((__x)>=0 ? floor((__x) + .5) : -floor(.5 - (__x)))
  186. #define d_nint(x) u_nint(*(x))
  187. #define u_sign(__a,__b) ((__b) >= 0 ? ((__a) >= 0 ? (__a) : -(__a)) : -((__a) >= 0 ? (__a) : -(__a)))
  188. #define d_sign(a,b) u_sign(*(a),*(b))
  189. #define r_sign(a,b) u_sign(*(a),*(b))
  190. #define d_sin(x) (sin(*(x)))
  191. #define d_sinh(x) (sinh(*(x)))
  192. #define d_sqrt(x) (sqrt(*(x)))
  193. #define d_tan(x) (tan(*(x)))
  194. #define d_tanh(x) (tanh(*(x)))
  195. #define i_abs(x) abs(*(x))
  196. #define i_dnnt(x) ((integer)u_nint(*(x)))
  197. #define i_len(s, n) (n)
  198. #define i_nint(x) ((integer)u_nint(*(x)))
  199. #define i_sign(a,b) ((integer)u_sign((integer)*(a),(integer)*(b)))
  200. #define pow_dd(ap, bp) ( pow(*(ap), *(bp)))
  201. #define pow_si(B,E) spow_ui(*(B),*(E))
  202. #define pow_ri(B,E) spow_ui(*(B),*(E))
  203. #define pow_di(B,E) dpow_ui(*(B),*(E))
  204. #define pow_zi(p, a, b) {pCd(p) = zpow_ui(Cd(a), *(b));}
  205. #define pow_ci(p, a, b) {pCf(p) = cpow_ui(Cf(a), *(b));}
  206. #define pow_zz(R,A,B) {pCd(R) = cpow(Cd(A),*(B));}
  207. #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++ = ' '; }
  208. #define s_cmp(a,b,c,d) ((integer)strncmp((a),(b),f2cmin((c),(d))))
  209. #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]; }
  210. #define sig_die(s, kill) { exit(1); }
  211. #define s_stop(s, n) {exit(0);}
  212. #define z_abs(z) (cabs(Cd(z)))
  213. #define z_exp(R, Z) {pCd(R) = cexp(Cd(Z));}
  214. #define z_sqrt(R, Z) {pCd(R) = csqrt(Cd(Z));}
  215. #define myexit_() break;
  216. #define mycycle_() continue;
  217. #define myceiling_(w) {ceil(w)}
  218. #define myhuge_(w) {HUGE_VAL}
  219. //#define mymaxloc_(w,s,e,n) {if (sizeof(*(w)) == sizeof(double)) dmaxloc_((w),*(s),*(e),n); else dmaxloc_((w),*(s),*(e),n);}
  220. #define mymaxloc_(w,s,e,n) dmaxloc_(w,*(s),*(e),n)
  221. /* procedure parameter types for -A and -C++ */
  222. #define F2C_proc_par_types 1
  223. /* Common Block Declarations */
  224. struct {
  225. integer icase, n, incx, incy, mode;
  226. logical pass;
  227. } combla_;
  228. #define combla_1 combla_
  229. /* Table of constant values */
  230. static integer c__1 = 1;
  231. static integer c__5 = 5;
  232. static real c_b43 = (float)1.;
  233. /* Main program */ int main(void)
  234. {
  235. /* Initialized data */
  236. static real sfac = (float)9.765625e-4;
  237. /* Local variables */
  238. extern /* Subroutine */ int check1_(real*), check2_(real*);
  239. static integer ic;
  240. extern /* Subroutine */ int header_(void);
  241. /* Test program for the COMPLEX Level 1 CBLAS. */
  242. /* Based upon the original CBLAS test routine together with: */
  243. /* F06GAF Example Program Text */
  244. /* .. Parameters .. */
  245. /* .. Scalars in Common .. */
  246. /* .. Local Scalars .. */
  247. /* .. External Subroutines .. */
  248. /* .. Common blocks .. */
  249. /* .. Data statements .. */
  250. /* .. Executable Statements .. */
  251. printf("Complex CBLAS Test Program Results\n");
  252. for (ic = 1; ic <= 10; ++ic) {
  253. combla_1.icase = ic;
  254. header_();
  255. /* Initialize PASS, INCX, INCY, and MODE for a new case. */
  256. /* The value 9999 for INCX, INCY or MODE will appear in the */
  257. /* detailed output, if any, for cases that do not involve */
  258. /* these parameters. */
  259. combla_1.pass = TRUE_;
  260. combla_1.incx = 9999;
  261. combla_1.incy = 9999;
  262. combla_1.mode = 9999;
  263. if (combla_1.icase <= 5) {
  264. check2_(&sfac);
  265. } else if (combla_1.icase >= 6) {
  266. check1_(&sfac);
  267. }
  268. /* -- Print */
  269. if (combla_1.pass) {
  270. printf(" ----- PASS -----\n");
  271. }
  272. /* L20: */
  273. }
  274. exit(0);
  275. } /* MAIN__ */
  276. /* Subroutine */ int header_(void)
  277. {
  278. /* Initialized data */
  279. static char l[15][13] = {"CBLAS_CDOTC " , "CBLAS_CDOTU " , "CBLAS_CAXPY " ,
  280. "CBLAS_CCOPY " , "CBLAS_CSWAP " , "CBLAS_SCNRM2" , "CBLAS_SCASUM" , "CBLAS_CSCAL " ,
  281. "CBLAS_CSSCAL" , "CBLAS_ICAMAX" };
  282. /* Format strings */
  283. /* Builtin functions */
  284. integer s_wsfe(void), do_fio(void), e_wsfe(void);
  285. /* .. Parameters .. */
  286. /* .. Scalars in Common .. */
  287. /* .. Local Arrays .. */
  288. /* .. Common blocks .. */
  289. /* .. Data statements .. */
  290. /* .. Executable Statements .. */
  291. printf("Test of subprogram number %3d %15s", combla_1.icase, l[combla_1.icase - 1]);
  292. return 0;
  293. } /* header_ */
  294. /* Subroutine */ int check1_(real* sfac)
  295. {
  296. /* Initialized data */
  297. static real strue2[5] = { (float)0.,(float).5,(float).6,(float).7,(float)
  298. .7 };
  299. static real strue4[5] = { (float)0.,(float).7,(float)1.,(float)1.3,(float)
  300. 1.7 };
  301. static complex ctrue5[80] /* was [8][5][2] */ = { {(float).1,(float).1},
  302. {(float)1.,(float)2.},{(float)1.,(float)2.},{(float)1.,(float)2.},
  303. {(float)1.,(float)2.},{(float)1.,(float)2.},{(float)1.,(float)2.},
  304. {(float)1.,(float)2.},{(float)-.16,(float)-.37},{(float)3.,(float)
  305. 4.},{(float)3.,(float)4.},{(float)3.,(float)4.},{(float)3.,(float)
  306. 4.},{(float)3.,(float)4.},{(float)3.,(float)4.},{(float)3.,(float)
  307. 4.},{(float)-.17,(float)-.19},{(float).13,(float)-.39},{(float)5.,
  308. (float)6.},{(float)5.,(float)6.},{(float)5.,(float)6.},{(float)5.,
  309. (float)6.},{(float)5.,(float)6.},{(float)5.,(float)6.},{(float)
  310. .11,(float)-.03},{(float)-.17,(float).46},{(float)-.17,(float)
  311. -.19},{(float)7.,(float)8.},{(float)7.,(float)8.},{(float)7.,(
  312. float)8.},{(float)7.,(float)8.},{(float)7.,(float)8.},{(float).19,
  313. (float)-.17},{(float).32,(float).09},{(float).23,(float)-.24},{(
  314. float).18,(float).01},{(float)2.,(float)3.},{(float)2.,(float)3.},
  315. {(float)2.,(float)3.},{(float)2.,(float)3.},{(float).1,(float).1},
  316. {(float)4.,(float)5.},{(float)4.,(float)5.},{(float)4.,(float)5.},
  317. {(float)4.,(float)5.},{(float)4.,(float)5.},{(float)4.,(float)5.},
  318. {(float)4.,(float)5.},{(float)-.16,(float)-.37},{(float)6.,(float)
  319. 7.},{(float)6.,(float)7.},{(float)6.,(float)7.},{(float)6.,(float)
  320. 7.},{(float)6.,(float)7.},{(float)6.,(float)7.},{(float)6.,(float)
  321. 7.},{(float)-.17,(float)-.19},{(float)8.,(float)9.},{(float).13,(
  322. float)-.39},{(float)2.,(float)5.},{(float)2.,(float)5.},{(float)
  323. 2.,(float)5.},{(float)2.,(float)5.},{(float)2.,(float)5.},{(float)
  324. .11,(float)-.03},{(float)3.,(float)6.},{(float)-.17,(float).46},{(
  325. float)4.,(float)7.},{(float)-.17,(float)-.19},{(float)7.,(float)
  326. 2.},{(float)7.,(float)2.},{(float)7.,(float)2.},{(float).19,(
  327. float)-.17},{(float)5.,(float)8.},{(float).32,(float).09},{(float)
  328. 6.,(float)9.},{(float).23,(float)-.24},{(float)8.,(float)3.},{(
  329. float).18,(float).01},{(float)9.,(float)4.} };
  330. static complex ctrue6[80] /* was [8][5][2] */ = { {(float).1,(float).1},
  331. {(float)1.,(float)2.},{(float)1.,(float)2.},{(float)1.,(float)2.},
  332. {(float)1.,(float)2.},{(float)1.,(float)2.},{(float)1.,(float)2.},
  333. {(float)1.,(float)2.},{(float).09,(float)-.12},{(float)3.,(float)
  334. 4.},{(float)3.,(float)4.},{(float)3.,(float)4.},{(float)3.,(float)
  335. 4.},{(float)3.,(float)4.},{(float)3.,(float)4.},{(float)3.,(float)
  336. 4.},{(float).03,(float)-.09},{(float).15,(float)-.03},{(float)5.,(
  337. float)6.},{(float)5.,(float)6.},{(float)5.,(float)6.},{(float)5.,(
  338. float)6.},{(float)5.,(float)6.},{(float)5.,(float)6.},{(float).03,
  339. (float).03},{(float)-.18,(float).03},{(float).03,(float)-.09},{(
  340. float)7.,(float)8.},{(float)7.,(float)8.},{(float)7.,(float)8.},{(
  341. float)7.,(float)8.},{(float)7.,(float)8.},{(float).09,(float).03},
  342. {(float).03,(float).12},{(float).12,(float).03},{(float).03,(
  343. float).06},{(float)2.,(float)3.},{(float)2.,(float)3.},{(float)2.,
  344. (float)3.},{(float)2.,(float)3.},{(float).1,(float).1},{(float)4.,
  345. (float)5.},{(float)4.,(float)5.},{(float)4.,(float)5.},{(float)4.,
  346. (float)5.},{(float)4.,(float)5.},{(float)4.,(float)5.},{(float)4.,
  347. (float)5.},{(float).09,(float)-.12},{(float)6.,(float)7.},{(float)
  348. 6.,(float)7.},{(float)6.,(float)7.},{(float)6.,(float)7.},{(float)
  349. 6.,(float)7.},{(float)6.,(float)7.},{(float)6.,(float)7.},{(float)
  350. .03,(float)-.09},{(float)8.,(float)9.},{(float).15,(float)-.03},{(
  351. float)2.,(float)5.},{(float)2.,(float)5.},{(float)2.,(float)5.},{(
  352. float)2.,(float)5.},{(float)2.,(float)5.},{(float).03,(float).03},
  353. {(float)3.,(float)6.},{(float)-.18,(float).03},{(float)4.,(float)
  354. 7.},{(float).03,(float)-.09},{(float)7.,(float)2.},{(float)7.,(
  355. float)2.},{(float)7.,(float)2.},{(float).09,(float).03},{(float)
  356. 5.,(float)8.},{(float).03,(float).12},{(float)6.,(float)9.},{(
  357. float).12,(float).03},{(float)8.,(float)3.},{(float).03,(float)
  358. .06},{(float)9.,(float)4.} };
  359. static integer itrue3[5] = { 0,1,2,2,2 };
  360. static real sa = (float).3;
  361. static complex ca = {(float).4,(float)-.7};
  362. static complex cv[80] /* was [8][5][2] */ = { {(float).1,(float).1},
  363. {(float)1.,(float)2.},{(float)1.,(float)2.},{(float)1.,(float)2.},
  364. {(float)1.,(float)2.},{(float)1.,(float)2.},{(float)1.,(float)2.},
  365. {(float)1.,(float)2.},{(float).3,(float)-.4},{(float)3.,(float)4.}
  366. ,{(float)3.,(float)4.},{(float)3.,(float)4.},{(float)3.,(float)4.}
  367. ,{(float)3.,(float)4.},{(float)3.,(float)4.},{(float)3.,(float)4.}
  368. ,{(float).1,(float)-.3},{(float).5,(float)-.1},{(float)5.,(float)
  369. 6.},{(float)5.,(float)6.},{(float)5.,(float)6.},{(float)5.,(float)
  370. 6.},{(float)5.,(float)6.},{(float)5.,(float)6.},{(float).1,(float)
  371. .1},{(float)-.6,(float).1},{(float).1,(float)-.3},{(float)7.,(
  372. float)8.},{(float)7.,(float)8.},{(float)7.,(float)8.},{(float)7.,(
  373. float)8.},{(float)7.,(float)8.},{(float).3,(float).1},{(float).1,(
  374. float).4},{(float).4,(float).1},{(float).1,(float).2},{(float)2.,(
  375. float)3.},{(float)2.,(float)3.},{(float)2.,(float)3.},{(float)2.,(
  376. float)3.},{(float).1,(float).1},{(float)4.,(float)5.},{(float)4.,(
  377. float)5.},{(float)4.,(float)5.},{(float)4.,(float)5.},{(float)4.,(
  378. float)5.},{(float)4.,(float)5.},{(float)4.,(float)5.},{(float).3,(
  379. float)-.4},{(float)6.,(float)7.},{(float)6.,(float)7.},{(float)6.,
  380. (float)7.},{(float)6.,(float)7.},{(float)6.,(float)7.},{(float)6.,
  381. (float)7.},{(float)6.,(float)7.},{(float).1,(float)-.3},{(float)
  382. 8.,(float)9.},{(float).5,(float)-.1},{(float)2.,(float)5.},{(
  383. float)2.,(float)5.},{(float)2.,(float)5.},{(float)2.,(float)5.},{(
  384. float)2.,(float)5.},{(float).1,(float).1},{(float)3.,(float)6.},{(
  385. float)-.6,(float).1},{(float)4.,(float)7.},{(float).1,(float)-.3},
  386. {(float)7.,(float)2.},{(float)7.,(float)2.},{(float)7.,(float)2.},
  387. {(float).3,(float).1},{(float)5.,(float)8.},{(float).1,(float).4},
  388. {(float)6.,(float)9.},{(float).4,(float).1},{(float)8.,(float)3.},
  389. {(float).1,(float).2},{(float)9.,(float)4.} };
  390. /* System generated locals */
  391. integer i__1, i__2, i__3;
  392. real r__1;
  393. complex q__1;
  394. /* Local variables */
  395. static integer i__;
  396. extern /* Subroutine */ int ctest_(int*, complex*, complex*, complex*, real*);
  397. static complex mwpcs[5], mwpct[5];
  398. extern /* Subroutine */ int itest1_(int*, int*), stest1_(real*,real*,real*,real*);
  399. static complex cx[8];
  400. extern real scnrm2test_(int*, complex*, int*);
  401. static integer np1;
  402. extern integer icamaxtest_(int*, complex*, int*);
  403. extern /* Subroutine */ int csscaltest_(int*, real*, complex*, int*);
  404. extern real scasumtest_(int*, complex*, int*);
  405. static integer len;
  406. /* .. Parameters .. */
  407. /* .. Scalar Arguments .. */
  408. /* .. Scalars in Common .. */
  409. /* .. Local Scalars .. */
  410. /* .. Local Arrays .. */
  411. /* .. External Functions .. */
  412. /* .. External Subroutines .. */
  413. /* .. Intrinsic Functions .. */
  414. /* .. Common blocks .. */
  415. /* .. Data statements .. */
  416. /* .. Executable Statements .. */
  417. for (combla_1.incx = 1; combla_1.incx <= 2; ++combla_1.incx) {
  418. for (np1 = 1; np1 <= 5; ++np1) {
  419. combla_1.n = np1 - 1;
  420. len = f2cmax(combla_1.n,1) << 1;
  421. /* .. Set vector arguments .. */
  422. i__1 = len;
  423. for (i__ = 1; i__ <= i__1; ++i__) {
  424. i__2 = i__ - 1;
  425. i__3 = i__ + (np1 + combla_1.incx * 5 << 3) - 49;
  426. cx[i__2].r = cv[i__3].r, cx[i__2].i = cv[i__3].i;
  427. /* L20: */
  428. }
  429. if (combla_1.icase == 6) {
  430. /* .. SCNRM2TEST .. */
  431. r__1 = scnrm2test_(&combla_1.n, cx, &combla_1.incx);
  432. stest1_(&r__1, &strue2[np1 - 1], &strue2[np1 - 1], sfac);
  433. } else if (combla_1.icase == 7) {
  434. /* .. SCASUMTEST .. */
  435. r__1 = scasumtest_(&combla_1.n, cx, &combla_1.incx);
  436. stest1_(&r__1, &strue4[np1 - 1], &strue4[np1 - 1], sfac);
  437. } else if (combla_1.icase == 8) {
  438. /* .. CSCAL .. */
  439. cscal_(&combla_1.n, &ca, cx, &combla_1.incx);
  440. ctest_(&len, cx, &ctrue5[(np1 + combla_1.incx * 5 << 3) - 48],
  441. &ctrue5[(np1 + combla_1.incx * 5 << 3) - 48], sfac);
  442. } else if (combla_1.icase == 9) {
  443. /* .. CSSCALTEST .. */
  444. csscaltest_(&combla_1.n, &sa, cx, &combla_1.incx);
  445. ctest_(&len, cx, &ctrue6[(np1 + combla_1.incx * 5 << 3) - 48],
  446. &ctrue6[(np1 + combla_1.incx * 5 << 3) - 48], sfac);
  447. } else if (combla_1.icase == 10) {
  448. /* .. ICAMAXTEST .. */
  449. i__1 = icamaxtest_(&combla_1.n, cx, &combla_1.incx);
  450. itest1_(&i__1, &itrue3[np1 - 1]);
  451. } else {
  452. fprintf(stderr,"Shouldn't be here in CHECK1\n");
  453. exit(0);
  454. }
  455. /* L40: */
  456. }
  457. /* L60: */
  458. }
  459. combla_1.incx = 1;
  460. if (combla_1.icase == 8) {
  461. /* CSCAL */
  462. /* Add a test for alpha equal to zero. */
  463. ca.r = (float)0., ca.i = (float)0.;
  464. for (i__ = 1; i__ <= 5; ++i__) {
  465. i__1 = i__ - 1;
  466. mwpct[i__1].r = (float)0., mwpct[i__1].i = (float)0.;
  467. i__1 = i__ - 1;
  468. mwpcs[i__1].r = (float)1., mwpcs[i__1].i = (float)1.;
  469. /* L80: */
  470. }
  471. cscal_(&c__5, &ca, cx, &combla_1.incx);
  472. ctest_(&c__5, cx, mwpct, mwpcs, sfac);
  473. } else if (combla_1.icase == 9) {
  474. /* CSSCALTEST */
  475. /* Add a test for alpha equal to zero. */
  476. sa = (float)0.;
  477. for (i__ = 1; i__ <= 5; ++i__) {
  478. i__1 = i__ - 1;
  479. mwpct[i__1].r = (float)0., mwpct[i__1].i = (float)0.;
  480. i__1 = i__ - 1;
  481. mwpcs[i__1].r = (float)1., mwpcs[i__1].i = (float)1.;
  482. /* L100: */
  483. }
  484. csscaltest_(&c__5, &sa, cx, &combla_1.incx);
  485. ctest_(&c__5, cx, mwpct, mwpcs, sfac);
  486. /* Add a test for alpha equal to one. */
  487. sa = (float)1.;
  488. for (i__ = 1; i__ <= 5; ++i__) {
  489. i__1 = i__ - 1;
  490. i__2 = i__ - 1;
  491. mwpct[i__1].r = cx[i__2].r, mwpct[i__1].i = cx[i__2].i;
  492. i__1 = i__ - 1;
  493. i__2 = i__ - 1;
  494. mwpcs[i__1].r = cx[i__2].r, mwpcs[i__1].i = cx[i__2].i;
  495. /* L120: */
  496. }
  497. csscaltest_(&c__5, &sa, cx, &combla_1.incx);
  498. ctest_(&c__5, cx, mwpct, mwpcs, sfac);
  499. /* Add a test for alpha equal to minus one. */
  500. sa = (float)-1.;
  501. for (i__ = 1; i__ <= 5; ++i__) {
  502. i__1 = i__ - 1;
  503. i__2 = i__ - 1;
  504. q__1.r = -cx[i__2].r, q__1.i = -cx[i__2].i;
  505. mwpct[i__1].r = q__1.r, mwpct[i__1].i = q__1.i;
  506. i__1 = i__ - 1;
  507. i__2 = i__ - 1;
  508. q__1.r = -cx[i__2].r, q__1.i = -cx[i__2].i;
  509. mwpcs[i__1].r = q__1.r, mwpcs[i__1].i = q__1.i;
  510. /* L140: */
  511. }
  512. csscaltest_(&c__5, &sa, cx, &combla_1.incx);
  513. ctest_(&c__5, cx, mwpct, mwpcs, sfac);
  514. }
  515. return 0;
  516. } /* check1_ */
  517. /* Subroutine */ int check2_(real* sfac)
  518. {
  519. /* Initialized data */
  520. static complex ca = {(float).4,(float)-.7};
  521. static integer incxs[4] = { 1,2,-2,-1 };
  522. static integer incys[4] = { 1,-2,1,-2 };
  523. static integer lens[8] /* was [4][2] */ = { 1,1,2,4,1,1,3,7 };
  524. static integer ns[4] = { 0,1,2,4 };
  525. static complex cx1[7] = { {(float).7,(float)-.8},{(float)-.4,(float)-.7},{
  526. (float)-.1,(float)-.9},{(float).2,(float)-.8},{(float)-.9,(float)
  527. -.4},{(float).1,(float).4},{(float)-.6,(float).6} };
  528. static complex cy1[7] = { {(float).6,(float)-.6},{(float)-.9,(float).5},{(
  529. float).7,(float)-.6},{(float).1,(float)-.5},{(float)-.1,(float)
  530. -.2},{(float)-.5,(float)-.3},{(float).8,(float)-.7} };
  531. static complex ct8[112] /* was [7][4][4] */ = { {(float).6,(float)-.6}
  532. ,{(float)0.,(float)0.},{(float)0.,(float)0.},{(float)0.,(float)0.}
  533. ,{(float)0.,(float)0.},{(float)0.,(float)0.},{(float)0.,(float)0.}
  534. ,{(float).32,(float)-1.41},{(float)0.,(float)0.},{(float)0.,(
  535. float)0.},{(float)0.,(float)0.},{(float)0.,(float)0.},{(float)0.,(
  536. float)0.},{(float)0.,(float)0.},{(float).32,(float)-1.41},{(float)
  537. -1.55,(float).5},{(float)0.,(float)0.},{(float)0.,(float)0.},{(
  538. float)0.,(float)0.},{(float)0.,(float)0.},{(float)0.,(float)0.},{(
  539. float).32,(float)-1.41},{(float)-1.55,(float).5},{(float).03,(
  540. float)-.89},{(float)-.38,(float)-.96},{(float)0.,(float)0.},{(
  541. float)0.,(float)0.},{(float)0.,(float)0.},{(float).6,(float)-.6},{
  542. (float)0.,(float)0.},{(float)0.,(float)0.},{(float)0.,(float)0.},{
  543. (float)0.,(float)0.},{(float)0.,(float)0.},{(float)0.,(float)0.},{
  544. (float).32,(float)-1.41},{(float)0.,(float)0.},{(float)0.,(float)
  545. 0.},{(float)0.,(float)0.},{(float)0.,(float)0.},{(float)0.,(float)
  546. 0.},{(float)0.,(float)0.},{(float)-.07,(float)-.89},{(float)-.9,(
  547. float).5},{(float).42,(float)-1.41},{(float)0.,(float)0.},{(float)
  548. 0.,(float)0.},{(float)0.,(float)0.},{(float)0.,(float)0.},{(float)
  549. .78,(float).06},{(float)-.9,(float).5},{(float).06,(float)-.13},{(
  550. float).1,(float)-.5},{(float)-.77,(float)-.49},{(float)-.5,(float)
  551. -.3},{(float).52,(float)-1.51},{(float).6,(float)-.6},{(float)0.,(
  552. float)0.},{(float)0.,(float)0.},{(float)0.,(float)0.},{(float)0.,(
  553. float)0.},{(float)0.,(float)0.},{(float)0.,(float)0.},{(float).32,
  554. (float)-1.41},{(float)0.,(float)0.},{(float)0.,(float)0.},{(float)
  555. 0.,(float)0.},{(float)0.,(float)0.},{(float)0.,(float)0.},{(float)
  556. 0.,(float)0.},{(float)-.07,(float)-.89},{(float)-1.18,(float)-.31}
  557. ,{(float)0.,(float)0.},{(float)0.,(float)0.},{(float)0.,(float)0.}
  558. ,{(float)0.,(float)0.},{(float)0.,(float)0.},{(float).78,(float)
  559. .06},{(float)-1.54,(float).97},{(float).03,(float)-.89},{(float)
  560. -.18,(float)-1.31},{(float)0.,(float)0.},{(float)0.,(float)0.},{(
  561. float)0.,(float)0.},{(float).6,(float)-.6},{(float)0.,(float)0.},{
  562. (float)0.,(float)0.},{(float)0.,(float)0.},{(float)0.,(float)0.},{
  563. (float)0.,(float)0.},{(float)0.,(float)0.},{(float).32,(float)
  564. -1.41},{(float)0.,(float)0.},{(float)0.,(float)0.},{(float)0.,(
  565. float)0.},{(float)0.,(float)0.},{(float)0.,(float)0.},{(float)0.,(
  566. float)0.},{(float).32,(float)-1.41},{(float)-.9,(float).5},{(
  567. float).05,(float)-.6},{(float)0.,(float)0.},{(float)0.,(float)0.},
  568. {(float)0.,(float)0.},{(float)0.,(float)0.},{(float).32,(float)
  569. -1.41},{(float)-.9,(float).5},{(float).05,(float)-.6},{(float).1,(
  570. float)-.5},{(float)-.77,(float)-.49},{(float)-.5,(float)-.3},{(
  571. float).32,(float)-1.16} };
  572. static complex ct7[16] /* was [4][4] */ = { {(float)0.,(float)0.},{(
  573. float)-.06,(float)-.9},{(float).65,(float)-.47},{(float)-.34,(
  574. float)-1.22},{(float)0.,(float)0.},{(float)-.06,(float)-.9},{(
  575. float)-.59,(float)-1.46},{(float)-1.04,(float)-.04},{(float)0.,(
  576. float)0.},{(float)-.06,(float)-.9},{(float)-.83,(float).59},{(
  577. float).07,(float)-.37},{(float)0.,(float)0.},{(float)-.06,(float)
  578. -.9},{(float)-.76,(float)-1.15},{(float)-1.33,(float)-1.82} };
  579. static complex ct6[16] /* was [4][4] */ = { {(float)0.,(float)0.},{(
  580. float).9,(float).06},{(float).91,(float)-.77},{(float)1.8,(float)
  581. -.1},{(float)0.,(float)0.},{(float).9,(float).06},{(float)1.45,(
  582. float).74},{(float).2,(float).9},{(float)0.,(float)0.},{(float).9,
  583. (float).06},{(float)-.55,(float).23},{(float).83,(float)-.39},{(
  584. float)0.,(float)0.},{(float).9,(float).06},{(float)1.04,(float)
  585. .79},{(float)1.95,(float)1.22} };
  586. static complex ct10x[112] /* was [7][4][4] */ = { {(float).7,(float)-.8}
  587. ,{(float)0.,(float)0.},{(float)0.,(float)0.},{(float)0.,(float)0.}
  588. ,{(float)0.,(float)0.},{(float)0.,(float)0.},{(float)0.,(float)0.}
  589. ,{(float).6,(float)-.6},{(float)0.,(float)0.},{(float)0.,(float)
  590. 0.},{(float)0.,(float)0.},{(float)0.,(float)0.},{(float)0.,(float)
  591. 0.},{(float)0.,(float)0.},{(float).6,(float)-.6},{(float)-.9,(
  592. float).5},{(float)0.,(float)0.},{(float)0.,(float)0.},{(float)0.,(
  593. float)0.},{(float)0.,(float)0.},{(float)0.,(float)0.},{(float).6,(
  594. float)-.6},{(float)-.9,(float).5},{(float).7,(float)-.6},{(float)
  595. .1,(float)-.5},{(float)0.,(float)0.},{(float)0.,(float)0.},{(
  596. float)0.,(float)0.},{(float).7,(float)-.8},{(float)0.,(float)0.},{
  597. (float)0.,(float)0.},{(float)0.,(float)0.},{(float)0.,(float)0.},{
  598. (float)0.,(float)0.},{(float)0.,(float)0.},{(float).6,(float)-.6},
  599. {(float)0.,(float)0.},{(float)0.,(float)0.},{(float)0.,(float)0.},
  600. {(float)0.,(float)0.},{(float)0.,(float)0.},{(float)0.,(float)0.},
  601. {(float).7,(float)-.6},{(float)-.4,(float)-.7},{(float).6,(float)
  602. -.6},{(float)0.,(float)0.},{(float)0.,(float)0.},{(float)0.,(
  603. float)0.},{(float)0.,(float)0.},{(float).8,(float)-.7},{(float)
  604. -.4,(float)-.7},{(float)-.1,(float)-.2},{(float).2,(float)-.8},{(
  605. float).7,(float)-.6},{(float).1,(float).4},{(float).6,(float)-.6},
  606. {(float).7,(float)-.8},{(float)0.,(float)0.},{(float)0.,(float)0.}
  607. ,{(float)0.,(float)0.},{(float)0.,(float)0.},{(float)0.,(float)0.}
  608. ,{(float)0.,(float)0.},{(float).6,(float)-.6},{(float)0.,(float)
  609. 0.},{(float)0.,(float)0.},{(float)0.,(float)0.},{(float)0.,(float)
  610. 0.},{(float)0.,(float)0.},{(float)0.,(float)0.},{(float)-.9,(
  611. float).5},{(float)-.4,(float)-.7},{(float).6,(float)-.6},{(float)
  612. 0.,(float)0.},{(float)0.,(float)0.},{(float)0.,(float)0.},{(float)
  613. 0.,(float)0.},{(float).1,(float)-.5},{(float)-.4,(float)-.7},{(
  614. float).7,(float)-.6},{(float).2,(float)-.8},{(float)-.9,(float).5}
  615. ,{(float).1,(float).4},{(float).6,(float)-.6},{(float).7,(float)
  616. -.8},{(float)0.,(float)0.},{(float)0.,(float)0.},{(float)0.,(
  617. float)0.},{(float)0.,(float)0.},{(float)0.,(float)0.},{(float)0.,(
  618. float)0.},{(float).6,(float)-.6},{(float)0.,(float)0.},{(float)0.,
  619. (float)0.},{(float)0.,(float)0.},{(float)0.,(float)0.},{(float)0.,
  620. (float)0.},{(float)0.,(float)0.},{(float).6,(float)-.6},{(float)
  621. .7,(float)-.6},{(float)0.,(float)0.},{(float)0.,(float)0.},{(
  622. float)0.,(float)0.},{(float)0.,(float)0.},{(float)0.,(float)0.},{(
  623. float).6,(float)-.6},{(float).7,(float)-.6},{(float)-.1,(float)
  624. -.2},{(float).8,(float)-.7},{(float)0.,(float)0.},{(float)0.,(
  625. float)0.},{(float)0.,(float)0.} };
  626. static complex ct10y[112] /* was [7][4][4] */ = { {(float).6,(float)-.6}
  627. ,{(float)0.,(float)0.},{(float)0.,(float)0.},{(float)0.,(float)0.}
  628. ,{(float)0.,(float)0.},{(float)0.,(float)0.},{(float)0.,(float)0.}
  629. ,{(float).7,(float)-.8},{(float)0.,(float)0.},{(float)0.,(float)
  630. 0.},{(float)0.,(float)0.},{(float)0.,(float)0.},{(float)0.,(float)
  631. 0.},{(float)0.,(float)0.},{(float).7,(float)-.8},{(float)-.4,(
  632. float)-.7},{(float)0.,(float)0.},{(float)0.,(float)0.},{(float)0.,
  633. (float)0.},{(float)0.,(float)0.},{(float)0.,(float)0.},{(float).7,
  634. (float)-.8},{(float)-.4,(float)-.7},{(float)-.1,(float)-.9},{(
  635. float).2,(float)-.8},{(float)0.,(float)0.},{(float)0.,(float)0.},{
  636. (float)0.,(float)0.},{(float).6,(float)-.6},{(float)0.,(float)0.},
  637. {(float)0.,(float)0.},{(float)0.,(float)0.},{(float)0.,(float)0.},
  638. {(float)0.,(float)0.},{(float)0.,(float)0.},{(float).7,(float)-.8}
  639. ,{(float)0.,(float)0.},{(float)0.,(float)0.},{(float)0.,(float)0.}
  640. ,{(float)0.,(float)0.},{(float)0.,(float)0.},{(float)0.,(float)0.}
  641. ,{(float)-.1,(float)-.9},{(float)-.9,(float).5},{(float).7,(float)
  642. -.8},{(float)0.,(float)0.},{(float)0.,(float)0.},{(float)0.,(
  643. float)0.},{(float)0.,(float)0.},{(float)-.6,(float).6},{(float)
  644. -.9,(float).5},{(float)-.9,(float)-.4},{(float).1,(float)-.5},{(
  645. float)-.1,(float)-.9},{(float)-.5,(float)-.3},{(float).7,(float)
  646. -.8},{(float).6,(float)-.6},{(float)0.,(float)0.},{(float)0.,(
  647. float)0.},{(float)0.,(float)0.},{(float)0.,(float)0.},{(float)0.,(
  648. float)0.},{(float)0.,(float)0.},{(float).7,(float)-.8},{(float)0.,
  649. (float)0.},{(float)0.,(float)0.},{(float)0.,(float)0.},{(float)0.,
  650. (float)0.},{(float)0.,(float)0.},{(float)0.,(float)0.},{(float)
  651. -.1,(float)-.9},{(float).7,(float)-.8},{(float)0.,(float)0.},{(
  652. float)0.,(float)0.},{(float)0.,(float)0.},{(float)0.,(float)0.},{(
  653. float)0.,(float)0.},{(float)-.6,(float).6},{(float)-.9,(float)-.4}
  654. ,{(float)-.1,(float)-.9},{(float).7,(float)-.8},{(float)0.,(float)
  655. 0.},{(float)0.,(float)0.},{(float)0.,(float)0.},{(float).6,(float)
  656. -.6},{(float)0.,(float)0.},{(float)0.,(float)0.},{(float)0.,(
  657. float)0.},{(float)0.,(float)0.},{(float)0.,(float)0.},{(float)0.,(
  658. float)0.},{(float).7,(float)-.8},{(float)0.,(float)0.},{(float)0.,
  659. (float)0.},{(float)0.,(float)0.},{(float)0.,(float)0.},{(float)0.,
  660. (float)0.},{(float)0.,(float)0.},{(float).7,(float)-.8},{(float)
  661. -.9,(float).5},{(float)-.4,(float)-.7},{(float)0.,(float)0.},{(
  662. float)0.,(float)0.},{(float)0.,(float)0.},{(float)0.,(float)0.},{(
  663. float).7,(float)-.8},{(float)-.9,(float).5},{(float)-.4,(float)
  664. -.7},{(float).1,(float)-.5},{(float)-.1,(float)-.9},{(float)-.5,(
  665. float)-.3},{(float).2,(float)-.8} };
  666. static complex csize1[4] = { {(float)0.,(float)0.},{(float).9,(float).9},{
  667. (float)1.63,(float)1.73},{(float)2.9,(float)2.78} };
  668. static complex csize3[14] = { {(float)0.,(float)0.},{(float)0.,(float)0.},
  669. {(float)0.,(float)0.},{(float)0.,(float)0.},{(float)0.,(float)0.},
  670. {(float)0.,(float)0.},{(float)0.,(float)0.},{(float)1.17,(float)
  671. 1.17},{(float)1.17,(float)1.17},{(float)1.17,(float)1.17},{(float)
  672. 1.17,(float)1.17},{(float)1.17,(float)1.17},{(float)1.17,(float)
  673. 1.17},{(float)1.17,(float)1.17} };
  674. static complex csize2[14] /* was [7][2] */ = { {(float)0.,(float)0.},{(
  675. float)0.,(float)0.},{(float)0.,(float)0.},{(float)0.,(float)0.},{(
  676. float)0.,(float)0.},{(float)0.,(float)0.},{(float)0.,(float)0.},{(
  677. float)1.54,(float)1.54},{(float)1.54,(float)1.54},{(float)1.54,(
  678. float)1.54},{(float)1.54,(float)1.54},{(float)1.54,(float)1.54},{(
  679. float)1.54,(float)1.54},{(float)1.54,(float)1.54} };
  680. /* System generated locals */
  681. integer i__1, i__2;
  682. /* Local variables */
  683. static complex cdot[1];
  684. static integer lenx, leny, i__;
  685. static complex ctemp;
  686. extern /* Subroutine */ int ctest_(int*, complex*, complex*, complex*, real*);
  687. static integer ksize;
  688. extern /* Subroutine */ int cdotctest_(int*, complex*, int*, complex*, int*,complex*), ccopytest_(int*, complex*, int*, complex*, int*), cdotutest_(int*, complex*, int*, complex*, int*, complex*),
  689. cswaptest_(int*, complex*, int*, complex*, int*), caxpytest_(int*, complex*, complex*, int*, complex*, int*);
  690. static integer ki, kn;
  691. static complex cx[7], cy[7];
  692. static integer mx, my;
  693. /* .. Parameters .. */
  694. /* .. Scalar Arguments .. */
  695. /* .. Scalars in Common .. */
  696. /* .. Local Scalars .. */
  697. /* .. Local Arrays .. */
  698. /* .. External Functions .. */
  699. /* .. External Subroutines .. */
  700. /* .. Intrinsic Functions .. */
  701. /* .. Common blocks .. */
  702. /* .. Data statements .. */
  703. /* .. Executable Statements .. */
  704. for (ki = 1; ki <= 4; ++ki) {
  705. combla_1.incx = incxs[ki - 1];
  706. combla_1.incy = incys[ki - 1];
  707. mx = abs(combla_1.incx);
  708. my = abs(combla_1.incy);
  709. for (kn = 1; kn <= 4; ++kn) {
  710. combla_1.n = ns[kn - 1];
  711. ksize = f2cmin(2,kn);
  712. lenx = lens[kn + (mx << 2) - 5];
  713. leny = lens[kn + (my << 2) - 5];
  714. /* .. initialize all argument arrays .. */
  715. for (i__ = 1; i__ <= 7; ++i__) {
  716. i__1 = i__ - 1;
  717. i__2 = i__ - 1;
  718. cx[i__1].r = cx1[i__2].r, cx[i__1].i = cx1[i__2].i;
  719. i__1 = i__ - 1;
  720. i__2 = i__ - 1;
  721. cy[i__1].r = cy1[i__2].r, cy[i__1].i = cy1[i__2].i;
  722. /* L20: */
  723. }
  724. if (combla_1.icase == 1) {
  725. /* .. CDOTCTEST .. */
  726. cdotctest_(&combla_1.n, cx, &combla_1.incx, cy, &
  727. combla_1.incy, &ctemp);
  728. cdot[0].r = ctemp.r, cdot[0].i = ctemp.i;
  729. ctest_(&c__1, cdot, &ct6[kn + (ki << 2) - 5], &csize1[kn - 1],
  730. sfac);
  731. } else if (combla_1.icase == 2) {
  732. /* .. CDOTUTEST .. */
  733. cdotutest_(&combla_1.n, cx, &combla_1.incx, cy, &
  734. combla_1.incy, &ctemp);
  735. cdot[0].r = ctemp.r, cdot[0].i = ctemp.i;
  736. ctest_(&c__1, cdot, &ct7[kn + (ki << 2) - 5], &csize1[kn - 1],
  737. sfac);
  738. } else if (combla_1.icase == 3) {
  739. /* .. CAXPYTEST .. */
  740. caxpytest_(&combla_1.n, &ca, cx, &combla_1.incx, cy, &
  741. combla_1.incy);
  742. ctest_(&leny, cy, &ct8[(kn + (ki << 2)) * 7 - 35], &csize2[
  743. ksize * 7 - 7], sfac);
  744. } else if (combla_1.icase == 4) {
  745. /* .. CCOPYTEST .. */
  746. ccopytest_(&combla_1.n, cx, &combla_1.incx, cy, &
  747. combla_1.incy);
  748. ctest_(&leny, cy, &ct10y[(kn + (ki << 2)) * 7 - 35], csize3, &
  749. c_b43);
  750. } else if (combla_1.icase == 5) {
  751. /* .. CSWAPTEST .. */
  752. cswaptest_(&combla_1.n, cx, &combla_1.incx, cy, &
  753. combla_1.incy);
  754. ctest_(&lenx, cx, &ct10x[(kn + (ki << 2)) * 7 - 35], csize3, &
  755. c_b43);
  756. ctest_(&leny, cy, &ct10y[(kn + (ki << 2)) * 7 - 35], csize3, &
  757. c_b43);
  758. } else {
  759. fprintf(stderr,"Shouldn't be here in CHECK2\n");
  760. exit(0);
  761. }
  762. /* L40: */
  763. }
  764. /* L60: */
  765. }
  766. return 0;
  767. } /* check2_ */
  768. /* Subroutine */ int stest_(integer* len, real* scomp, real* strue, real* ssize,real* sfac)
  769. {
  770. /* System generated locals */
  771. integer i__1;
  772. real r__1, r__2, r__3, r__4, r__5;
  773. /* Local variables */
  774. static integer i__;
  775. extern doublereal sdiff_(real*, real*);
  776. static real sd;
  777. /* ********************************* STEST ************************** */
  778. /* THIS SUBR COMPARES ARRAYS SCOMP() AND STRUE() OF LENGTH LEN TO */
  779. /* SEE IF THE TERM BY TERM DIFFERENCES, MULTIPLIED BY SFAC, ARE */
  780. /* NEGLIGIBLE. */
  781. /* C. L. LAWSON, JPL, 1974 DEC 10 */
  782. /* .. Parameters .. */
  783. /* .. Scalar Arguments .. */
  784. /* .. Array Arguments .. */
  785. /* .. Scalars in Common .. */
  786. /* .. Local Scalars .. */
  787. /* .. External Functions .. */
  788. /* .. Intrinsic Functions .. */
  789. /* .. Common blocks .. */
  790. /* .. Executable Statements .. */
  791. /* Parameter adjustments */
  792. --ssize;
  793. --strue;
  794. --scomp;
  795. /* Function Body */
  796. i__1 = *len;
  797. for (i__ = 1; i__ <= i__1; ++i__) {
  798. sd = scomp[i__] - strue[i__];
  799. r__4 = (r__1 = ssize[i__], dabs(r__1)) + (r__2 = *sfac * sd, dabs(
  800. r__2));
  801. r__5 = (r__3 = ssize[i__], dabs(r__3));
  802. if (sdiff_(&r__4, &r__5) == (float)0.) {
  803. goto L40;
  804. }
  805. /* HERE SCOMP(I) IS NOT CLOSE TO STRUE(I). */
  806. if (! combla_1.pass) {
  807. goto L20;
  808. }
  809. /* PRINT FAIL MESSAGE AND HEADER. */
  810. combla_1.pass = FALSE_;
  811. printf(" FAIL\n");
  812. printf("CASE N INCX INCY MODE I COMP(I) TRUE(I) DIFFERENCE SIZE(I)\n");
  813. L20:
  814. printf("%4d %3d %5d %5d %5d %3d %36.8e %36.8e %12.4e %12.4e\n",combla_1.icase, combla_1.n, combla_1.incx, combla_1.incy,
  815. combla_1.mode, i__, scomp[i__], strue[i__], sd, ssize[i__]);
  816. L40:
  817. ;
  818. }
  819. return 0;
  820. } /* stest_ */
  821. /* Subroutine */ int stest1_(real* scomp1, real* strue1, real* ssize, real* sfac)
  822. {
  823. static real scomp[1], strue[1];
  824. extern /* Subroutine */ int stest_(int*, real*, real*, real*, real*);
  825. /* ************************* STEST1 ***************************** */
  826. /* THIS IS AN INTERFACE SUBROUTINE TO ACCOMMODATE THE FORTRAN */
  827. /* REQUIREMENT THAT WHEN A DUMMY ARGUMENT IS AN ARRAY, THE */
  828. /* ACTUAL ARGUMENT MUST ALSO BE AN ARRAY OR AN ARRAY ELEMENT. */
  829. /* C.L. LAWSON, JPL, 1978 DEC 6 */
  830. /* .. Scalar Arguments .. */
  831. /* .. Array Arguments .. */
  832. /* .. Local Arrays .. */
  833. /* .. External Subroutines .. */
  834. /* .. Executable Statements .. */
  835. /* Parameter adjustments */
  836. --ssize;
  837. /* Function Body */
  838. scomp[0] = *scomp1;
  839. strue[0] = *strue1;
  840. stest_(&c__1, scomp, strue, &ssize[1], sfac);
  841. return 0;
  842. } /* stest1_ */
  843. doublereal sdiff_(real* sa, real* sb)
  844. {
  845. /* System generated locals */
  846. real ret_val;
  847. /* ********************************* SDIFF ************************** */
  848. /* COMPUTES DIFFERENCE OF TWO NUMBERS. C. L. LAWSON, JPL 1974 FEB 15 */
  849. /* .. Scalar Arguments .. */
  850. /* .. Executable Statements .. */
  851. ret_val = *sa - *sb;
  852. return ret_val;
  853. } /* sdiff_ */
  854. /* Subroutine */ int ctest_(integer* len, complex* ccomp, complex* ctrue, complex* csize, real* sfac)
  855. {
  856. /* System generated locals */
  857. integer i__1, i__2;
  858. /* Builtin functions */
  859. // double r_imag();
  860. /* Local variables */
  861. static integer i__;
  862. static real scomp[20], ssize[20], strue[20];
  863. extern /* Subroutine */ int stest_(int*, real*,real*,real*,real*);
  864. /* **************************** CTEST ***************************** */
  865. /* C.L. LAWSON, JPL, 1978 DEC 6 */
  866. /* .. Scalar Arguments .. */
  867. /* .. Array Arguments .. */
  868. /* .. Local Scalars .. */
  869. /* .. Local Arrays .. */
  870. /* .. External Subroutines .. */
  871. /* .. Intrinsic Functions .. */
  872. /* .. Executable Statements .. */
  873. /* Parameter adjustments */
  874. --csize;
  875. --ctrue;
  876. --ccomp;
  877. /* Function Body */
  878. i__1 = *len;
  879. for (i__ = 1; i__ <= i__1; ++i__) {
  880. i__2 = i__;
  881. scomp[(i__ << 1) - 2] = ccomp[i__2].r;
  882. scomp[(i__ << 1) - 1] = r_imag(&ccomp[i__]);
  883. i__2 = i__;
  884. strue[(i__ << 1) - 2] = ctrue[i__2].r;
  885. strue[(i__ << 1) - 1] = r_imag(&ctrue[i__]);
  886. i__2 = i__;
  887. ssize[(i__ << 1) - 2] = csize[i__2].r;
  888. ssize[(i__ << 1) - 1] = r_imag(&csize[i__]);
  889. /* L20: */
  890. }
  891. i__1 = *len << 1;
  892. stest_(&i__1, scomp, strue, ssize, sfac);
  893. return 0;
  894. } /* ctest_ */
  895. /* Subroutine */ int itest1_(integer* icomp, integer* itrue)
  896. {
  897. /* Local variables */
  898. static integer id;
  899. /* ********************************* ITEST1 ************************* */
  900. /* THIS SUBROUTINE COMPARES THE VARIABLES ICOMP AND ITRUE FOR */
  901. /* EQUALITY. */
  902. /* C. L. LAWSON, JPL, 1974 DEC 10 */
  903. /* .. Parameters .. */
  904. /* .. Scalar Arguments .. */
  905. /* .. Scalars in Common .. */
  906. /* .. Local Scalars .. */
  907. /* .. Common blocks .. */
  908. /* .. Executable Statements .. */
  909. if (*icomp == *itrue) {
  910. goto L40;
  911. }
  912. /* HERE ICOMP IS NOT EQUAL TO ITRUE. */
  913. if (! combla_1.pass) {
  914. goto L20;
  915. }
  916. /* PRINT FAIL MESSAGE AND HEADER. */
  917. combla_1.pass = FALSE_;
  918. printf(" FAIL\n");
  919. printf(" CASE N INCX INCY MODE COMP TRUE DIFFERENCE\n");
  920. L20:
  921. id = *icomp - *itrue;
  922. printf("%4d %3d %5d %5d %5d %36d %36d %12d\n",combla_1.icase, combla_1.n, combla_1.incx, combla_1.incy,
  923. combla_1.mode, *icomp, *itrue, id);
  924. L40:
  925. return 0;
  926. } /* itest1_ */