=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2018/include/ca.h,v retrieving revision 1.8 retrieving revision 1.15 diff -u -p -r1.8 -r1.15 --- OpenXM_contrib2/asir2018/include/ca.h 2019/03/28 06:46:03 1.8 +++ OpenXM_contrib2/asir2018/include/ca.h 2019/12/13 14:40:49 1.15 @@ -45,7 +45,7 @@ * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. * - * $OpenXM: OpenXM_contrib2/asir2018/include/ca.h,v 1.7 2018/10/02 09:06:15 noro Exp $ + * $OpenXM: OpenXM_contrib2/asir2018/include/ca.h,v 1.14 2019/11/19 10:50:31 noro Exp $ */ #include #include @@ -95,8 +95,13 @@ typedef caddr_t pointer; typedef void * pointer; -#if defined(sun) +#if defined(ANDROID) #include +#include +#define index(s,c) strchr(s,c) +#define rindex(s,c) strrchr(s,c) +#elif defined(sun) +#include #else #include #if defined(VISUAL) || defined(__MINGW32__) @@ -535,6 +540,19 @@ typedef struct oDMM { struct oDMM *next; } *DMM; +typedef struct oDMMstack { + int rank,ordtype; + DMM *in; + DMM *sum; + LIST obj; + struct oDMMstack *next; +} *DMMstack; + +typedef struct oDMMstack_array { + int len; + DMMstack *body; +} *DMMstack_array; + typedef struct oDL { int td; int d[1]; @@ -598,6 +616,11 @@ typedef struct oNODE { struct oNODE *next; } *NODE; +typedef struct oNODE2 { + pointer body1,body2; + struct oNODE2 *next; +} *NODE2; + /* univariate poly over small finite field; dense */ typedef struct oUM { int d; @@ -672,11 +695,13 @@ struct order_spec { int id; Obj obj; int nv; - int ispot; /* 1 means Position over Term (Pos then Term) */ + int module_ordtype; /* 0=TOP, 1=POT, 2=wPOT, 3=Schreyer */ int pot_nelim; /* size of positions for pot-elimination order */ int *top_weight; int module_rank; int *module_top_weight; + struct order_spec *base; /* for schreyer order */ + DMMstack dmmstack; union { int simple; struct { @@ -896,6 +921,8 @@ bzero((char *)(q)->b,(w)*sizeof(unsigned int))) #define NEWVL(vl) ((vl)=(VL)MALLOC(sizeof(struct oVL))) #define NEWMP(m) ((m)=(MP)MALLOC(sizeof(struct oMP))) #define NEWDMM(m) ((m)=(DMM)MALLOC(sizeof(struct oDMM))) +#define NEWDMMstack(m) ((m)=(DMMstack)MALLOC(sizeof(struct oDMMstack))) +#define NEWDMMstack_array(m) ((m)=(DMMstack_array)MALLOC(sizeof(struct oDMMstack_array))) #define NEWDLBUCKET(a) ((a)=(DLBUCKET)MALLOC(sizeof(struct oDLBUCKET))) #define NEWDPP(a) ((a)=(DP_pairs)MALLOC(sizeof(struct dp_pairs))) @@ -932,6 +959,11 @@ DEG(DC(p))=ONE,COEF(DC(p))=(P)ONE,NEXT(DC(p))=0) DEG(DC(p))=ONE,COEF(DC(p))=(P)ONEM,NEXT(DC(p))=0) #define MKNODE(a,b,c) \ (NEWNODE(a),(a)->body=(pointer)b,NEXT(a)=(NODE)(c)) +#define NEWNODE2(a) ((a)=(NODE2)MALLOC(sizeof(struct oNODE2))) +#define MKNODE2(a,b,c,d) \ +(NEWNODE2(a),(a)->body1=(pointer)b,(a)->body2=(pointer)c,NEXT(a)=(NODE2)(d)) +#define BDY1(a) ((a)->body1) +#define BDY2(a) ((a)->body2) #define MKLIST(a,b) (NEWLIST(a),(a)->body=(NODE)(b)) #define MKVECT(m,l) \ (NEWVECT(m),(m)->len=(l),(m)->body=(pointer *)CALLOC((l),sizeof(pointer))) @@ -1776,6 +1808,7 @@ void vntovl(VN,int,VL *); void saveerror(FILE *,ERR); void saveui(FILE *,USINT); void savedp(FILE *,DP); +void savedpm(FILE *,DPM); void savestring(FILE *,STRING); void savemat(FILE *,MAT); void savevect(FILE *,VECT); @@ -1801,6 +1834,7 @@ void savegfsn(FILE *,GFSN); void loaderror(FILE *,ERR *); void loadui(FILE *,USINT *); void loaddp(FILE *,DP *); +void loaddpm(FILE *,DPM *); void loadstring(FILE *,STRING *); void loadmat(FILE *,MAT *); void loadvect(FILE *,VECT *); @@ -2621,7 +2655,7 @@ void nd_det(int mod,MAT f,P *rp); void nd_gr(LIST f,LIST v,int m,int homo,int retdp,int f4,struct order_spec *ord,LIST *rp); void nd_gr_postproc(LIST f,LIST v,int m,struct order_spec *ord,int do_check,LIST *rp); void nd_gr_recompute_trace(LIST f,LIST v,int m,struct order_spec *ord,LIST tlist,LIST *rp); -void nd_gr_trace(LIST f,LIST v,int trace,int homo,int f4,struct order_spec *ord,LIST *rp); +void nd_gr_trace(LIST f,LIST v,int trace,int homo,int retdp,int f4,struct order_spec *ord,LIST *rp); void nd_nf_p(Obj f,LIST g,LIST v,int m,struct order_spec *ord,Obj *rp); void obj_algtodalg(Obj obj,Obj *r); void obj_dalgtoalg(Obj obj,Obj *r);