version 1.95, 2016/03/31 01:40:11 |
version 1.101, 2017/08/30 09:40:30 |
|
|
* 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/asir2000/include/ca.h,v 1.94 2015/08/20 08:42:07 noro Exp $ |
* $OpenXM: OpenXM_contrib2/asir2000/include/ca.h,v 1.100 2017/02/28 07:06:28 noro Exp $ |
*/ |
*/ |
#include <stdio.h> |
#include <stdio.h> |
#include <stdlib.h> |
#include <stdlib.h> |
#include <gmp.h> |
#include <gmp.h> |
#include <mpc.h> |
#include <mpc.h> |
|
#include <limits.h> |
|
|
/* from mpfr-impl.h */ |
/* from mpfr-impl.h */ |
#define MPFR_PREC(x) ((x)->_mpfr_prec) |
#define MPFR_PREC(x) ((x)->_mpfr_prec) |
|
|
#define MPFR_LAST_LIMB(x) ((MPFR_PREC (x) - 1) / GMP_NUMB_BITS) |
#define MPFR_LAST_LIMB(x) ((MPFR_PREC (x) - 1) / GMP_NUMB_BITS) |
#define MPFR_LIMB_SIZE(x) (MPFR_LAST_LIMB (x) + 1) |
#define MPFR_LIMB_SIZE(x) (MPFR_LAST_LIMB (x) + 1) |
|
|
|
#define RAT_CEIL(nm,dn) (((nm)+(dn)-1)/((dn))) |
|
#define MPFR_LIMB_SIZE_REAL(x) (RAT_CEIL(MPFR_PREC((x)),sizeof(mp_limb_t)*CHAR_BIT) * (sizeof(mp_limb_t)/sizeof(int)) ) |
|
#define MPFR_LIMB_SIZE_BODY(x) (RAT_CEIL(MPFR_PREC((x)),sizeof(unsigned int)*CHAR_BIT)) |
|
|
#if defined(hpux) |
#if defined(hpux) |
#include <netinet/in.h> |
#include <netinet/in.h> |
# define setbuffer(FP,buf,siz) setvbuf(FP,buf,_IOFBF,siz) |
# define setbuffer(FP,buf,siz) setvbuf(FP,buf,_IOFBF,siz) |
Line 775 typedef unsigned int ModNum; |
|
Line 780 typedef unsigned int ModNum; |
|
#define GCFREE(p) Risa_GC_free(p) |
#define GCFREE(p) Risa_GC_free(p) |
#define CALLOC(d,e) MALLOC((d)*(e)) |
#define CALLOC(d,e) MALLOC((d)*(e)) |
|
|
|
#if 0 |
#if !defined(__CYGWIN__) && (defined(__GNUC__) || defined(vax) || defined(apollo) || defined(alloca) || defined(VISUAL) || defined(__MINGW32__)) |
#if !defined(__CYGWIN__) && (defined(__GNUC__) || defined(vax) || defined(apollo) || defined(alloca) || defined(VISUAL) || defined(__MINGW32__)) |
#define ALLOCA(d) alloca(d) |
#define ALLOCA(d) alloca(d) |
#else |
#else |
#define ALLOCA(d) MALLOC(d) |
#define ALLOCA(d) MALLOC(d) |
#endif |
#endif |
|
#endif |
|
|
|
#define ALLOCA(d) MALLOC(d) |
|
|
|
/* for handling signals */ |
|
#if defined(HAVE_SIGACTION) /* POSIX */ |
|
void (*set_signal(int sig, void (*handler)(int)))(int); |
|
#define set_signal_for_restart(x,y) (0) |
|
#else |
|
#define set_signal(x,y) (signal(x,y)) |
|
#define set_signal_for_restart(x,y) (signal(x,y)) |
|
#endif |
|
|
/* for setjmp/longjmp compatibility */ |
/* for setjmp/longjmp compatibility */ |
#if defined(__CYGWIN__) || (defined(__x86_64) && !defined(__MINGW32__)) |
#if 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 1003 PL(NM(q))=1,BD(NM(q))[0]=(unsigned int)(n),DN(q)=0,(q) |
|
Line 1021 PL(NM(q))=1,BD(NM(q))[0]=(unsigned int)(n),DN(q)=0,(q) |
|
#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 MUNIQ(q) ((q)&&NUM(q)&&RATN(q)&&(SGN((Q)q)==-1)&&UNIN(NM((Q)q))&&(!DN((Q)q))) |
#define MUNIQ(q) ((q)&&NUM(q)&&RATN(q)&&(SGN((Q)q)==-1)&&UNIN(NM((Q)q))&&(!DN((Q)q))) |
#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 UNILM(n) ((n)&&UNIN(BDY(n))) |
#define UNIN(n) ((n)&&(PL(n)==1)&&(BD(n)[0]==1)) |
#define UNIN(n) ((n)&&(PL(n)==1)&&(BD(n)[0]==1)) |
#define EVENN(n) ((!(n))||(!(BD(n)[0]%2))) |
#define EVENN(n) ((!(n))||(!(BD(n)[0]%2))) |
|
|
Line 1816 void pwrreal(Num,Num,Real *); |
|
Line 1835 void pwrreal(Num,Num,Real *); |
|
void pwrmi(MQ,Q,MQ *); |
void pwrmi(MQ,Q,MQ *); |
void pwrlm(LM,Q,LM *); |
void pwrlm(LM,Q,LM *); |
void pwrum(int,UM,int,UM); |
void pwrum(int,UM,int,UM); |
void reallocarray(char **,int *,int *,int); |
void asir_reallocarray(char **,int *,int *,int); |
void reductr(VL,Obj,Obj *); |
void reductr(VL,Obj,Obj *); |
void reimtocplx(Num,Num,Num *); |
void reimtocplx(Num,Num,Num *); |
void rem2q(Q,Q,Q,Q *); |
void rem2q(Q,Q,Q,Q *); |
Line 2852 int poly_is_dependent(P p,V v); |
|
Line 2871 int poly_is_dependent(P p,V v); |
|
int setsecureflag(char *name,int value); |
int setsecureflag(char *name,int value); |
int sfdegtest(int dy,int bound,UM *d1c,int k,int *in); |
int sfdegtest(int dy,int bound,UM *d1c,int k,int *in); |
int sgnz(Z n); |
int sgnz(Z n); |
|
|
|
#if defined(VISUAL) || defined(__MINGW32__) |
|
void check_intr(); |
|
void enter_signal_cs(); |
|
void leave_signal_cs(); |
|
void leave_signal_cs_all(); |
|
#define LEAVE_SIGNAL_CS_ALL leave_signal_cs_all() |
|
#else |
|
#define LEAVE_SIGNAL_CS_ALL |
|
#endif |