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_dblat1c.c 31 kB

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