/clapack/CLAPACK-3.2.1/TESTING/EIG/derrec.c

https://github.com/zye/cmvs_dep · C · 359 lines · 263 code · 39 blank · 57 comment · 5 complexity · 9dc9328f9ae27b670d2a9fc45134eed0 MD5 · raw file

  1. /* derrec.f -- translated by f2c (version 20061008).
  2. You must link the resulting object file with libf2c:
  3. on Microsoft Windows system, link with libf2c.lib;
  4. on Linux or Unix systems, link with .../path/to/libf2c.a -lm
  5. or, if you install libf2c.a in a standard place, with -lf2c -lm
  6. -- in that order, at the end of the command line, as in
  7. cc *.o -lf2c -lm
  8. Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
  9. http://www.netlib.org/f2c/libf2c.zip
  10. */
  11. #include "f2c.h"
  12. #include "blaswrap.h"
  13. /* Common Block Declarations */
  14. struct {
  15. integer infot, nout;
  16. logical ok, lerr;
  17. } infoc_;
  18. #define infoc_1 infoc_
  19. struct {
  20. char srnamt[32];
  21. } srnamc_;
  22. #define srnamc_1 srnamc_
  23. /* Table of constant values */
  24. static integer c__1 = 1;
  25. static integer c__0 = 0;
  26. static integer c_n1 = -1;
  27. static integer c__2 = 2;
  28. static integer c__3 = 3;
  29. static integer c__4 = 4;
  30. /* Subroutine */ int derrec_(char *path, integer *nunit)
  31. {
  32. /* Format strings */
  33. static char fmt_9999[] = "(1x,a3,\002 routines passed the tests of the e"
  34. "rror exits (\002,i3,\002 tests done)\002)";
  35. static char fmt_9998[] = "(\002 *** \002,a3,\002 routines failed the tes"
  36. "ts of the error ex\002,\002its ***\002)";
  37. /* Builtin functions */
  38. /* Subroutine */ int s_copy(char *, char *, ftnlen, ftnlen);
  39. integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
  40. /* Local variables */
  41. doublereal a[16] /* was [4][4] */, b[16] /* was [4][4] */, c__[16]
  42. /* was [4][4] */;
  43. integer i__, j, m;
  44. doublereal s[4], wi[4];
  45. integer nt;
  46. doublereal wr[4];
  47. logical sel[4];
  48. doublereal sep[4];
  49. integer info, ifst, ilst;
  50. doublereal work[4], scale;
  51. integer iwork[4];
  52. extern /* Subroutine */ int chkxer_(char *, integer *, integer *, logical
  53. *, logical *), dtrexc_(char *, integer *, doublereal *,
  54. integer *, doublereal *, integer *, integer *, integer *,
  55. doublereal *, integer *), dtrsna_(char *, char *, logical
  56. *, integer *, doublereal *, integer *, doublereal *, integer *,
  57. doublereal *, integer *, doublereal *, doublereal *, integer *,
  58. integer *, doublereal *, integer *, integer *, integer *), dtrsen_(char *, char *, logical *, integer *, doublereal
  59. *, integer *, doublereal *, integer *, doublereal *, doublereal *,
  60. integer *, doublereal *, doublereal *, doublereal *, integer *,
  61. integer *, integer *, integer *), dtrsyl_(char *,
  62. char *, integer *, integer *, integer *, doublereal *, integer *,
  63. doublereal *, integer *, doublereal *, integer *, doublereal *,
  64. integer *);
  65. /* Fortran I/O blocks */
  66. static cilist io___19 = { 0, 0, 0, fmt_9999, 0 };
  67. static cilist io___20 = { 0, 0, 0, fmt_9998, 0 };
  68. /* -- LAPACK test routine (version 3.1) -- */
  69. /* Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
  70. /* November 2006 */
  71. /* .. Scalar Arguments .. */
  72. /* .. */
  73. /* Purpose */
  74. /* ======= */
  75. /* DERREC tests the error exits for the routines for eigen- condition */
  76. /* estimation for DOUBLE PRECISION matrices: */
  77. /* DTRSYL, STREXC, STRSNA and STRSEN. */
  78. /* Arguments */
  79. /* ========= */
  80. /* PATH (input) CHARACTER*3 */
  81. /* The LAPACK path name for the routines to be tested. */
  82. /* NUNIT (input) INTEGER */
  83. /* The unit number for output. */
  84. /* ===================================================================== */
  85. /* .. Parameters .. */
  86. /* .. */
  87. /* .. Local Scalars .. */
  88. /* .. */
  89. /* .. Local Arrays .. */
  90. /* .. */
  91. /* .. External Subroutines .. */
  92. /* .. */
  93. /* .. Scalars in Common .. */
  94. /* .. */
  95. /* .. Common blocks .. */
  96. /* .. */
  97. /* .. Executable Statements .. */
  98. infoc_1.nout = *nunit;
  99. infoc_1.ok = TRUE_;
  100. nt = 0;
  101. /* Initialize A, B and SEL */
  102. for (j = 1; j <= 4; ++j) {
  103. for (i__ = 1; i__ <= 4; ++i__) {
  104. a[i__ + (j << 2) - 5] = 0.;
  105. b[i__ + (j << 2) - 5] = 0.;
  106. /* L10: */
  107. }
  108. /* L20: */
  109. }
  110. for (i__ = 1; i__ <= 4; ++i__) {
  111. a[i__ + (i__ << 2) - 5] = 1.;
  112. sel[i__ - 1] = TRUE_;
  113. /* L30: */
  114. }
  115. /* Test DTRSYL */
  116. s_copy(srnamc_1.srnamt, "DTRSYL", (ftnlen)32, (ftnlen)6);
  117. infoc_1.infot = 1;
  118. dtrsyl_("X", "N", &c__1, &c__0, &c__0, a, &c__1, b, &c__1, c__, &c__1, &
  119. scale, &info);
  120. chkxer_("DTRSYL", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
  121. infoc_1.ok);
  122. infoc_1.infot = 2;
  123. dtrsyl_("N", "X", &c__1, &c__0, &c__0, a, &c__1, b, &c__1, c__, &c__1, &
  124. scale, &info);
  125. chkxer_("DTRSYL", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
  126. infoc_1.ok);
  127. infoc_1.infot = 3;
  128. dtrsyl_("N", "N", &c__0, &c__0, &c__0, a, &c__1, b, &c__1, c__, &c__1, &
  129. scale, &info);
  130. chkxer_("DTRSYL", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
  131. infoc_1.ok);
  132. infoc_1.infot = 4;
  133. dtrsyl_("N", "N", &c__1, &c_n1, &c__0, a, &c__1, b, &c__1, c__, &c__1, &
  134. scale, &info);
  135. chkxer_("DTRSYL", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
  136. infoc_1.ok);
  137. infoc_1.infot = 5;
  138. dtrsyl_("N", "N", &c__1, &c__0, &c_n1, a, &c__1, b, &c__1, c__, &c__1, &
  139. scale, &info);
  140. chkxer_("DTRSYL", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
  141. infoc_1.ok);
  142. infoc_1.infot = 7;
  143. dtrsyl_("N", "N", &c__1, &c__2, &c__0, a, &c__1, b, &c__1, c__, &c__2, &
  144. scale, &info);
  145. chkxer_("DTRSYL", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
  146. infoc_1.ok);
  147. infoc_1.infot = 9;
  148. dtrsyl_("N", "N", &c__1, &c__0, &c__2, a, &c__1, b, &c__1, c__, &c__1, &
  149. scale, &info);
  150. chkxer_("DTRSYL", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
  151. infoc_1.ok);
  152. infoc_1.infot = 11;
  153. dtrsyl_("N", "N", &c__1, &c__2, &c__0, a, &c__2, b, &c__1, c__, &c__1, &
  154. scale, &info);
  155. chkxer_("DTRSYL", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
  156. infoc_1.ok);
  157. nt += 8;
  158. /* Test DTREXC */
  159. s_copy(srnamc_1.srnamt, "DTREXC", (ftnlen)32, (ftnlen)6);
  160. ifst = 1;
  161. ilst = 1;
  162. infoc_1.infot = 1;
  163. dtrexc_("X", &c__1, a, &c__1, b, &c__1, &ifst, &ilst, work, &info);
  164. chkxer_("DTREXC", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
  165. infoc_1.ok);
  166. infoc_1.infot = 7;
  167. dtrexc_("N", &c__0, a, &c__1, b, &c__1, &ifst, &ilst, work, &info);
  168. chkxer_("DTREXC", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
  169. infoc_1.ok);
  170. infoc_1.infot = 4;
  171. ilst = 2;
  172. dtrexc_("N", &c__2, a, &c__1, b, &c__1, &ifst, &ilst, work, &info);
  173. chkxer_("DTREXC", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
  174. infoc_1.ok);
  175. infoc_1.infot = 6;
  176. dtrexc_("V", &c__2, a, &c__2, b, &c__1, &ifst, &ilst, work, &info);
  177. chkxer_("DTREXC", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
  178. infoc_1.ok);
  179. infoc_1.infot = 7;
  180. ifst = 0;
  181. ilst = 1;
  182. dtrexc_("V", &c__1, a, &c__1, b, &c__1, &ifst, &ilst, work, &info);
  183. chkxer_("DTREXC", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
  184. infoc_1.ok);
  185. infoc_1.infot = 7;
  186. ifst = 2;
  187. dtrexc_("V", &c__1, a, &c__1, b, &c__1, &ifst, &ilst, work, &info);
  188. chkxer_("DTREXC", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
  189. infoc_1.ok);
  190. infoc_1.infot = 8;
  191. ifst = 1;
  192. ilst = 0;
  193. dtrexc_("V", &c__1, a, &c__1, b, &c__1, &ifst, &ilst, work, &info);
  194. chkxer_("DTREXC", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
  195. infoc_1.ok);
  196. infoc_1.infot = 8;
  197. ilst = 2;
  198. dtrexc_("V", &c__1, a, &c__1, b, &c__1, &ifst, &ilst, work, &info);
  199. chkxer_("DTREXC", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
  200. infoc_1.ok);
  201. nt += 8;
  202. /* Test DTRSNA */
  203. s_copy(srnamc_1.srnamt, "DTRSNA", (ftnlen)32, (ftnlen)6);
  204. infoc_1.infot = 1;
  205. dtrsna_("X", "A", sel, &c__0, a, &c__1, b, &c__1, c__, &c__1, s, sep, &
  206. c__1, &m, work, &c__1, iwork, &info);
  207. chkxer_("DTRSNA", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
  208. infoc_1.ok);
  209. infoc_1.infot = 2;
  210. dtrsna_("B", "X", sel, &c__0, a, &c__1, b, &c__1, c__, &c__1, s, sep, &
  211. c__1, &m, work, &c__1, iwork, &info);
  212. chkxer_("DTRSNA", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
  213. infoc_1.ok);
  214. infoc_1.infot = 4;
  215. dtrsna_("B", "A", sel, &c_n1, a, &c__1, b, &c__1, c__, &c__1, s, sep, &
  216. c__1, &m, work, &c__1, iwork, &info);
  217. chkxer_("DTRSNA", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
  218. infoc_1.ok);
  219. infoc_1.infot = 6;
  220. dtrsna_("V", "A", sel, &c__2, a, &c__1, b, &c__1, c__, &c__1, s, sep, &
  221. c__2, &m, work, &c__2, iwork, &info);
  222. chkxer_("DTRSNA", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
  223. infoc_1.ok);
  224. infoc_1.infot = 8;
  225. dtrsna_("B", "A", sel, &c__2, a, &c__2, b, &c__1, c__, &c__2, s, sep, &
  226. c__2, &m, work, &c__2, iwork, &info);
  227. chkxer_("DTRSNA", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
  228. infoc_1.ok);
  229. infoc_1.infot = 10;
  230. dtrsna_("B", "A", sel, &c__2, a, &c__2, b, &c__2, c__, &c__1, s, sep, &
  231. c__2, &m, work, &c__2, iwork, &info);
  232. chkxer_("DTRSNA", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
  233. infoc_1.ok);
  234. infoc_1.infot = 13;
  235. dtrsna_("B", "A", sel, &c__1, a, &c__1, b, &c__1, c__, &c__1, s, sep, &
  236. c__0, &m, work, &c__1, iwork, &info);
  237. chkxer_("DTRSNA", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
  238. infoc_1.ok);
  239. infoc_1.infot = 13;
  240. dtrsna_("B", "S", sel, &c__2, a, &c__2, b, &c__2, c__, &c__2, s, sep, &
  241. c__1, &m, work, &c__2, iwork, &info);
  242. chkxer_("DTRSNA", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
  243. infoc_1.ok);
  244. infoc_1.infot = 16;
  245. dtrsna_("B", "A", sel, &c__2, a, &c__2, b, &c__2, c__, &c__2, s, sep, &
  246. c__2, &m, work, &c__1, iwork, &info);
  247. chkxer_("DTRSNA", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
  248. infoc_1.ok);
  249. nt += 9;
  250. /* Test DTRSEN */
  251. sel[0] = FALSE_;
  252. s_copy(srnamc_1.srnamt, "DTRSEN", (ftnlen)32, (ftnlen)6);
  253. infoc_1.infot = 1;
  254. dtrsen_("X", "N", sel, &c__0, a, &c__1, b, &c__1, wr, wi, &m, s, sep,
  255. work, &c__1, iwork, &c__1, &info);
  256. chkxer_("DTRSEN", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
  257. infoc_1.ok);
  258. infoc_1.infot = 2;
  259. dtrsen_("N", "X", sel, &c__0, a, &c__1, b, &c__1, wr, wi, &m, s, sep,
  260. work, &c__1, iwork, &c__1, &info);
  261. chkxer_("DTRSEN", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
  262. infoc_1.ok);
  263. infoc_1.infot = 4;
  264. dtrsen_("N", "N", sel, &c_n1, a, &c__1, b, &c__1, wr, wi, &m, s, sep,
  265. work, &c__1, iwork, &c__1, &info);
  266. chkxer_("DTRSEN", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
  267. infoc_1.ok);
  268. infoc_1.infot = 6;
  269. dtrsen_("N", "N", sel, &c__2, a, &c__1, b, &c__1, wr, wi, &m, s, sep,
  270. work, &c__2, iwork, &c__1, &info);
  271. chkxer_("DTRSEN", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
  272. infoc_1.ok);
  273. infoc_1.infot = 8;
  274. dtrsen_("N", "V", sel, &c__2, a, &c__2, b, &c__1, wr, wi, &m, s, sep,
  275. work, &c__1, iwork, &c__1, &info);
  276. chkxer_("DTRSEN", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
  277. infoc_1.ok);
  278. infoc_1.infot = 15;
  279. dtrsen_("N", "V", sel, &c__2, a, &c__2, b, &c__2, wr, wi, &m, s, sep,
  280. work, &c__0, iwork, &c__1, &info);
  281. chkxer_("DTRSEN", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
  282. infoc_1.ok);
  283. infoc_1.infot = 15;
  284. dtrsen_("E", "V", sel, &c__3, a, &c__3, b, &c__3, wr, wi, &m, s, sep,
  285. work, &c__1, iwork, &c__1, &info);
  286. chkxer_("DTRSEN", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
  287. infoc_1.ok);
  288. infoc_1.infot = 15;
  289. dtrsen_("V", "V", sel, &c__3, a, &c__3, b, &c__3, wr, wi, &m, s, sep,
  290. work, &c__3, iwork, &c__2, &info);
  291. chkxer_("DTRSEN", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
  292. infoc_1.ok);
  293. infoc_1.infot = 17;
  294. dtrsen_("E", "V", sel, &c__2, a, &c__2, b, &c__2, wr, wi, &m, s, sep,
  295. work, &c__1, iwork, &c__0, &info);
  296. chkxer_("DTRSEN", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
  297. infoc_1.ok);
  298. infoc_1.infot = 17;
  299. dtrsen_("V", "V", sel, &c__3, a, &c__3, b, &c__3, wr, wi, &m, s, sep,
  300. work, &c__4, iwork, &c__1, &info);
  301. chkxer_("DTRSEN", &infoc_1.infot, &infoc_1.nout, &infoc_1.lerr, &
  302. infoc_1.ok);
  303. nt += 10;
  304. /* Print a summary line. */
  305. if (infoc_1.ok) {
  306. io___19.ciunit = infoc_1.nout;
  307. s_wsfe(&io___19);
  308. do_fio(&c__1, path, (ftnlen)3);
  309. do_fio(&c__1, (char *)&nt, (ftnlen)sizeof(integer));
  310. e_wsfe();
  311. } else {
  312. io___20.ciunit = infoc_1.nout;
  313. s_wsfe(&io___20);
  314. do_fio(&c__1, path, (ftnlen)3);
  315. e_wsfe();
  316. }
  317. return 0;
  318. /* End of DERREC */
  319. } /* derrec_ */