version 1.3, 2018/09/24 22:26:43 |
version 1.10, 2019/08/28 23:27:34 |
|
|
* 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.2 2018/09/21 07:06:51 noro Exp $ |
* $OpenXM: OpenXM_contrib2/asir2018/include/ca.h,v 1.9 2019/08/21 00:37:47 noro Exp $ |
*/ |
*/ |
#include <stdio.h> |
#include <stdio.h> |
#include <stdlib.h> |
#include <stdlib.h> |
Line 197 typedef unsigned _int64 UL; |
|
Line 197 typedef unsigned _int64 UL; |
|
#endif |
#endif |
|
|
#if defined(__GNUC__) && SIZEOF_LONG == 8 |
#if defined(__GNUC__) && SIZEOF_LONG == 8 |
typedef __uint64_t U64; |
|
typedef __uint128_t U128; |
typedef __uint128_t U128; |
typedef __int64_t L64; |
typedef __int64_t L64; |
typedef __int128_t L128; |
typedef __int128_t L128; |
|
|
#endif |
#endif |
|
|
typedef struct oZ { |
typedef struct oZ { |
Line 535 typedef struct oDMM { |
|
Line 535 typedef struct oDMM { |
|
struct oDMM *next; |
struct oDMM *next; |
} *DMM; |
} *DMM; |
|
|
|
typedef struct oDMMstack { |
|
int rank,ordtype; |
|
DMM *in; |
|
struct oDMMstack *next; |
|
} *DMMstack; |
|
|
typedef struct oDL { |
typedef struct oDL { |
int td; |
int td; |
int d[1]; |
int d[1]; |
Line 771 typedef unsigned int ModNum; |
|
Line 777 typedef unsigned int ModNum; |
|
#define COEF(p) ((p)->c) |
#define COEF(p) ((p)->c) |
#define DEG(p) ((p)->d) |
#define DEG(p) ((p)->d) |
#define CONT(a) ((a)->cont) |
#define CONT(a) ((a)->cont) |
#define UDEG(f) QTOS(DEG(DC(f))) |
#define UDEG(f) ZTOS(DEG(DC(f))) |
#define UCOEF(f) (COEF(DC(f))) |
#define UCOEF(f) (COEF(DC(f))) |
#define LC(f) (NUM(f)?(f):COEF(DC(f))) |
#define LC(f) (NUM(f)?(f):COEF(DC(f))) |
|
|
Line 896 bzero((char *)(q)->b,(w)*sizeof(unsigned int))) |
|
Line 902 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 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 978 if(!(r)){NEWDMM(r);(c)=(r);}else{NEWDMM(NEXT(c));(c)=N |
|
Line 985 if(!(r)){NEWDMM(r);(c)=(r);}else{NEWDMM(NEXT(c));(c)=N |
|
#define DUPZ(p,q) (NEWZ(q),BDY(q)=BDY(p)) |
#define DUPZ(p,q) (NEWZ(q),BDY(q)=BDY(p)) |
#define DUPQ(p,q) (NEWQ(q),BDY(q)=BDY(p)) |
#define DUPQ(p,q) (NEWQ(q),BDY(q)=BDY(p)) |
|
|
#define STOQ(n,q) ((!(n))?((q)=0):(NEWZ(q),mpz_set_si(BDY(q),n))) |
#define STOZ(n,q) ((!(n))?(void)((q)=0):(NEWZ(q),mpz_set_si(BDY(q),n))) |
#define UTOQ(n,q) ((!(n))?((q)=0):(NEWZ(q),mpz_set_ui(BDY(q),n))) |
#define UTOZ(n,q) ((!(n))?(void)((q)=0):(NEWZ(q),mpz_set_ui(BDY(q),n))) |
|
|
/* for initializing static object */ |
/* for initializing static object */ |
#define STOQ0(n,q) (OID(q)=O_N,NID(q)=N_Q,(q)->z=1,mpz_init(BDY(q)),mpz_set_si(BDY(q),n)) |
#define STOZ0(n,q) (OID(q)=O_N,NID(q)=N_Q,(q)->z=1,mpz_init(BDY(q)),mpz_set_si(BDY(q),n)) |
#define STOLM0(n,q) (OID(q)=O_N,NID(q)=N_LM,mpz_init(BDY(q)),mpz_set_si(BDY(q),n)) |
#define STOLM0(n,q) (OID(q)=O_N,NID(q)=N_LM,mpz_init(BDY(q)),mpz_set_si(BDY(q),n)) |
|
|
#define QTOS(q) (!(q)?0:((q)->z==1?mpz_get_si(BDY((Z)q)):(error("QTOS : invalid argument"),0))) |
#define ZTOS(q) (!(q)?0:((q)->z==1?mpz_get_si(BDY((Z)q)):(error("ZTOS : invalid argument"),0))) |
#define LMTOS(q) (!(q)?0:mpz_get_si(BDY(q))) |
#define LMTOS(q) (!(q)?0:mpz_get_si(BDY(q))) |
|
|
#define UTOMQ(a,b) ((a)?(NEWMQ(b),CONT(b)=(unsigned int)(a),(b)):((b)=0)) |
#define UTOMQ(a,b) ((a)?(NEWMQ(b),CONT(b)=(unsigned int)(a),(b)):((b)=0)) |
Line 1021 if(!(r)){NEWDMM(r);(c)=(r);}else{NEWDMM(NEXT(c));(c)=N |
|
Line 1028 if(!(r)){NEWDMM(r);(c)=(r);}else{NEWDMM(NEXT(c));(c)=N |
|
#define UNIMQ(q) ((q)&&NUM(q)&&SFF(q)&&(CONT((MQ)q)==1)) |
#define UNIMQ(q) ((q)&&NUM(q)&&SFF(q)&&(CONT((MQ)q)==1)) |
#define MUNIMQ(q) ((q)&&NUM(q)&&SFF(q)&&(CONT((MQ)q)==-1)) |
#define MUNIMQ(q) ((q)&&NUM(q)&&SFF(q)&&(CONT((MQ)q)==-1)) |
#define EVENZ(n) ((!(n))||(INT(n)&&mpz_tstbit(((Z)(n))->body,0)==0)) |
#define EVENZ(n) ((!(n))||(INT(n)&&mpz_tstbit(((Z)(n))->body,0)==0)) |
|
#define UNIMPZ(q) (mpz_cmp_si(q,1)==0) |
|
#define MUNIMPZ(q) (mpz_cmp_si(q,-1)==0) |
|
|
/* special macros for private memory management */ |
/* special macros for private memory management */ |
|
|
Line 1436 int geldb(VL,P); |
|
Line 1445 int geldb(VL,P); |
|
int getchomdeg(V,P); |
int getchomdeg(V,P); |
int getdeg(V,P); |
int getdeg(V,P); |
int getlchomdeg(V,P,int *); |
int getlchomdeg(V,P,int *); |
int get_lprime(int); |
|
int homdeg(P); |
int homdeg(P); |
unsigned int invm(unsigned int,int); |
unsigned int invm(unsigned int,int); |
int iscycm(P); |
int iscycm(P); |
Line 1775 void vntovl(VN,int,VL *); |
|
Line 1783 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 1800 void savegfsn(FILE *,GFSN); |
|
Line 1809 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 2620 void nd_det(int mod,MAT f,P *rp); |
|
Line 2630 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); |
Line 2690 void hextoz(char *hex,Z *np); |
|
Line 2700 void hextoz(char *hex,Z *np); |
|
void todouble(Obj,Obj *); |
void todouble(Obj,Obj *); |
|
|
void lmtolf(LM f,Z *b); |
void lmtolf(LM f,Z *b); |
|
|
|
#if SIZEOF_LONG == 8 |
|
mp_limb_t get_lprime64(int index); |
|
mp_limb_t **almat64(int,int); |
|
mp_limb_t remqi64(Q n,mp_limb_t m); |
|
int generic_gauss_elim64(MAT mat,MAT *nm,Z *dn,int **rindp,int **cindp); |
|
int generic_gauss_elim_mod64(mp_limb_t **mat,int row,int col,mp_limb_t md,int *colstat); |
|
#endif |
|
|
#if defined(VISUAL) || defined(__MINGW32__) |
#if defined(VISUAL) || defined(__MINGW32__) |
void check_intr(); |
void check_intr(); |