nag.c 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656
  1. /* file nag.c */
  2. /* Signature: 7a82cff0 08-Apr-2002 */
  3. /* #define TESTNAG */
  4. /* #define LOADLIB */
  5. #include <stdarg.h>
  6. #include <sys/types.h>
  7. #include <string.h>
  8. #include "machine.h"
  9. #include "tags.h"
  10. #include "cslerror.h"
  11. #include "externs.h"
  12. #include "entries.h"
  13. #include "arith.h"
  14. #ifdef TESTNAG
  15. #ifdef LOADLIB /* load DLLs when necessary */
  16. #undef IGNORE /* avoid conflicting macro definitions */
  17. #include <windows.h> /* is this OK here? */
  18. #else /* load DLLs when program is first run */
  19. /* Temporary fix to take account of different naming conventions */
  20. #if defined(__alpha)
  21. #define D01AJF d01ajf_
  22. #define SXXEAF sxxeaf_
  23. #elif 1 /* DLL from FPSNT / Win32 version */ /* FIXME */
  24. /* leave D01AJF etc as it is (DLL exports _D01AJF@48) */
  25. #else
  26. #define D01AJF d01ajf
  27. #define SXXEAF sxxeaf
  28. #endif
  29. #endif /* LOADLIB */
  30. #ifdef LOADLIB
  31. HINSTANCE prevlib = NULL, currlib = NULL;
  32. void free_prevlib ();
  33. #endif
  34. typedef struct
  35. {
  36. char *str;
  37. int32 len; /* or unsigned? */
  38. } fstring1;
  39. /*
  40. This checks a 32 bit integer's value and returns it as either a fixnum
  41. or a bignum.
  42. */
  43. #define int2ccl(i)\
  44. (i > -268435455 && i < 268435456) ? fixnum_of_int(i) : make_one_word_bignum(i)
  45. extern void mkFortranVectorDouble(double *loc, Lisp_Object v, int32 dim);
  46. #include "nag_d.c" /* D chapter routines */
  47. #include "nag_s.c" /* S chapter routines */
  48. /*
  49. * Turn a vector of ints into a Lisp vector of vectors, corresponding to
  50. * the AXIOM representation of a Matrix(Integer).
  51. */
  52. Lisp_Object mkIntVector(int32 v[], int32 nrows, int32 ncols)
  53. {
  54. Lisp_Object nil=C_nil;
  55. Lisp_Object new, new_row;
  56. int32 i,j;
  57. new = getvector(TAG_VECTOR, TYPE_SIMPLE_VEC, 4*nrows+4);
  58. errexit();
  59. /* vectors must pad to an even number of words */
  60. if ((nrows & 1) == 0) elt(new,nrows) = nil;
  61. for (i=0;i<nrows;++i) {
  62. new_row = getvector(TAG_VECTOR, TYPE_SIMPLE_VEC, 4*ncols+4);
  63. errexit();
  64. /* vectors must pad to an even number of words */
  65. if ((ncols & 1) == 0) elt(new_row,ncols) = nil;
  66. for (j=0;j<ncols;++j) elt(new_row,j) = int2ccl(v[i*ncols+j]);
  67. elt(new,i) = new_row;
  68. }
  69. return onevalue(new);
  70. }
  71. /*
  72. * Turn a vector of doubles into a Lisp vector of vectors, corresponding to
  73. * the AXIOM representation of a Matrix(DoubleFloat).
  74. */
  75. Lisp_Object mkFloatVector(double v[], int32 nrows, int32 ncols)
  76. {
  77. Lisp_Object nil=C_nil;
  78. Lisp_Object new, new_row, Lflt;
  79. int32 i, j;
  80. new = getvector(TAG_VECTOR, TYPE_SIMPLE_VEC, 4*nrows+4);
  81. errexit();
  82. /* vectors must pad to an even number of words */
  83. if ((nrows & 1) == 0) elt(new,nrows) = nil;
  84. for (i=0;i<nrows;++i) {
  85. push(new);
  86. new_row = getvector(TAG_VECTOR, TYPE_SIMPLE_VEC, 4*ncols+4);
  87. pop(new);
  88. errexit();
  89. /* vectors must pad to an even number of words */
  90. if ((ncols & 1) == 0) elt(new_row,ncols) = nil;
  91. for (j=0;j<ncols;++j) {
  92. push2(new, new_row);
  93. Lflt = make_boxfloat(v[i*ncols+j],TYPE_DOUBLE_FLOAT);
  94. pop2(new_row, new);
  95. errexit();
  96. elt(new_row,j) = Lflt;
  97. }
  98. elt(new,i) = new_row;
  99. }
  100. return onevalue(new);
  101. }
  102. typedef struct complex{
  103. double re;
  104. double im;
  105. } complex;
  106. /*
  107. * Turn a vector of complexes into a Lisp vector of vectors, corresponding to
  108. * the AXIOM representation of a Matrix(Complex DoubleFloat).
  109. */
  110. Lisp_Object mkComplexVector(complex v[], int32 nrows, int32 ncols)
  111. {
  112. Lisp_Object nil=C_nil;
  113. Lisp_Object new, new_row, Lflt1, Lflt2;
  114. complex z;
  115. int32 i, j;
  116. new = getvector(TAG_VECTOR, TYPE_SIMPLE_VEC, 4*nrows+4);
  117. errexit();
  118. /* vectors must pad to an even number of words */
  119. if ((nrows & 1) == 0) elt(new,nrows) = nil;
  120. for (i=0;i<nrows;++i) {
  121. push(new);
  122. new_row = getvector(TAG_VECTOR, TYPE_SIMPLE_VEC, 4*ncols+4);
  123. pop(new);
  124. errexit();
  125. /* vectors must pad to an even number of words */
  126. if ((ncols & 1) == 0) elt(new,ncols) = nil;
  127. for (j=0;j<ncols;++j) {
  128. push2(new, new_row);
  129. z = v[i*ncols+j];
  130. Lflt1 = make_boxfloat(z.re,TYPE_DOUBLE_FLOAT);
  131. Lflt2 = make_boxfloat(z.im,TYPE_DOUBLE_FLOAT);
  132. pop2(new_row, new);
  133. errexit();
  134. elt(new_row,j) = Lcons(nil,Lflt1,Lflt2);
  135. }
  136. elt(new,i) = new_row;
  137. }
  138. return onevalue(new);
  139. }
  140. #if 0
  141. Lisp_Object MS_CDECL Ls01eaf(Lisp_Object nil, int nargs, ...)
  142. {
  143. va_list args;
  144. Lisp_Object Lzr, Lzi, Lifail;
  145. double z[2], result[2];
  146. int32 ifail;
  147. /*
  148. * Returning DOUBLE COMPLEX objects via the function name is not portable
  149. * so we use a dummy subroutine as glue.
  150. */
  151. #ifdef LOADLIB
  152. typedef void (__stdcall *PSXXEAF) (double *, double *, int*);
  153. HINSTANCE hLib;
  154. PSXXEAF sxxeaf_proc;
  155. #else
  156. #if 0
  157. extern void SXXEAF();
  158. #else
  159. extern void __stdcall SXXEAF (double *, double *, int32 *);
  160. #endif
  161. #endif
  162. /* Set up arguments as Lisp Objects */
  163. argcheck(nargs,3,"Ls01eaf");
  164. va_start(args,nargs);
  165. Lzr = va_arg(args, Lisp_Object);
  166. Lzi = va_arg(args, Lisp_Object);
  167. Lifail = va_arg(args, Lisp_Object);
  168. va_end(args);
  169. /* Translate arguments into C objects */
  170. push3(Lzr,Lzi,Lifail);
  171. z[0] = float_of_number(Lzr);
  172. pop3(Lifail,Lzi,Lzr);
  173. errexit();
  174. push3(Lzr,Lzi,Lifail);
  175. z[1] = float_of_number(Lzi);
  176. pop3(Lifail,Lzi,Lzr);
  177. errexit();
  178. push3(Lzr,Lzi,Lifail);
  179. ifail = thirty_two_bits(Lifail);
  180. pop3(Lifail,Lzi,Lzr);
  181. errexit();
  182. /* Call NAG routine */
  183. #ifdef LOADLIB
  184. if ( (hLib = LoadLibrary ("sxxeafdl")) == NULL )
  185. {
  186. /* couldn't find DLL -- error handling here */
  187. result[0] = 999.999; /* FIXME */
  188. result[1] = 999.999;
  189. ifail = -999;
  190. }
  191. else /* OK so far */
  192. {
  193. if ( (sxxeaf_proc = (PSXXEAF) GetProcAddress (hLib, "_SXXEAF@12"))
  194. == NULL )
  195. {
  196. /* couldn't find function within DLL -- error handling here */
  197. result[0] = 999.999; /* FIXME */
  198. result[1] = 999.999;
  199. ifail = -998;
  200. }
  201. else /* have found function in DLL */
  202. {
  203. (*sxxeaf_proc) (z, result, &ifail);
  204. }
  205. if ( FreeLibrary (hLib) == FALSE )
  206. {
  207. /* couldn't free library -- possible error handling here */
  208. ifail += 1000;
  209. }
  210. }
  211. #else
  212. SXXEAF(z,result,&ifail);
  213. #endif
  214. /* Translate return values to CCL */
  215. /* Copy result */
  216. Lzr = make_boxfloat(result[0],TYPE_DOUBLE_FLOAT);
  217. push(Lzr);
  218. Lzi = make_boxfloat(result[1],TYPE_DOUBLE_FLOAT);
  219. pop(Lzr);
  220. errexit();
  221. push2(Lzr,Lzi);
  222. Lifail = int2ccl(ifail);
  223. pop2(Lzi,Lzr);
  224. errexit();
  225. return Llist(nil,3,Lzr,Lzi,Lifail);
  226. }
  227. Lisp_Object Ls13aaf(Lisp_Object nil, Lisp_Object Lx, Lisp_Object Lifail)
  228. {
  229. Lisp_Object Ly;
  230. double x, y;
  231. int32 ifail;
  232. #ifdef LOADLIB
  233. typedef double (__stdcall *PS13AAF) (double *, int*);
  234. HINSTANCE hLib;
  235. PS13AAF s13aaf_proc;
  236. #else
  237. extern double __stdcall S13AAF (double *, int32 *);
  238. #endif
  239. /* Translate arguments into C objects */
  240. push2(Lx,Lifail);
  241. x = float_of_number(Lx);
  242. pop2(Lifail,Lx);
  243. errexit();
  244. push2(Lx,Lifail);
  245. ifail = thirty_two_bits(Lifail);
  246. pop2(Lifail,Lx);
  247. errexit();
  248. /* Call NAG routine */
  249. #ifdef LOADLIB
  250. if ( (hLib = LoadLibrary ("nagfas")) == NULL )
  251. {
  252. /* couldn't find DLL -- error handling here */
  253. y = 999.999; /* FIXME */
  254. ifail = -999;
  255. }
  256. else /* OK so far */
  257. {
  258. if ( (s13aaf_proc = (PS13AAF) GetProcAddress (hLib, "_S13AAF@8"))
  259. == NULL )
  260. {
  261. /* couldn't find function within DLL -- error handling here */
  262. y = 999.999; /* FIXME */
  263. ifail = -998;
  264. }
  265. else /* have found function in DLL */
  266. {
  267. y = (*s13aaf_proc) (&x, &ifail);
  268. }
  269. if ( FreeLibrary (hLib) == FALSE )
  270. {
  271. /* couldn't free library -- possible error handling here */
  272. ifail += 1000;
  273. }
  274. }
  275. #else
  276. y = S13AAF(&x,&ifail);
  277. #endif
  278. /* Translate return values to CCL */
  279. /* Copy result */
  280. Ly = make_boxfloat(y,TYPE_DOUBLE_FLOAT);
  281. push(Ly);
  282. Lifail = int2ccl(ifail);
  283. pop(Ly);
  284. errexit();
  285. return Llist(nil,2,Ly,Lifail);
  286. }
  287. #endif /* s01eaf & s13aaf */
  288. #if 0
  289. Lisp_Object MS_CDECL Ld01ajf(Lisp_Object nil, int nargs, ...)
  290. {
  291. va_list args;
  292. Lisp_Object La, Lb, Lepsabs, Lepsrel, Llw, Lliw, Lifail, Lresult, Labserr,
  293. Lw, Liw;
  294. double a, b, epsabs, epsrel, result, abserr, *w;
  295. int32 ifail, lw, *iw, liw;
  296. #if 0
  297. extern double asp1();
  298. #else
  299. extern double __stdcall asp1(double *);
  300. #endif
  301. #ifdef LOADLIB
  302. typedef void (__stdcall *PD01AJF) (double __stdcall (*fst) (double *),
  303. double *, double *, double *, double *, double *, double *,
  304. double *, int *, int *, int *, int *);
  305. HINSTANCE hLib;
  306. PD01AJF d01ajf_proc;
  307. #else
  308. #if 0
  309. extern void D01AJF();
  310. #else
  311. extern void __stdcall D01AJF(double __stdcall (*fst) (double *), double *, double *, double *,
  312. double *, double *, double *, double *, int *, int *, int *,
  313. int *);
  314. #endif
  315. #endif
  316. /* Set up arguments as Lisp Objects */
  317. argcheck(nargs,7,"Ld01ajf");
  318. va_start(args,nargs);
  319. La = va_arg(args, Lisp_Object);
  320. Lb = va_arg(args, Lisp_Object);
  321. Lepsabs = va_arg(args, Lisp_Object);
  322. Lepsrel = va_arg(args, Lisp_Object);
  323. Llw = va_arg(args, Lisp_Object);
  324. Lliw = va_arg(args, Lisp_Object);
  325. Lifail = va_arg(args, Lisp_Object);
  326. va_end(args);
  327. /* Translate arguments into C objects */
  328. push4(La,Lb,Lepsabs,Lepsrel);
  329. push3(Llw,Lliw,Lifail);
  330. a = float_of_number(La);
  331. pop4(Lifail,Lliw,Llw,Lepsrel);
  332. pop3(Lepsabs,Lb,La);
  333. errexit();
  334. push4(La,Lb,Lepsabs,Lepsrel);
  335. push3(Llw,Lliw,Lifail);
  336. b = float_of_number(Lb);
  337. pop4(Lifail,Lliw,Llw,Lepsrel);
  338. pop3(Lepsabs,Lb,La);
  339. errexit();
  340. push4(La,Lb,Lepsabs,Lepsrel);
  341. push3(Llw,Lliw,Lifail);
  342. epsabs = float_of_number(Lepsabs);
  343. pop4(Lifail,Lliw,Llw,Lepsrel);
  344. pop3(Lepsabs,Lb,La);
  345. errexit();
  346. push4(La,Lb,Lepsabs,Lepsrel);
  347. push3(Llw,Lliw,Lifail);
  348. epsrel = float_of_number(Lepsrel);
  349. pop4(Lifail,Lliw,Llw,Lepsrel);
  350. pop3(Lepsabs,Lb,La);
  351. errexit();
  352. push4(La,Lb,Lepsabs,Lepsrel);
  353. push3(Llw,Lliw,Lifail);
  354. lw = thirty_two_bits(Llw);
  355. pop4(Lifail,Lliw,Llw,Lepsrel);
  356. pop3(Lepsabs,Lb,La);
  357. errexit();
  358. push4(La,Lb,Lepsabs,Lepsrel);
  359. push3(Llw,Lliw,Lifail);
  360. liw = thirty_two_bits(Lliw);
  361. pop4(Lifail,Lliw,Llw,Lepsrel);
  362. pop3(Lepsabs,Lb,La);
  363. errexit();
  364. push4(La,Lb,Lepsabs,Lepsrel);
  365. push3(Llw,Lliw,Lifail);
  366. ifail = thirty_two_bits(Lifail);
  367. pop4(Lifail,Lliw,Llw,Lepsrel);
  368. pop3(Lepsabs,Lb,La);
  369. errexit();
  370. /* Setup workspace arrays etc. */
  371. w = (double *)malloc(lw*sizeof(double));
  372. iw = (int *)malloc(liw*sizeof(int));
  373. /* Call NAG routine */
  374. #ifdef LOADLIB
  375. if ( (hLib = LoadLibrary ("d01ajfdl")) == NULL )
  376. {
  377. /* couldn't find DLL -- error handling here */
  378. result = 999.999; /* FIXME */
  379. ifail = -999;
  380. }
  381. else
  382. {
  383. if ( (d01ajf_proc = (PD01AJF) GetProcAddress (hLib, "_D01AJF@48")) == NULL )
  384. {
  385. /* couldn't find function within DLL -- error handling here */
  386. result = 999.999; /* FIXME */
  387. ifail = -998;
  388. }
  389. else
  390. {
  391. (*d01ajf_proc) (&asp1, &a, &b, &epsabs, &epsrel, &result, &abserr, w, &lw,
  392. iw, &liw, &ifail);
  393. }
  394. if ( FreeLibrary (hLib) == FALSE )
  395. {
  396. /* couldn't free library -- possible error handling here */
  397. ifail += 1000;
  398. }
  399. }
  400. #else
  401. D01AJF(&asp1,&a,&b,&epsabs,&epsrel,&result,&abserr,w, &lw, iw, &liw, &ifail);
  402. #endif
  403. /* Translate return values to CCL */
  404. Lresult = make_boxfloat(result,TYPE_DOUBLE_FLOAT);
  405. push(Lresult);
  406. Labserr = make_boxfloat(abserr,TYPE_DOUBLE_FLOAT);
  407. pop(Lresult);
  408. errexit();
  409. push2(Lresult,Labserr);
  410. Lw = mkFloatVector(w,lw,1);
  411. pop2(Labserr,Lresult);
  412. errexit();
  413. push3(Lresult,Labserr,Lw);
  414. Liw = mkIntVector(iw,liw,1);
  415. pop3(Lw,Labserr,Lresult);
  416. errexit();
  417. push4(Lresult,Labserr,Lw,Liw);
  418. Lifail = fixnum_of_int(ifail);
  419. pop4(Liw,Lw,Labserr,Lresult);
  420. /*
  421. Lw = mkFloatVector(w,lw,1);
  422. pop2(Labserr,Lresult);
  423. errexit();
  424. push3(Lresult,Labserr,Lw);
  425. Lifail = fixnum_of_int(ifail);
  426. pop3(Lw,Labserr,Lresult);
  427. */
  428. errexit();
  429. return Llist(nil,5,Lresult,Labserr,Lw,Liw,Lifail);
  430. // return Llist(nil,4,Lresult,Labserr,Liw,Lifail);
  431. }
  432. #endif /* Ld01ajf */
  433. Lisp_Object MS_CDECL Lbug(Lisp_Object nil, int nargs, ...)
  434. {
  435. double *f;
  436. int i;
  437. f = (double *)malloc(100*sizeof(double));
  438. for ( i = 0; i < 100; i++ )
  439. *(f + i) = (double) i;
  440. return mkFloatVector(f,100,1);
  441. }
  442. #ifdef LOADLIB
  443. void free_prevlib ()
  444. {
  445. if ( prevlib != NULL )
  446. if ( FreeLibrary (prevlib) )
  447. {
  448. /* couldn't free library -- possible error handling here */
  449. }
  450. prevlib = currlib;
  451. }
  452. #endif
  453. #else
  454. Lisp_Object nag_error1(Lisp_Object nil, Lisp_Object arg)
  455. {
  456. return aerror0("This version of the NAG Link is not available on this platform");
  457. }
  458. Lisp_Object nag_error2(Lisp_Object nil, Lisp_Object arg1, Lisp_Object arg2)
  459. {
  460. return aerror0("This version of the NAG Link is not available on this platform");
  461. }
  462. Lisp_Object MS_CDECL nag_error0(Lisp_Object nil, int nargs, ...)
  463. {
  464. return aerror0("This version of the NAG Link is not available on this platform");
  465. }
  466. #endif
  467. setup_type const nag_setup[] =
  468. {
  469. #ifdef TESTNAG
  470. {"d01ajf", wrong_no_na, wrong_no_nb, Ld01ajf},
  471. {"d01akf", wrong_no_na, wrong_no_nb, Ld01akf},
  472. {"d01alf", wrong_no_na, wrong_no_nb, Ld01alf},
  473. {"d01amf", wrong_no_na, wrong_no_nb, Ld01amf},
  474. {"d01anf", wrong_no_na, wrong_no_nb, Ld01anf},
  475. {"d01apf", wrong_no_na, wrong_no_nb, Ld01apf},
  476. {"d01aqf", wrong_no_na, wrong_no_nb, Ld01aqf},
  477. {"d01asf", wrong_no_na, wrong_no_nb, Ld01asf},
  478. {"d01bbf", wrong_no_na, wrong_no_nb, Ld01bbf},
  479. {"d01fcf", wrong_no_na, wrong_no_nb, Ld01fcf},
  480. {"d01gaf", wrong_no_na, wrong_no_nb, Ld01gaf},
  481. {"d01gbf", wrong_no_na, wrong_no_nb, Ld01gbf},
  482. {"d02bbf", wrong_no_na, wrong_no_nb, Ld02bbf},
  483. {"d02bhf", wrong_no_na, wrong_no_nb, Ld02bhf},
  484. {"d02cjf", wrong_no_na, wrong_no_nb, Ld02cjf},
  485. {"d02ejf", wrong_no_na, wrong_no_nb, Ld02ejf},
  486. {"d02gaf", wrong_no_na, wrong_no_nb, Ld02gaf},
  487. {"d02gbf", wrong_no_na, wrong_no_nb, Ld02gbf},
  488. {"d02kef", wrong_no_na, wrong_no_nb, Ld02kef},
  489. {"d02raf", wrong_no_na, wrong_no_nb, Ld02raf},
  490. {"d03edf", wrong_no_na, wrong_no_nb, Ld03edf},
  491. {"d03eef", wrong_no_na, wrong_no_nb, Ld03eef},
  492. {"d03faf", wrong_no_na, wrong_no_nb, Ld03faf},
  493. {"s01eaf", wrong_no_na, wrong_no_nb, Ls01eaf},
  494. {"s13aaf", too_few_2, Ls13aaf, wrong_no_2},
  495. {"s13acf", too_few_2, Ls13acf, wrong_no_2},
  496. {"s13adf", too_few_2, Ls13adf, wrong_no_2},
  497. {"s14aaf", too_few_2, Ls14aaf, wrong_no_2},
  498. {"s14abf", too_few_2, Ls14abf, wrong_no_2},
  499. {"s14baf", wrong_no_na, wrong_no_nb, Ls14baf},
  500. {"s15adf", too_few_2, Ls15adf, wrong_no_2},
  501. {"s15aef", too_few_2, Ls15aef, wrong_no_2},
  502. {"s17acf", too_few_2, Ls17acf, wrong_no_2},
  503. {"s17adf", too_few_2, Ls17adf, wrong_no_2},
  504. {"s17aef", too_few_2, Ls17aef, wrong_no_2},
  505. {"s17aff", too_few_2, Ls17aff, wrong_no_2},
  506. {"s17agf", too_few_2, Ls17agf, wrong_no_2},
  507. {"s17ahf", too_few_2, Ls17ahf, wrong_no_2},
  508. {"s17ajf", too_few_2, Ls17ajf, wrong_no_2},
  509. {"s17akf", too_few_2, Ls17akf, wrong_no_2},
  510. {"s17dcf", wrong_no_na, wrong_no_nb, Ls17dcf},
  511. {"s17def", wrong_no_na, wrong_no_nb, Ls17def},
  512. {"s17dgf", wrong_no_na, wrong_no_nb, Ls17dgf},
  513. {"s17dhf", wrong_no_na, wrong_no_nb, Ls17dhf},
  514. {"s17dlf", wrong_no_na, wrong_no_nb, Ls17dlf},
  515. {"s18acf", too_few_2, Ls18acf, wrong_no_2},
  516. {"s18adf", too_few_2, Ls18adf, wrong_no_2},
  517. {"s18aef", too_few_2, Ls18aef, wrong_no_2},
  518. {"s18aff", too_few_2, Ls18aff, wrong_no_2},
  519. {"s18dcf", wrong_no_na, wrong_no_nb, Ls18dcf},
  520. {"s18def", wrong_no_na, wrong_no_nb, Ls18def},
  521. {"s19aaf", too_few_2, Ls19aaf, wrong_no_2},
  522. {"s19abf", too_few_2, Ls19abf, wrong_no_2},
  523. {"s19acf", too_few_2, Ls19acf, wrong_no_2},
  524. {"s19adf", too_few_2, Ls19adf, wrong_no_2},
  525. {"s20acf", too_few_2, Ls20acf, wrong_no_2},
  526. {"s20adf", too_few_2, Ls20adf, wrong_no_2},
  527. {"s21baf", wrong_no_na, wrong_no_nb, Ls21baf},
  528. {"s21bbf", wrong_no_na, wrong_no_nb, Ls21bbf},
  529. {"s21bcf", wrong_no_na, wrong_no_nb, Ls21bcf},
  530. {"s21bdf", wrong_no_na, wrong_no_nb, Ls21bdf},
  531. #else
  532. {"d01ajf", nag_error1, nag_error2, nag_error0},
  533. {"d01akf", nag_error1, nag_error2, nag_error0},
  534. {"d01alf", nag_error1, nag_error2, nag_error0},
  535. {"d01amf", nag_error1, nag_error2, nag_error0},
  536. {"d01anf", nag_error1, nag_error2, nag_error0},
  537. {"d01apf", nag_error1, nag_error2, nag_error0},
  538. {"d01aqf", nag_error1, nag_error2, nag_error0},
  539. {"d01asf", nag_error1, nag_error2, nag_error0},
  540. {"d01bbf", nag_error1, nag_error2, nag_error0},
  541. {"d01fcf", nag_error1, nag_error2, nag_error0},
  542. {"d01gaf", nag_error1, nag_error2, nag_error0},
  543. {"d01gbf", nag_error1, nag_error2, nag_error0},
  544. {"d02bbf", nag_error1, nag_error2, nag_error0},
  545. {"d02bhf", nag_error1, nag_error2, nag_error0},
  546. {"d02cjf", nag_error1, nag_error2, nag_error0},
  547. {"d02ejf", nag_error1, nag_error2, nag_error0},
  548. {"d02gaf", nag_error1, nag_error2, nag_error0},
  549. {"d02gbf", nag_error1, nag_error2, nag_error0},
  550. {"d02kef", nag_error1, nag_error2, nag_error0},
  551. {"d02raf", nag_error1, nag_error2, nag_error0},
  552. {"d03edf", nag_error1, nag_error2, nag_error0},
  553. {"d03eef", nag_error1, nag_error2, nag_error0},
  554. {"d03faf", nag_error1, nag_error2, nag_error0},
  555. {"s01eaf", nag_error1, nag_error2, nag_error0},
  556. {"s13aaf", nag_error1, nag_error2, nag_error0},
  557. {"s13acf", nag_error1, nag_error2, nag_error0},
  558. {"s13adf", nag_error1, nag_error2, nag_error0},
  559. {"s14aaf", nag_error1, nag_error2, nag_error0},
  560. {"s14abf", nag_error1, nag_error2, nag_error0},
  561. {"s14baf", nag_error1, nag_error2, nag_error0},
  562. {"s15adf", nag_error1, nag_error2, nag_error0},
  563. {"s15aef", nag_error1, nag_error2, nag_error0},
  564. {"s17acf", nag_error1, nag_error2, nag_error0},
  565. {"s17adf", nag_error1, nag_error2, nag_error0},
  566. {"s17aef", nag_error1, nag_error2, nag_error0},
  567. {"s17aff", nag_error1, nag_error2, nag_error0},
  568. {"s17agf", nag_error1, nag_error2, nag_error0},
  569. {"s17ahf", nag_error1, nag_error2, nag_error0},
  570. {"s17ajf", nag_error1, nag_error2, nag_error0},
  571. {"s17akf", nag_error1, nag_error2, nag_error0},
  572. {"s17dcf", nag_error1, nag_error2, nag_error0},
  573. {"s17def", nag_error1, nag_error2, nag_error0},
  574. {"s17dgf", nag_error1, nag_error2, nag_error0},
  575. {"s17dhf", nag_error1, nag_error2, nag_error0},
  576. {"s17dlf", nag_error1, nag_error2, nag_error0},
  577. {"s18acf", nag_error1, nag_error2, nag_error0},
  578. {"s18adf", nag_error1, nag_error2, nag_error0},
  579. {"s18aef", nag_error1, nag_error2, nag_error0},
  580. {"s18aff", nag_error1, nag_error2, nag_error0},
  581. {"s18dcf", nag_error1, nag_error2, nag_error0},
  582. {"s18def", nag_error1, nag_error2, nag_error0},
  583. {"s19aaf", nag_error1, nag_error2, nag_error0},
  584. {"s19abf", nag_error1, nag_error2, nag_error0},
  585. {"s19acf", nag_error1, nag_error2, nag_error0},
  586. {"s19adf", nag_error1, nag_error2, nag_error0},
  587. {"s20acf", nag_error1, nag_error2, nag_error0},
  588. {"s20adf", nag_error1, nag_error2, nag_error0},
  589. {"s21baf", nag_error1, nag_error2, nag_error0},
  590. {"s21bbf", nag_error1, nag_error2, nag_error0},
  591. {"s21bcf", nag_error1, nag_error2, nag_error0},
  592. {"s21bdf", nag_error1, nag_error2, nag_error0},
  593. #endif
  594. {NULL, 0, 0, 0}
  595. };
  596. /* end of nag.c */