=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/include/ca.h,v retrieving revision 1.19 retrieving revision 1.28 diff -u -p -r1.19 -r1.28 --- OpenXM_contrib2/asir2000/include/ca.h 2001/08/20 09:03:25 1.19 +++ OpenXM_contrib2/asir2000/include/ca.h 2001/09/17 10:32:41 1.28 @@ -45,7 +45,7 @@ * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. * - * $OpenXM: OpenXM_contrib2/asir2000/include/ca.h,v 1.18 2001/07/03 01:41:26 noro Exp $ + * $OpenXM: OpenXM_contrib2/asir2000/include/ca.h,v 1.27 2001/09/17 08:37:31 noro Exp $ */ #include @@ -58,6 +58,10 @@ #include #endif +#if !defined(VISUAL) +#include +#endif + #if defined(linux) || (defined(sun) && !defined(SYSV)) || defined(news5000) || (defined(mips) && defined(ultrix)) #include #endif @@ -121,6 +125,7 @@ typedef void * pointer; #define N_GF2N 7 #define N_GFPN 8 #define N_GFS 9 +#define N_GFSN 10 #define ORD_REVGRADLEX 0 #define ORD_GRADLEX 1 @@ -246,6 +251,12 @@ typedef struct oGFS { int cont; } *GFS; +typedef struct oGFSN { + short id; + char nid; + char pad; + struct oUM *body; +} *GFSN; typedef struct oP { short id; @@ -360,6 +371,29 @@ typedef struct oDL { int d[1]; } *DL; +/* + * compressed DP + */ + +typedef struct oCDP { + int len; + int psindex; + unsigned int *body; +} *CDP; + +typedef struct oCM { + int index; + int c; +} *CM; + +/* bucket list for DL */ + +typedef struct oDLBUCKET { + int td; + struct oNODE *body; + struct oDLBUCKET *next; +} *DLBUCKET; + typedef struct oVL { V v; struct oVL *next; @@ -451,6 +485,7 @@ struct oEGT { #define FF_GF2N 2 #define FF_GFPN 3 #define FF_GFS 4 +#define FF_GFSN 5 /* include interval.h */ #include "interval.h" @@ -466,6 +501,12 @@ typedef unsigned int ModNum; #endif /* general macros */ +#if defined(MAX) +#undef MAX +#endif +#if defined(MIN) +#undef MIN +#endif #define MAX(a,b) ((a) > (b) ? (a) : (b) ) #define MIN(a,b) ((a) > (b) ? (b) : (a) ) #ifdef ABS @@ -566,6 +607,7 @@ bzero((char *)(q)->b,(w)*sizeof(unsigned int))) #define NEWQ(q) ((q)=(Q)MALLOC(sizeof(struct oQ)),OID(q)=O_N,NID(q)=N_Q) #define NEWMQ(q) ((q)=(MQ)MALLOC_ATOMIC(sizeof(struct oMQ)),OID(q)=O_N,NID(q)=N_M) #define NEWGFS(q) ((q)=(GFS)MALLOC_ATOMIC(sizeof(struct oGFS)),OID(q)=O_N,NID(q)=N_GFS) +#define NEWGFSN(q) ((q)=(GFSN)MALLOC(sizeof(struct oGFSN)),OID(q)=O_N,NID(q)=N_GFSN) #define NEWP(p) ((p)=(P)MALLOC(sizeof(struct oP)),OID(p)=O_P) #define NEWR(r) ((r)=(R)MALLOC(sizeof(struct oR)),OID(r)=O_R,(r)->reduced=0) #define NEWLIST(l) ((l)=(LIST)MALLOC(sizeof(struct oLIST)),OID(l)=O_LIST) @@ -584,6 +626,7 @@ bzero((char *)(q)->b,(w)*sizeof(unsigned int))) #define NEWV(v) ((v)=(V)MALLOC(sizeof(struct oV))) #define NEWVL(vl) ((vl)=(VL)MALLOC(sizeof(struct oVL))) #define NEWMP(m) ((m)=(MP)MALLOC(sizeof(struct oMP))) +#define NEWDLBUCKET(a) ((a)=(DLBUCKET)MALLOC(sizeof(struct oDLBUCKET))) #define NEWMAT(l) ((l)=(MAT)MALLOC(sizeof(struct oMAT)),OID(l)=O_MAT) #define NEWGF2MAT(l) ((l)=(GF2MAT)MALLOC(sizeof(struct oGF2MAT)),OID(l)=O_GF2MAT) @@ -639,6 +682,8 @@ if(!(r)){NEWNODE(r);(c)=(r);}else{NEWNODE(NEXT(c));(c) if(!(r)){NEWMP(r);(c)=(r);}else{NEWMP(NEXT(c));(c)=NEXT(c);} #define NEXTMP2(r,c,s) \ if(!(r)){(c)=(r)=(s);}else{NEXT(c)=(s);(c)=(s);} +#define NEXTDLBUCKET(r,c) \ +if(!(r)){NEWDLBUCKET(r);(c)=(r);}else{NEWDLBUCKET(NEXT(c));(c)=NEXT(c);} /* convertors */ #define NTOQ(n,s,q) \ @@ -655,6 +700,8 @@ PL(NM(q))=1,BD(NM(q))[0]=ABS(n),DN(q)=0,(q))) ((a)?(NEWMQ(b),CONT(b)=(unsigned int)(a),(b)):((b)=0)) #define MKGFS(a,b) \ ((NEWGFS(b),CONT(b)=(a),(b))) +#define MKGFSN(a,b) \ +((DEG(a)>=0)?(NEWGFSN(b),BDY(b)=(a),(b)):((b)=0)) #define STOMQ(a,b) \ ((a)?(NEWMQ(b),CONT(b)=(a),(b)):((b)=0)) #define UTON(u,n) \ @@ -682,8 +729,8 @@ PL(NM(q))=1,BD(NM(q))[0]=(unsigned int)(n),DN(q)=0,(q) /* predicates */ #define NUM(p) (OID(p)==O_N) #define RAT(p) (OID(p)==O_R) -#define INT(q) (!DN((Q)q)) #define RATN(a) (NID(a)==N_Q) +#define INT(q) (!(q)||(NUM(q)&&RATN((Num)q)&&!DN((Q)q))) #define REAL(a) (NID(a)==N_R) #define BIGFLOAT(a) (NID(a)==N_B) #define SFF(a) (NID(a)==N_M) @@ -698,8 +745,13 @@ PL(NM(q))=1,BD(NM(q))[0]=(unsigned int)(n),DN(q)=0,(q) #define NV(p) ((p)->nv) #define C(p) ((p)->c) +#if 0 #define ITOS(p) (((unsigned int)(p))&0x7fffffff) #define STOI(i) ((P)((unsigned int)(i)|0x80000000)) +#else +#define ITOS(p) (((unsigned int)(p))) +#define STOI(i) ((P)((unsigned int)(i))) +#endif /* immediate GFS representation */ @@ -1215,6 +1267,14 @@ void divgfs(GFS,GFS,GFS *); void chsgngfs(GFS,GFS *); void pwrgfs(GFS,Q, GFS *); int cmpgfs(GFS,GFS); + +void addgfsn(GFSN,GFSN,GFSN *); +void subgfsn(GFSN,GFSN,GFSN *); +void mulgfsn(GFSN,GFSN,GFSN *); +void divgfsn(GFSN,GFSN,GFSN *); +void chsgngfsn(GFSN,GFSN *); +void pwrgfsn(GFSN,Q, GFSN *); +int cmpgfsn(GFSN,GFSN); void addalg(Num,Num,Num *); void addbf(Num,Num,Num *);