=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2018/include/ca.h,v retrieving revision 1.11 retrieving revision 1.20 diff -u -p -r1.11 -r1.20 --- OpenXM_contrib2/asir2018/include/ca.h 2019/09/19 06:29:48 1.11 +++ OpenXM_contrib2/asir2018/include/ca.h 2021/01/25 00:39:52 1.20 @@ -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.10 2019/08/28 23:27:34 noro Exp $ + * $OpenXM: OpenXM_contrib2/asir2018/include/ca.h,v 1.19 2020/10/06 06:31:19 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__) @@ -445,6 +450,7 @@ typedef struct oQUOTE { short id; short pad; pointer body; + struct oVS *pvs; } *QUOTE; typedef struct oQUOTEARG { @@ -538,10 +544,16 @@ typedef struct oDMM { 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]; @@ -605,6 +617,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; @@ -684,8 +701,10 @@ struct order_spec { int *top_weight; int module_rank; int *module_top_weight; + int *module_base_ord; struct order_spec *base; /* for schreyer order */ DMMstack dmmstack; + int (*cmpdl)(int n,DL d1,DL d2); union { int simple; struct { @@ -813,7 +832,11 @@ void (*set_signal(int sig, void (*handler)(int)))(int) #endif /* for setjmp/longjmp compatibility */ -#if defined(__CYGWIN__) || defined(HAVE_SIGACTION) || (defined(__x86_64) && !defined(__MINGW32__)) +#if defined(ANDROID) +#define JMP_BUF jmp_buf +#define SETJMP(x) _setjmp(x) +#define LONGJMP(x,y) _longjmp(x,y) +#elif defined(__CYGWIN__) || defined(HAVE_SIGACTION) || (defined(__x86_64) && !defined(__MINGW32__)) #define JMP_BUF sigjmp_buf #define SETJMP(x) sigsetjmp(x,~0) #define LONGJMP(x,y) siglongjmp(x,y) @@ -906,6 +929,7 @@ bzero((char *)(q)->b,(w)*sizeof(unsigned int))) #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))) @@ -942,6 +966,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))) @@ -961,7 +990,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=(unsigned char *)MALLOC_ATOMIC((l)),bzero((m)->body,(l))) -#define MKQUOTE(q,b) (NEWQUOTE(q),(q)->body=(pointer)(b)) +#define MKQUOTE(q,b) (NEWQUOTE(q),(q)->body=(pointer)(b),(q)->pvs=CPVS) #define MKQUOTEARG(q,t,b) (NEWQUOTEARG(q),(q)->type=(t),(q)->body=(pointer)(b)) #define NEXTDC(r,c) \ @@ -1438,11 +1467,11 @@ int divcheck(VL,P *,int,P,P); int divtdcpz(VL,P,P,P *); int divtpz(VL,P,P,P *); int divum(register int,UM,UM,UM); -int dm(int,int,int *); -int dmb(int,int,int,int *); -int dma(int,int,int,int *); -int dmab(int,int,int,int,int *); -int dmar(int,int,int,int); +unsigned int dm(unsigned int,unsigned int,unsigned int *); +unsigned int dmb(unsigned int,unsigned int,unsigned int,unsigned int *); +unsigned int dma(unsigned int,unsigned int,unsigned int,unsigned int *); +unsigned int dmab(unsigned int,unsigned int,unsigned int,unsigned int,unsigned int *); +unsigned int dmar(unsigned int,unsigned int,unsigned int,unsigned int); int dtestmain(P,Q,ML,int,int *,P *,P *); int geldb(VL,P); int getchomdeg(V,P);