/* file nag.c */ /* Signature: 7a82cff0 08-Apr-2002 */ /* #define TESTNAG */ /* #define LOADLIB */ #include #include #include #include "machine.h" #include "tags.h" #include "cslerror.h" #include "externs.h" #include "entries.h" #include "arith.h" #ifdef TESTNAG #ifdef LOADLIB /* load DLLs when necessary */ #undef IGNORE /* avoid conflicting macro definitions */ #include /* is this OK here? */ #else /* load DLLs when program is first run */ /* Temporary fix to take account of different naming conventions */ #if defined(__alpha) #define D01AJF d01ajf_ #define SXXEAF sxxeaf_ #elif 1 /* DLL from FPSNT / Win32 version */ /* FIXME */ /* leave D01AJF etc as it is (DLL exports _D01AJF@48) */ #else #define D01AJF d01ajf #define SXXEAF sxxeaf #endif #endif /* LOADLIB */ #ifdef LOADLIB HINSTANCE prevlib = NULL, currlib = NULL; void free_prevlib (); #endif typedef struct { char *str; int32 len; /* or unsigned? */ } fstring1; /* This checks a 32 bit integer's value and returns it as either a fixnum or a bignum. */ #define int2ccl(i)\ (i > -268435455 && i < 268435456) ? fixnum_of_int(i) : make_one_word_bignum(i) extern void mkFortranVectorDouble(double *loc, Lisp_Object v, int32 dim); #include "nag_d.c" /* D chapter routines */ #include "nag_s.c" /* S chapter routines */ /* * Turn a vector of ints into a Lisp vector of vectors, corresponding to * the AXIOM representation of a Matrix(Integer). */ Lisp_Object mkIntVector(int32 v[], int32 nrows, int32 ncols) { Lisp_Object nil=C_nil; Lisp_Object new, new_row; int32 i,j; new = getvector(TAG_VECTOR, TYPE_SIMPLE_VEC, 4*nrows+4); errexit(); /* vectors must pad to an even number of words */ if ((nrows & 1) == 0) elt(new,nrows) = nil; for (i=0;i