=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/include/ca.h,v retrieving revision 1.12 retrieving revision 1.18 diff -u -p -r1.12 -r1.18 --- OpenXM_contrib2/asir2000/include/ca.h 2001/03/13 01:10:26 1.12 +++ OpenXM_contrib2/asir2000/include/ca.h 2001/07/03 01:41:26 1.18 @@ -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.11 2000/12/22 10:03:29 saito Exp $ + * $OpenXM: OpenXM_contrib2/asir2000/include/ca.h,v 1.17 2001/06/25 04:11:43 noro Exp $ */ #include @@ -108,6 +108,7 @@ typedef void * pointer; #define O_F 14 #define O_GFMMAT 15 #define O_BYTEARRAY 16 +#define O_QUOTE 17 #define O_VOID -1 #define N_Q 0 @@ -331,6 +332,12 @@ typedef struct oBYTEARRAY { unsigned char *body; } *BYTEARRAY; +typedef struct oQUOTE { + short id; + short pad; + pointer body; +} *QUOTE; + typedef struct oObj { short id; short pad; @@ -363,16 +370,25 @@ typedef struct oNODE { struct oNODE *next; } *NODE; +/* univariate poly over small finite field; dense */ typedef struct oUM { int d; int c[1]; } *UM; +/* univariate poly with padic coeff */ typedef struct oLUM { int d; int *c[1]; } *LUM; +/* bivariate poly over small finite field; dense */ + +typedef struct oBM { + int d; + UM c[1]; +} *BM; + typedef struct oML { int n; int mod; @@ -522,6 +538,21 @@ bzero((char *)(p),(int)(((n)+1)*sizeof(type)))) (p) = ___q___;\ } +#define W_BMALLOC(dx,dy,p)\ +{\ + BM ___q___;\ + int ___i___;\ + UM *___c___;\ + (___q___) = (BM)ALLOCA(TRUESIZE(oBM,(dy),UM));\ + DEG(___q___) = dy;\ + ___c___ = (UM *)COEF(___q___);\ + for ( ___i___ = 0; ___i___ <= dy; ___i___++ ) {\ + ___c___[___i___] = W_UMALLOC(dx);\ + clearum(___c___[___i___],dx);\ + }\ + (p) = ___q___;\ +} + #define NEWUP2(q,w)\ ((q)=(UP2)MALLOC_ATOMIC(TRUESIZE(oUP2,(w)-1,unsigned int)),\ bzero((char *)(q)->b,(w)*sizeof(unsigned int))) @@ -546,6 +577,7 @@ bzero((char *)(q)->b,(w)*sizeof(unsigned int))) #define NEWERR(e) ((e)=(ERR)MALLOC(sizeof(struct oERR)),OID(e)=O_ERR) #define NEWMATHCAP(e) ((e)=(MATHCAP)MALLOC(sizeof(struct oMATHCAP)),OID(e)=O_MATHCAP) #define NEWBYTEARRAY(e) ((e)=(BYTEARRAY)MALLOC(sizeof(struct oBYTEARRAY)),OID(e)=O_BYTEARRAY) +#define NEWQUOTE(e) ((e)=(QUOTE)MALLOC(sizeof(struct oQUOTE)),OID(e)=O_QUOTE) #define NEWNODE(a) ((a)=(NODE)MALLOC(sizeof(struct oNODE))) #define NEWDC(dc) ((dc)=(DCP)MALLOC(sizeof(struct oDCP))) @@ -597,6 +629,7 @@ DEG(DC(p))=ONE,COEF(DC(p))=(P)ONEM,NEXT(DC(p))=0) #define MKMATHCAP(e,b) (NEWMATHCAP(e),(e)->body=(LIST)(b)) #define MKBYTEARRAY(m,l) \ (NEWBYTEARRAY(m),(m)->len=(l),(m)->body=(char *)MALLOC_ATOMIC((l)),bzero((m)->body,(l))) +#define MKQUOTE(q,b) (NEWQUOTE(q),(q)->body=(pointer)(b)) #define NEXTDC(r,c) \ if(!(r)){NEWDC(r);(c)=(r);}else{NEWDC(NEXT(c));(c)=NEXT(c);} @@ -668,6 +701,11 @@ PL(NM(q))=1,BD(NM(q))[0]=(unsigned int)(n),DN(q)=0,(q) #define ITOS(p) (((unsigned int)(p))&0x7fffffff) #define STOI(i) ((P)((unsigned int)(i)|0x80000000)) +/* immediate GFS representation */ + +#define IFTOF(p) ((int)(((unsigned int)(p))&0x7fffffff)) +#define FTOIF(i) ((int)(((unsigned int)(i)|0x80000000))) + struct cdl { P c; DL d; @@ -725,12 +763,13 @@ extern UP2 ONEUP2; extern FILE *asir_out; #if defined(__GNUC__) extern const int sprime[]; -extern const int lprime[]; #else extern int sprime[]; -extern int lprime[]; #endif +extern int lprime_size; +extern int *lprime; + extern void (*addnumt[])(); extern void (*subnumt[])(); extern void (*mulnumt[])(); @@ -1080,6 +1119,7 @@ int int_bits(int); LUM LUMALLOC(int, int); +BM BMALLOC(int, int); Obj ToAlg(Num); UM *berlemain(register int, UM, UM *); void *Risa_GC_malloc(size_t);