=================================================================== RCS file: /home/cvs/OpenXM/src/ox_toolkit/ox_toolkit.h,v retrieving revision 1.20 retrieving revision 1.24 diff -u -p -r1.20 -r1.24 --- OpenXM/src/ox_toolkit/ox_toolkit.h 2003/06/02 10:25:57 1.20 +++ OpenXM/src/ox_toolkit/ox_toolkit.h 2003/08/21 12:44:06 1.24 @@ -1,5 +1,5 @@ /* -*- mode: C -*- */ -/* $OpenXM: OpenXM/src/ox_toolkit/ox_toolkit.h,v 1.19 2003/05/29 15:50:49 ohara Exp $ */ +/* $OpenXM: OpenXM/src/ox_toolkit/ox_toolkit.h,v 1.23 2003/06/05 21:12:07 ohara Exp $ */ #ifndef _OX_TOOLKIT_H_ @@ -18,10 +18,13 @@ extern "C" { #include #include #include +#include -#define MALLOC(x) malloc((x)) +#define MALLOC(x) GC_MALLOC((x)) +#define MALLOC_ATOMIC(x) GC_MALLOC_ATOMIC((x)) #define ALLOCA(x) alloca((x)) -#define FREE(x) free((x)) +/* #define FREE(x) free((x)) */ +#define FREE(x) #if !defined(__GNUC__) && !defined(__inline__) #define __inline__ @@ -91,6 +94,7 @@ typedef struct cell { struct cmo *cmo; struct cell *next; struct cell *prev; + int exp; } cell; typedef struct { @@ -131,6 +135,21 @@ typedef struct { cmo *ringdef; } cmo_distributed_polynomial; +/* The following is a derived class from cmo_list. + that is, list_append can be used. */ +typedef struct { + int tag; + int length; /* number of monomials */ + cell head[1]; /* list of monomials */ + int var; /* name of the main variable */ +} cmo_polynomial_in_one_variable; + +typedef struct { + int tag; + cmo_list *ringdef; /* list of variables */ + cmo *coef; /* ZZ, QQ, int32, Poly_in_1var, Tree, Zero, DPoly */ +} cmo_recursive_polynomial; + typedef cmo ox; typedef ox ox_sync_ball; @@ -208,6 +227,7 @@ cell* list_first(cmo_list *); int list_endof(cmo_list *, cell *el); cell* list_next(cell *el); cmo_list* list_append(cmo_list*, cmo *ob); +cmo_list* list_append_monomial(cmo_list* , cmo* coef, int exp); cmo_list* list_appendl(cmo_list*, ...); int list_length(cmo_list* ); cmo* list_nth(cmo_list* , int n);