=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/include/ca.h,v retrieving revision 1.56 retrieving revision 1.64 diff -u -p -r1.56 -r1.64 --- OpenXM_contrib2/asir2000/include/ca.h 2005/07/03 10:19:23 1.56 +++ OpenXM_contrib2/asir2000/include/ca.h 2006/03/16 10:08:21 1.64 @@ -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.55 2004/12/18 16:50:10 saito Exp $ + * $OpenXM: OpenXM_contrib2/asir2000/include/ca.h,v 1.63 2006/02/08 02:11:19 noro Exp $ */ #include #include @@ -128,6 +128,7 @@ typedef void * pointer; /* IMAT */ #define O_IMAT 24 /* IMAT */ +#define O_NBP 25 #define N_Q 0 #define N_R 1 @@ -444,6 +445,30 @@ typedef struct oTB { char **body; } *TB; +typedef struct oNBP { + short id; + short pad; + struct oNODE *body; +} *NBP; + +/* non-commutative bivariate monomial */ + +typedef struct oNBM { + int d; + Q c; + unsigned int *b; +} *NBM; + +#define NEWNBM(p) ((p)=(NBM)MALLOC(sizeof(struct oNBM))) +#define NEWNBMBDY(p,d) \ +((p)->b=(unsigned int *)MALLOC((((d)+31)/32)*sizeof(unsigned int))) +#define NEWNBP(p) ((p)=(NBP)MALLOC(sizeof(struct oNBP)),OID(p)=O_NBP) +#define MKNBP(p,b) (NEWNBP(p),BDY(p)=(b)) + +#define NBM_GET(a,j) (((a)[(j)>>5]&(1<<((j)&31)))?1:0) +#define NBM_SET(a,j) ((a)[(j)>>5]|=(1<<((j)&31))) +#define NBM_CLR(a,j) ((a)[(j)>>5]&=(~(1<<((j)&31)))) + typedef struct oObj { short id; short pad; @@ -625,6 +650,7 @@ struct modorder_spec { typedef struct oNumberField { int n; + int psn; int dim; VL vl; P *defpoly; @@ -859,7 +885,7 @@ DEG(DC(p))=ONE,COEF(DC(p))=(P)ONEM,NEXT(DC(p))=0) #define MKERR(e,b) (NEWERR(e),(e)->body=(Obj)(b)) #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))) +(NEWBYTEARRAY(m),(m)->len=(l),(m)->body=(unsigned char *)MALLOC_ATOMIC((l)),bzero((m)->body,(l))) #define MKQUOTE(q,b) (NEWQUOTE(q),(q)->body=(pointer)(b)) #define MKQUOTEARG(q,t,b) (NEWQUOTEARG(q),(q)->type=(t),(q)->body=(pointer)(b)) @@ -1292,7 +1318,7 @@ void copyn(N,int,int *); void kmulnmain(N,N,N *); int qcoefp(Obj); int qcoefr(Obj); -int get_allocwords(void); +long get_allocwords(void); double get_clock(void); void get_eg(struct oEGT *); void printtime(struct oEGT *,struct oEGT *,double); @@ -2446,7 +2472,7 @@ void resume_timer() ; void reset_engine() ; unsigned int get_asir_version() ; char *get_asir_distribution(); -void create_error(ERR *err,unsigned int serial,char *msg); +void create_error(ERR *err,unsigned int serial,char *msg,LIST trace); void init_lprime(); int get_lprime(int index); void create_new_lprimes(int index); @@ -2606,3 +2632,10 @@ void bzero(const void *,int); void bcopy(const void *,void *,int); char *index(char *,int); #endif + +void chsgnnbp(NBP p,NBP *rp); +void subnbp(VL vl,NBP p1,NBP p2, NBP *rp); +void addnbp(VL vl,NBP p1,NBP p2, NBP *rp); +void mulnbp(VL vl,NBP p1,NBP p2, NBP *rp); +void pwrnbp(VL vl,NBP p1,Q n, NBP *rp); +int compnbp(VL vl,NBP p1,NBP p2);