1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
|
/*===========================================================================
saclib.h
Header file for SACLIB
===========================================================================*/
#ifndef SACLIB_H
#define SACLIB_H
#include "sacsys.h"
#include "sactypes.h"
#include "hfloats.h"
#include <stdlib.h>
/*-------------------------------------------
Constants
-------------------------------------------*/
#define NIL BETA
#define GC_CHECK 0
#define GC_NO_CHECK 1
#define SAC_KEEPMEM 0
#define SAC_FREEMEM 1
/* FIXED = dimension of fixed size array used in IPROD to hold
* the operands. FIXEDX2 / 2 > FIXED >= MAXCLASSICAL.
*/
#define FIXED 200
/* FIXEDX2 = dimension of fixed size array used in IPROD to hold
* the result. FIXEDX2 > FIXED * 2.
*/
#define FIXEDX2 401
/* WORK is the dimension of the fixed size work array for KARATSUBA
* it has to be >= 2(FIXED - a + 3 floor(log_2(FIXED - 3))),
* where a = 2^(k - 1) + 3 * k
* and k = ceiling(log_2(MAXCLASSICAL - 3)).
*/
#define WORK 400
/* If integers are of length <= MAXCLASSICAL
* classical multiplication is used,
* i.e. the Karatsuba algorithm is not invoked.
* MAXCLASSICAL <= FIXED.
* Also the Karatsuba algorithm KARATSUBA uses classical multiplication
* for operands of length <= MAXCLASSICAL.
* The Karatsuba algorithm requires MAXCLASSICAL >= 4.
*/
#define MAXCLASSICAL 14
/*-------------------------------------------
Function Prototypes
-------------------------------------------*/
#include "sacproto.h"
/*-------------------------------------------
Macros
--------------------------------------------*/
#include "sacmacros.h"
/*-------------------------------------------
External Variables
-------------------------------------------*/
/* List processing
*/
extern Word AVAIL;
extern char *BACSTACK;
extern Word GCC;
extern Word GCCC;
extern Word GCAC;
extern Word GCGLOBALS;
extern Word GCM;
extern Word NU;
extern Word RHO;
extern Word *SPACE;
extern Word *SPACEB;
extern Word *SPACEB1;
extern Word GCAAVAIL;
extern GCArray *GCASPACE;
extern GCArray *GCASPACEBp;
extern Word NUp;
extern Word BETAp;
extern Word BETApp;
/* Timing
*/
extern Word TAU;
extern Word TAU0;
extern Word TAU1;
/* Integer arithmetic
*/
extern Word DELTA;
extern Word EPSIL;
extern Word ETA;
extern Word RINC;
extern Word RMULT;
extern Word RTERM;
extern Word TABP2[];
extern Word THETA;
extern Word TMI[128];
extern Word ZETA;
/* Miscellaneous
*/
extern BDigit *FFPLUS1;
extern BDigit FFSIZE;
extern Word NPFDS;
extern Word SPRIME;
extern Word NSPRIME;
extern Word MPRIME;
extern Word NMPRIME;
extern Word LPRIME;
extern Word NLPRIME;
extern Word UZ210;
extern Word NPTR1;
extern Word GCAPTR1;
/* Input/Output
*/
extern Word LASTCHAR;
#endif
|