version 1.8, 2019/03/28 06:46:03 |
version 1.21, 2022/03/30 04:58:53 |
|
|
* DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, |
* DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, |
* PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. |
* 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.20 2021/01/25 00:39:52 noro Exp $ |
*/ |
*/ |
#include <stdio.h> |
#include <stdio.h> |
#include <stdlib.h> |
#include <stdlib.h> |
Line 95 typedef caddr_t pointer; |
|
Line 95 typedef caddr_t pointer; |
|
|
|
typedef void * pointer; |
typedef void * pointer; |
|
|
#if defined(sun) |
#if defined(ANDROID) |
#include <strings.h> |
#include <strings.h> |
|
#include <string.h> |
|
#define index(s,c) strchr(s,c) |
|
#define rindex(s,c) strrchr(s,c) |
|
#elif defined(sun) |
|
#include <strings.h> |
#else |
#else |
#include <string.h> |
#include <string.h> |
#if defined(VISUAL) || defined(__MINGW32__) |
#if defined(VISUAL) || defined(__MINGW32__) |
Line 445 typedef struct oQUOTE { |
|
Line 450 typedef struct oQUOTE { |
|
short id; |
short id; |
short pad; |
short pad; |
pointer body; |
pointer body; |
|
struct oVS *pvs; |
} *QUOTE; |
} *QUOTE; |
|
|
typedef struct oQUOTEARG { |
typedef struct oQUOTEARG { |
Line 535 typedef struct oDMM { |
|
Line 541 typedef struct oDMM { |
|
struct oDMM *next; |
struct oDMM *next; |
} *DMM; |
} *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 { |
typedef struct oDL { |
int td; |
int td; |
int d[1]; |
int d[1]; |
Line 598 typedef struct oNODE { |
|
Line 617 typedef struct oNODE { |
|
struct oNODE *next; |
struct oNODE *next; |
} *NODE; |
} *NODE; |
|
|
|
typedef struct oNODE2 { |
|
pointer body1,body2; |
|
struct oNODE2 *next; |
|
} *NODE2; |
|
|
/* univariate poly over small finite field; dense */ |
/* univariate poly over small finite field; dense */ |
typedef struct oUM { |
typedef struct oUM { |
int d; |
int d; |
Line 672 struct order_spec { |
|
Line 696 struct order_spec { |
|
int id; |
int id; |
Obj obj; |
Obj obj; |
int nv; |
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 pot_nelim; /* size of positions for pot-elimination order */ |
int *top_weight; |
int *top_weight; |
int module_rank; |
int module_rank; |
int *module_top_weight; |
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 { |
union { |
int simple; |
int simple; |
struct { |
struct { |
Line 804 void (*set_signal(int sig, void (*handler)(int)))(int) |
|
Line 832 void (*set_signal(int sig, void (*handler)(int)))(int) |
|
#endif |
#endif |
|
|
/* for setjmp/longjmp compatibility */ |
/* 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(_WIN64) && (defined(__CYGWIN__) || defined(HAVE_SIGACTION) || (defined(__x86_64) && !defined(__MINGW32__))) |
#define JMP_BUF sigjmp_buf |
#define JMP_BUF sigjmp_buf |
#define SETJMP(x) sigsetjmp(x,~0) |
#define SETJMP(x) sigsetjmp(x,~0) |
#define LONGJMP(x,y) siglongjmp(x,y) |
#define LONGJMP(x,y) siglongjmp(x,y) |
Line 896 bzero((char *)(q)->b,(w)*sizeof(unsigned int))) |
|
Line 928 bzero((char *)(q)->b,(w)*sizeof(unsigned int))) |
|
#define NEWVL(vl) ((vl)=(VL)MALLOC(sizeof(struct oVL))) |
#define NEWVL(vl) ((vl)=(VL)MALLOC(sizeof(struct oVL))) |
#define NEWMP(m) ((m)=(MP)MALLOC(sizeof(struct oMP))) |
#define NEWMP(m) ((m)=(MP)MALLOC(sizeof(struct oMP))) |
#define NEWDMM(m) ((m)=(DMM)MALLOC(sizeof(struct oDMM))) |
#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 NEWDLBUCKET(a) ((a)=(DLBUCKET)MALLOC(sizeof(struct oDLBUCKET))) |
#define NEWDPP(a) ((a)=(DP_pairs)MALLOC(sizeof(struct dp_pairs))) |
#define NEWDPP(a) ((a)=(DP_pairs)MALLOC(sizeof(struct dp_pairs))) |
|
|
Line 932 DEG(DC(p))=ONE,COEF(DC(p))=(P)ONE,NEXT(DC(p))=0) |
|
Line 966 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) |
DEG(DC(p))=ONE,COEF(DC(p))=(P)ONEM,NEXT(DC(p))=0) |
#define MKNODE(a,b,c) \ |
#define MKNODE(a,b,c) \ |
(NEWNODE(a),(a)->body=(pointer)b,NEXT(a)=(NODE)(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 MKLIST(a,b) (NEWLIST(a),(a)->body=(NODE)(b)) |
#define MKVECT(m,l) \ |
#define MKVECT(m,l) \ |
(NEWVECT(m),(m)->len=(l),(m)->body=(pointer *)CALLOC((l),sizeof(pointer))) |
(NEWVECT(m),(m)->len=(l),(m)->body=(pointer *)CALLOC((l),sizeof(pointer))) |
Line 951 DEG(DC(p))=ONE,COEF(DC(p))=(P)ONEM,NEXT(DC(p))=0) |
|
Line 990 DEG(DC(p))=ONE,COEF(DC(p))=(P)ONEM,NEXT(DC(p))=0) |
|
#define MKMATHCAP(e,b) (NEWMATHCAP(e),(e)->body=(LIST)(b)) |
#define MKMATHCAP(e,b) (NEWMATHCAP(e),(e)->body=(LIST)(b)) |
#define MKBYTEARRAY(m,l) \ |
#define MKBYTEARRAY(m,l) \ |
(NEWBYTEARRAY(m),(m)->len=(l),(m)->body=(unsigned 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 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 MKQUOTEARG(q,t,b) (NEWQUOTEARG(q),(q)->type=(t),(q)->body=(pointer)(b)) |
|
|
#define NEXTDC(r,c) \ |
#define NEXTDC(r,c) \ |
Line 1428 int divcheck(VL,P *,int,P,P); |
|
Line 1467 int divcheck(VL,P *,int,P,P); |
|
int divtdcpz(VL,P,P,P *); |
int divtdcpz(VL,P,P,P *); |
int divtpz(VL,P,P,P *); |
int divtpz(VL,P,P,P *); |
int divum(register int,UM,UM,UM); |
int divum(register int,UM,UM,UM); |
int dm(int,int,int *); |
unsigned int dm(unsigned int,unsigned int,unsigned int *); |
int dmb(int,int,int,int *); |
unsigned int dmb(unsigned int,unsigned int,unsigned int,unsigned int *); |
int dma(int,int,int,int *); |
unsigned int dma(unsigned int,unsigned int,unsigned int,unsigned int *); |
int dmab(int,int,int,int,int *); |
unsigned int dmab(unsigned int,unsigned int,unsigned int,unsigned int,unsigned int *); |
int dmar(int,int,int,int); |
unsigned int dmar(unsigned int,unsigned int,unsigned int,unsigned int); |
int dtestmain(P,Q,ML,int,int *,P *,P *); |
int dtestmain(P,Q,ML,int,int *,P *,P *); |
int geldb(VL,P); |
int geldb(VL,P); |
int getchomdeg(V,P); |
int getchomdeg(V,P); |
Line 1776 void vntovl(VN,int,VL *); |
|
Line 1815 void vntovl(VN,int,VL *); |
|
void saveerror(FILE *,ERR); |
void saveerror(FILE *,ERR); |
void saveui(FILE *,USINT); |
void saveui(FILE *,USINT); |
void savedp(FILE *,DP); |
void savedp(FILE *,DP); |
|
void savedpm(FILE *,DPM); |
void savestring(FILE *,STRING); |
void savestring(FILE *,STRING); |
void savemat(FILE *,MAT); |
void savemat(FILE *,MAT); |
void savevect(FILE *,VECT); |
void savevect(FILE *,VECT); |
Line 1801 void savegfsn(FILE *,GFSN); |
|
Line 1841 void savegfsn(FILE *,GFSN); |
|
void loaderror(FILE *,ERR *); |
void loaderror(FILE *,ERR *); |
void loadui(FILE *,USINT *); |
void loadui(FILE *,USINT *); |
void loaddp(FILE *,DP *); |
void loaddp(FILE *,DP *); |
|
void loaddpm(FILE *,DPM *); |
void loadstring(FILE *,STRING *); |
void loadstring(FILE *,STRING *); |
void loadmat(FILE *,MAT *); |
void loadmat(FILE *,MAT *); |
void loadvect(FILE *,VECT *); |
void loadvect(FILE *,VECT *); |
Line 2621 void nd_det(int mod,MAT f,P *rp); |
|
Line 2662 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(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_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_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 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_algtodalg(Obj obj,Obj *r); |
void obj_dalgtoalg(Obj obj,Obj *r); |
void obj_dalgtoalg(Obj obj,Obj *r); |