[BACK]Return to ca.h CVS log [TXT][DIR] Up to [local] / OpenXM_contrib2 / asir2000 / include

Diff for /OpenXM_contrib2/asir2000/include/ca.h between version 1.81 and 1.106

version 1.81, 2011/06/16 08:17:15 version 1.106, 2018/03/29 01:32:53
Line 45 
Line 45 
  * 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.80 2011/05/11 06:03:53 ohara Exp $   * $OpenXM: OpenXM_contrib2/asir2000/include/ca.h,v 1.105 2018/03/27 06:29:19 noro Exp $
 */  */
 #include <stdio.h>  #include <stdio.h>
 #include <stdlib.h>  #include <stdlib.h>
   #include <gmp.h>
   #include <mpc.h>
   #include <limits.h>
   
   /* from mpfr-impl.h */
   #define MPFR_PREC(x)      ((x)->_mpfr_prec)
   #define MPFR_EXP(x)       ((x)->_mpfr_exp)
   #define MPFR_MANT(x)      ((x)->_mpfr_d)
   #define MPFR_LAST_LIMB(x) ((MPFR_PREC (x) - 1) / GMP_NUMB_BITS)
   #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)
 #endif  #endif
   
 #if !defined(VISUAL)  #if !defined(VISUAL) && !defined(__MINGW32__)
 #include <unistd.h>  #include <unistd.h>
 #include <sys/param.h>  #include <sys/param.h>
 #endif  #endif
Line 68 
Line 82 
 #define alloca(x) __builtin_alloca(x)  #define alloca(x) __builtin_alloca(x)
 #endif  #endif
   
 #if defined(VISUAL)  #if defined(VISUAL) || defined(__MINGW32__)
   #include <limits.h>
 #include <malloc.h>  #include <malloc.h>
 #endif  #endif
   
Line 77 
Line 92 
 typedef caddr_t pointer;  typedef caddr_t pointer;
 #endif  #endif
   
   
 typedef void * pointer;  typedef void * pointer;
   
 #if defined(sun)  #if defined(sun)
 #include <strings.h>  #include <strings.h>
 #else  #else
 #include <string.h>  #include <string.h>
 #if defined(VISUAL)  #if defined(VISUAL) || defined(__MINGW32__)
 #define index(s,c) strchr(s,c)  #define index(s,c) strchr(s,c)
 #define bzero(s,len) memset(s,0,len)  #define bzero(s,len) memset(s,0,len)
 #define bcopy(x,y,len) memcpy(y,x,len)  #define bcopy(x,y,len) memcpy(y,x,len)
Line 92  typedef void * pointer;
Line 108  typedef void * pointer;
   
 #define NULLP ((void *)0)  #define NULLP ((void *)0)
   
 #define TODO            printf("%s: not implemented!\n", __func__)  #define TODO    printf("%s: not implemented!\n", __func__)
   
 #define COPY(a,b) ((b)=(a))  #define COPY(a,b) ((b)=(a))
 #define FREEN(p)  #define FREEN(p)
Line 130  typedef void * pointer;
Line 146  typedef void * pointer;
 #define O_IMAT 24  #define O_IMAT 24
 /* IMAT */  /* IMAT */
 #define O_NBP 25  #define O_NBP 25
   #define O_DPM 26
   
 #define N_Q 0  #define N_Q 0
 #define N_R 1  #define N_R 1
 #define N_A 2  #define N_A 2
 #define N_B 3  #define N_B 3
 #define N_C 4  #define N_NEXT_B    (N_B)
 #define N_M 5  #if defined(INTERVAL)
 #define N_LM 6  #define N_Quad  (N_NEXT_B+1)
 #define N_GF2N 7  #define  N_IP  (N_NEXT_B+2)
 #define N_GFPN 8  #define N_IntervalDouble  (N_NEXT_B+3)
 #define N_GFS 9  #define N_IntervalQuad  (N_NEXT_B+4)
 #define N_GFSN 10  #define N_IntervalBigFloat  (N_NEXT_B+5)
 #define N_DA 11  #define N_PRE_C  N_IntervalBigFloat
   #define N_BASE (N_NEXT_B+5)
   #else
   #define N_BASE N_NEXT_B
   #endif
   #define N_C (N_BASE+1)
   #define N_M (N_BASE+2)
   #define N_LM (N_BASE+3)
   #define N_GF2N (N_BASE+4)
   #define N_GFPN (N_BASE+5)
   #define N_GFS (N_BASE+6)
   #define N_GFSN (N_BASE+7)
   #define N_DA (N_BASE+8)
   #define N_GZ (N_BASE+9)
   #define N_GQ (N_BASE+10)
   #define N_PARIB (N_BASE+11)
   
 #define ORD_REVGRADLEX 0  #define ORD_REVGRADLEX 0
 #define ORD_GRADLEX 1  #define ORD_GRADLEX 1
 #define ORD_LEX 2  #define ORD_LEX 2
   
 typedef enum {  typedef enum {
         A_end=0,A_fnode,A_arf,A_int,A_str,A_internal,A_node,A_notimpl,A_func    A_end=0,A_fnode,A_arf,A_int,A_str,A_internal,A_node,A_notimpl,A_func
 } farg_type;  } farg_type;
   
 #if SIZEOF_LONG == 8  #if SIZEOF_LONG == 8
Line 163  typedef _int64 L;
Line 195  typedef _int64 L;
 typedef unsigned _int64 UL;  typedef unsigned _int64 UL;
 #endif  #endif
   
   #if defined(__GNUC__) && SIZEOF_LONG == 8
   typedef __uint64_t U64;
   typedef __uint128_t U128;
   typedef __int64_t L64;
   typedef __int128_t L128;
   #endif
   
 typedef struct oN {  typedef struct oN {
         int p;    int p;
         unsigned int b[1];    unsigned int b[1];
 } *N;  } *N;
   
 typedef struct oZ {  typedef struct oZ {
         int p;    int p;
         unsigned int b[1];    unsigned int b[1];
 } *Z;  } *Z;
   
 typedef struct oUP2 {  typedef struct oUP2 {
         int w;    int w;
         unsigned int b[1];    unsigned int b[1];
 } *UP2;  } *UP2;
   
 typedef struct _oUP2 {  typedef struct _oUP2 {
         int w;    int w;
         unsigned int *b;    unsigned int *b;
 } *_UP2;  } *_UP2;
   
 #define UP2_DENSE 0  #define UP2_DENSE 0
 #define UP2_SPARSE 1  #define UP2_SPARSE 1
   
 typedef struct oGEN_UP2 {  typedef struct oGEN_UP2 {
         int id;    int id;
         UP2 dense;    UP2 dense;
         UP2 sparse;    UP2 sparse;
 } *GEN_UP2;  } *GEN_UP2;
   
 typedef struct oV {  typedef struct oV {
         char *name;    char *name;
         pointer attr;    pointer attr;
         pointer priv;    pointer priv;
 } *V;  } *V;
   
 typedef struct oQ {  typedef struct oQ {
         short id;    short id;
         char nid;    char nid;
         char sgn;    char sgn;
         N nm;    N nm;
         N dn;    N dn;
 } *Q;  } *Q;
   
 typedef struct oReal {  typedef struct oReal {
         short id;    short id;
         char nid;    char nid;
         char pad;    char pad;
         double body;    double body;
 } *Real;  } *Real;
   
 typedef struct oAlg {  typedef struct oAlg {
         short id;    short id;
         char nid;    char nid;
         char pad;    char pad;
         struct oObj *body;    struct oObj *body;
 } *Alg;  } *Alg;
   
 typedef struct oBF {  typedef struct oBF {
         short id;    short id;
         char nid;    char nid;
         char pad;    char pad;
         long body[1];    mpfr_t body;
 } *BF;  } *BF;
   
 typedef struct oC {  typedef struct oC {
         short id;    short id;
         char nid;    char nid;
         char pad;    char pad;
         struct oNum *r,*i;    struct oNum *r,*i;
 } *C;  } *C;
   
 typedef struct oLM {  typedef struct oLM {
         short id;    short id;
         char nid;    char nid;
         char pad;    char pad;
         struct oN *body;    struct oN *body;
 } *LM;  } *LM;
   
 typedef struct oGF2N {  typedef struct oGF2N {
         short id;    short id;
         char nid;    char nid;
         char pad;    char pad;
         struct oUP2 *body;    struct oUP2 *body;
 } *GF2N;  } *GF2N;
   
 typedef struct oGFPN {  typedef struct oGFPN {
         short id;    short id;
         char nid;    char nid;
         char pad;    char pad;
         struct oUP *body;    struct oUP *body;
 } *GFPN;  } *GFPN;
   
 typedef struct oDAlg {  typedef struct oDAlg {
         short id;    short id;
         char nid;    char nid;
         char pad;    char pad;
         struct oDP *nm;    struct oDP *nm;
         struct oQ *dn;    struct oQ *dn;
 } *DAlg;  } *DAlg;
   
   typedef struct oGZ {
     short id;
     char nid;
     char pad;
     mpz_t body;
   } *GZ;
   
   typedef struct oGQ {
     short id;
     char nid;
     char pad;
     mpq_t body;
   } *GQ;
   
 typedef struct oNum {  typedef struct oNum {
         short id;    short id;
         char nid;    char nid;
         char pad;    char pad;
 } *Num;  } *Num;
   
 typedef struct oMQ {  typedef struct oMQ {
         short id;    short id;
         char nid;    char nid;
         char pad;    char pad;
         int cont;    int cont;
 } *MQ;  } *MQ;
   
 typedef struct oGFS {  typedef struct oGFS {
         short id;    short id;
         char nid;    char nid;
         char pad;    char pad;
         int cont;    int cont;
 } *GFS;  } *GFS;
   
 typedef struct oGFSN {  typedef struct oGFSN {
         short id;    short id;
         char nid;    char nid;
         char pad;    char pad;
         struct oUM *body;    struct oUM *body;
 } *GFSN;  } *GFSN;
   
 typedef struct oP {  typedef struct oP {
         short id;    short id;
         short pad;    short pad;
         V v;    V v;
         struct oDCP *dc;    struct oDCP *dc;
 } *P;  } *P;
   
 typedef struct oR {  typedef struct oR {
         short id;    short id;
         short reduced;    short reduced;
         P nm;    P nm;
         P dn;    P dn;
 } *R;  } *R;
   
 typedef struct oVECT {  typedef struct oVECT {
         short id;    short id;
         short pad;    short pad;
         int len;    int len;
         pointer *body;    pointer *body;
 } *VECT;  } *VECT;
   
 typedef struct oMAT {  typedef struct oMAT {
         short id;    short id;
         short pad;    short pad;
         int row,col;    int row,col;
         pointer **body;    pointer **body;
 } *MAT;  } *MAT;
   
 typedef struct oGF2MAT {  typedef struct oGF2MAT {
         short id;    short id;
         short pad;    short pad;
         int row,col;    int row,col;
         unsigned int **body;    unsigned int **body;
 } *GF2MAT, *GFMMAT;  } *GF2MAT, *GFMMAT;
   
 /* IMAT */  /* IMAT */
 #define IMATCH 64  #define IMATCH 64
   
 typedef struct oIENT {  typedef struct oIENT {
         int cr;    int cr;
         int row, col;    int row, col;
         pointer *body;    pointer *body;
 } IENT;  } IENT;
   
 typedef struct oIMATC {  typedef struct oIMATC {
         pointer *fore;    pointer *fore;
         pointer *next;    pointer *next;
         IENT ient[IMATCH];    IENT ient[IMATCH];
 } *IMATC;  } *IMATC;
   
 typedef struct oIMAT {  typedef struct oIMAT {
         short id;    short id;
         int row, col, clen;    int row, col, clen;
         pointer *root;    pointer *root;
         pointer *toor;    pointer *toor;
 } *IMAT;  } *IMAT;
 /* IMAT */  /* IMAT */
 typedef struct oLIST {  typedef struct oLIST {
         short id;    short id;
         short pad;    short pad;
         struct oNODE *body;    struct oNODE *body;
 } *LIST;  } *LIST;
   
 typedef struct oSTRING {  typedef struct oSTRING {
         short id;    short id;
         short pad;    short pad;
         char *body;    char *body;
 } *STRING;  } *STRING;
   
 typedef struct oCOMP {  typedef struct oCOMP {
         short id;    short id;
         short type;    short type;
         struct oObj *member[1];    struct oObj *member[1];
 } *COMP;  } *COMP;
   
 typedef struct oDP {  typedef struct oDP {
         short id;    short id;
         short nv;    short nv;
         int sugar;    int sugar;
         struct oMP *body;    struct oMP *body;
 } *DP;  } *DP;
   
 typedef struct oDPV {  typedef struct oDPV {
         short id;    short id;
         int len;    int len;
         int sugar;    int sugar;
         struct oDP **body;    struct oDP **body;
 } *DPV;  } *DPV;
   
   
 typedef struct oUSINT {  typedef struct oUSINT {
         short id;    short id;
         short pad;    short pad;
         unsigned body;    unsigned body;
 } *USINT;  } *USINT;
   
 typedef struct oERR {  typedef struct oERR {
         short id;    short id;
         short pad;    short pad;
         struct oObj *body;    struct oObj *body;
 } *ERR;  } *ERR;
   
 typedef struct oMATHCAP {  typedef struct oMATHCAP {
         short id;    short id;
         short pad;    short pad;
         struct oLIST *body;    struct oLIST *body;
 } *MATHCAP;  } *MATHCAP;
   
 typedef struct oBYTEARRAY {  typedef struct oBYTEARRAY {
         short id;    short id;
         short pad;    short pad;
         int len;    int len;
         unsigned char *body;    unsigned char *body;
 } *BYTEARRAY;  } *BYTEARRAY;
   
 typedef struct oQUOTE {  typedef struct oQUOTE {
         short id;    short id;
         short pad;    short pad;
         pointer body;    pointer body;
 } *QUOTE;  } *QUOTE;
   
 typedef struct oQUOTEARG {  typedef struct oQUOTEARG {
         short id;    short id;
         short pad;    short pad;
         farg_type type;    farg_type type;
         pointer body;    pointer body;
 } *QUOTEARG;  } *QUOTEARG;
   
 typedef struct oOPTLIST {  typedef struct oOPTLIST {
         short id;    short id;
         short pad;    short pad;
         struct oNODE *body;    struct oNODE *body;
 } *OPTLIST;  } *OPTLIST;
   
 typedef struct oSYMBOL {  typedef struct oSYMBOL {
         short id;    short id;
         short pad;    short pad;
         char *name;    char *name;
         int value;    int value;
 } *SYMBOL;  } *SYMBOL;
   
 typedef struct oRANGE {  typedef struct oRANGE {
         short id;    short id;
         short pad;    short pad;
         struct oObj *start,*end;    struct oObj *start,*end;
 } *RANGE;  } *RANGE;
   
 typedef struct oTB {  typedef struct oTB {
         short id;    short id;
         short pad;    short pad;
         int size,next;    int size,next;
         char **body;    char **body;
 } *TB;  } *TB;
   
 typedef struct oNBP {  typedef struct oNBP {
         short id;    short id;
         short pad;    short pad;
         struct oNODE *body;    struct oNODE *body;
 } *NBP;  } *NBP;
   
 /* non-commutative bivariate monomial */  /* non-commutative bivariate monomial */
   
 typedef struct oNBM {  typedef struct oNBM {
         int d;    int d;
         P c;    P c;
         unsigned int *b;    unsigned int *b;
 } *NBM;  } *NBM;
   
 #define NEWNBM(p) ((p)=(NBM)MALLOC(sizeof(struct oNBM)))  #define NEWNBM(p) ((p)=(NBM)MALLOC(sizeof(struct oNBM)))
Line 469  typedef struct oNBM {
Line 522  typedef struct oNBM {
 #define NBM_CLR(a,j) ((a)[(j)>>5]&=(~(1<<((j)&31))))  #define NBM_CLR(a,j) ((a)[(j)>>5]&=(~(1<<((j)&31))))
   
 typedef struct oObj {  typedef struct oObj {
         short id;    short id;
         short pad;    short pad;
 } *Obj;  } *Obj;
   
 typedef struct oDCP {  typedef struct oDCP {
         Q d;    Q d;
         P c;    P c;
         struct oDCP *next;    struct oDCP *next;
 } *DCP;  } *DCP;
   
 typedef struct oMP {  typedef struct oMP {
         struct oDL *dl;    struct oDL *dl;
         P c;    Obj c;
         struct oMP *next;    struct oMP *next;
 } *MP;  } *MP;
   
   typedef struct oDPM {
     short id;
     short nv;
     int sugar;
     struct oDMM *body;
   } *DPM;
   
   typedef struct oDMM {
     int pos;
     struct oDL *dl;
     Obj c;
     struct oDMM *next;
   } *DMM;
   
 typedef struct oDL {  typedef struct oDL {
         int td;    int td;
         int d[1];    int d[1];
 } *DL;  } *DL;
   
 struct dp_pairs {  struct dp_pairs {
         int dp1, dp2;    int dp1, dp2;
         DL lcm;    DL lcm;
         int sugar;    int sugar;
         struct dp_pairs *next;    struct dp_pairs *next;
 };  };
   
 typedef struct dp_pairs *DP_pairs;  typedef struct dp_pairs *DP_pairs;
   
 struct p_pair {  struct p_pair {
         struct oUM *p0;    struct oUM *p0;
         struct oUM *p1;    struct oUM *p1;
         struct p_pair *next;    struct p_pair *next;
 };  };
   
 struct oMF {  struct oMF {
         int m;    int m;
         P f;    P f;
 };  };
   
 /*  /*
Line 515  struct oMF {
Line 582  struct oMF {
  */   */
   
 typedef struct oCDP {  typedef struct oCDP {
         int len;    int len;
         int psindex;    int psindex;
         unsigned int *body;    unsigned int *body;
 } *CDP;  } *CDP;
   
 typedef struct oCM {  typedef struct oCM {
         int index;    int index;
         int c;    int c;
 } *CM;  } *CM;
   
 /* bucket list for DL */  /* bucket list for DL */
   
 typedef struct oDLBUCKET {  typedef struct oDLBUCKET {
         int td;    int td;
         struct oNODE *body;    struct oNODE *body;
         struct oDLBUCKET *next;    struct oDLBUCKET *next;
 } *DLBUCKET;  } *DLBUCKET;
   
 typedef struct oGeoBucket {  typedef struct oGeoBucket {
         int m;    int m;
         struct oNODE *body[32];    struct oNODE *body[32];
 } *GeoBucket;  } *GeoBucket;
   
 typedef struct oVL {  typedef struct oVL {
         V v;    V v;
         struct oVL *next;    struct oVL *next;
 } *VL;  } *VL;
   
 typedef struct oNODE {  typedef struct oNODE {
         pointer body;    pointer body;
         struct oNODE *next;    struct oNODE *next;
 } *NODE;  } *NODE;
   
 /* univariate poly over small finite field; dense */  /* univariate poly over small finite field; dense */
 typedef struct oUM {  typedef struct oUM {
         int d;    int d;
         int c[1];    int c[1];
 } *UM;  } *UM;
   
 /* univariate poly with padic coeff */  /* univariate poly with padic coeff */
 typedef struct oLUM {  typedef struct oLUM {
         int d;    int d;
         int *c[1];    int *c[1];
 } *LUM;  } *LUM;
   
 /* bivariate poly over small finite field; dense */  /* bivariate poly over small finite field; dense */
   
 typedef struct oBM {  typedef struct oBM {
         int d;    int d;
         UM c[1];    UM c[1];
 } *BM;  } *BM;
   
 typedef struct oML {  typedef struct oML {
         int n;    int n;
         int mod;    int mod;
         int bound;    int bound;
         pointer c[1];    pointer c[1];
 } *ML;  } *ML;
   
 typedef struct oUB {  typedef struct oUB {
         int d;    int d;
         N c[1];    N c[1];
 } *UB;  } *UB;
   
 typedef struct oVN {  typedef struct oVN {
         V v;    V v;
         int n;    int n;
 } *VN;  } *VN;
   
 typedef struct oUP {  typedef struct oUP {
         int d;    int d;
         Num c[1];    Num c[1];
 } *UP;  } *UP;
   
 typedef struct oDUM {  typedef struct oDUM {
         int n;    int n;
         UM f;    UM f;
 } *DUM;  } *DUM;
   
 struct order_pair {  struct order_pair {
         int order, length;    int order, length;
 };  };
   
 struct sparse_weight {  struct sparse_weight {
         int pos, value;    int pos, value;
 };  };
   
 #define IS_DENSE_WEIGHT 0  #define IS_DENSE_WEIGHT 0
Line 607  struct sparse_weight {
Line 674  struct sparse_weight {
 #define IS_BLOCK 2  #define IS_BLOCK 2
   
 struct weight_or_block {  struct weight_or_block {
         int type;    int type;
         int length;    int length;
         union {    union {
                 int *dense_weight;      int *dense_weight;
                 struct sparse_weight *sparse_weight;      struct sparse_weight *sparse_weight;
                 struct {      struct {
                         int order, start;        int order, start;
                 } block;      } block;
         } body;    } body;
 };  };
   
 struct order_spec {  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 ispot; /* 1 means Position over Term (Pos then Term) */
         int pot_nelim; /* size of positions for pot-elimination order */    int pot_nelim; /* size of positions for pot-elimination order */
         union {    int *top_weight;
                 int simple;    int module_rank;
                 struct {    int *module_top_weight;
                         int length;    union {
                         struct order_pair *order_pair;      int simple;
                 } block;      struct {
                 struct {        int length;
                         int row;        struct order_pair *order_pair;
                         int **matrix;      } block;
                 } matrix;      struct {
                 struct {        int row;
                         int length;        int **matrix;
                         struct weight_or_block *w_or_b;      } matrix;
                 } composite;      struct {
         } ord;        int length;
         struct weight_or_block *w_or_b;
       } composite;
     } ord;
 };  };
   
 struct modorder_spec {  struct modorder_spec {
         /* id : ORD_REVGRADLEX, ORD_GRADLEX, ORD_LEX */    /* id : ORD_REVGRADLEX, ORD_GRADLEX, ORD_LEX */
         int id;    int id;
         Obj obj;    Obj obj;
         int len;    int len;
         int *degree_shift;    int *degree_shift;
 };  };
   
 typedef struct oNumberField {  typedef struct oNumberField {
         int n;    int n;
         int psn;    int psn;
         int dim;    int dim;
         VL vl;    VL vl;
         P *defpoly;    P *defpoly;
         DP *mb;    DP *mb;
         DP *ps;    DP *ps;
         struct oDAlg *one;    struct oDAlg *one;
         NODE ind;    NODE ind;
         struct order_spec *spec;    struct order_spec *spec;
 } *NumberField;  } *NumberField;
   
 /* structure for cputime */  /* structure for cputime */
   
 struct oEGT {  struct oEGT {
         double exectime,gctime;    double exectime,gctime;
 };  };
   
 /* constant */  /* constant */
Line 726  typedef unsigned int ModNum;
Line 796  typedef unsigned int ModNum;
   
 /* memory allocators (W_... : uses alloca) */  /* memory allocators (W_... : uses alloca) */
   
 #if 0  
 #define MALLOC(d) Risa_GC_malloc(d)  #define MALLOC(d) Risa_GC_malloc(d)
 #define MALLOC_ATOMIC(d) Risa_GC_malloc_atomic(d)  #define MALLOC_ATOMIC(d) Risa_GC_malloc_atomic(d)
   #define MALLOC_ATOMIC_IGNORE_OFF_PAGE(d) Risa_GC_malloc_atomic_ignore_off_page(d)
 #define REALLOC(p,d) Risa_GC_realloc(p,d)  #define REALLOC(p,d) Risa_GC_realloc(p,d)
 #else  #define GCFREE(p) Risa_GC_free(p)
 #define MALLOC(d) GC_malloc(d)  
 #define MALLOC_ATOMIC(d) GC_malloc_atomic(d)  
 #define REALLOC(p,d) GC_realloc(p,d)  
 #endif  
 #define CALLOC(d,e) MALLOC((d)*(e))  #define CALLOC(d,e) MALLOC((d)*(e))
   
 #if !defined(__CYGWIN__) && (defined(__GNUC__) || defined(vax) || defined(apollo) || defined(alloca) || defined(VISUAL))  #if 0
   #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)  #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 770  bzero((char *)(p),(int)(((n)+1)*sizeof(type))))
Line 849  bzero((char *)(p),(int)(((n)+1)*sizeof(type))))
 #define W_MLALLOC(d) ((ML)ALLOCA(TRUESIZE(oML,d,pointer)))  #define W_MLALLOC(d) ((ML)ALLOCA(TRUESIZE(oML,d,pointer)))
 #define W_LUMALLOC(n,bound,p)\  #define W_LUMALLOC(n,bound,p)\
 {\  {\
         LUM ___q___;\    LUM ___q___;\
         int ___i___,**___c___;\    int ___i___,**___c___;\
         (___q___) = (LUM)ALLOCA(TRUESIZE(oLUM,(n),int *));\    (___q___) = (LUM)ALLOCA(TRUESIZE(oLUM,(n),int *));\
         DEG(___q___) = n;\    DEG(___q___) = n;\
         for ( ___i___ = 0, ___c___ = (int **)COEF(___q___); ___i___ <= n; ___i___++ ) {\    for ( ___i___ = 0, ___c___ = (int **)COEF(___q___); ___i___ <= n; ___i___++ ) {\
                 ___c___[___i___] = (int *)ALLOCA(((bound)+1)*sizeof(int));\      ___c___[___i___] = (int *)ALLOCA(((bound)+1)*sizeof(int));\
                 bzero((char *)___c___[___i___],((bound)+1)*sizeof(int));\      bzero((char *)___c___[___i___],((bound)+1)*sizeof(int));\
         }\    }\
         (p) = ___q___;\    (p) = ___q___;\
 }  }
   
 #define W_BMALLOC(dx,dy,p)\  #define W_BMALLOC(dx,dy,p)\
 {\  {\
         BM ___q___;\    BM ___q___;\
         int ___i___;\    int ___i___;\
         UM *___c___;\    UM *___c___;\
         (___q___) = (BM)ALLOCA(TRUESIZE(oBM,(dy),UM));\    (___q___) = (BM)ALLOCA(TRUESIZE(oBM,(dy),UM));\
         DEG(___q___) = dy;\    DEG(___q___) = dy;\
         ___c___ = (UM *)COEF(___q___);\    ___c___ = (UM *)COEF(___q___);\
         for ( ___i___ = 0; ___i___ <= dy; ___i___++ ) {\    for ( ___i___ = 0; ___i___ <= dy; ___i___++ ) {\
                 ___c___[___i___] = W_UMALLOC(dx);\      ___c___[___i___] = W_UMALLOC(dx);\
                 clearum(___c___[___i___],dx);\      clearum(___c___[___i___],dx);\
         }\    }\
         (p) = ___q___;\    (p) = ___q___;\
 }  }
   
 #define NEWUP2(q,w)\  #define NEWUP2(q,w)\
Line 806  bzero((char *)(q)->b,(w)*sizeof(unsigned int)))
Line 885  bzero((char *)(q)->b,(w)*sizeof(unsigned int)))
 ((q).b=(unsigned int *)ALLOCA((w)*sizeof(unsigned int)))  ((q).b=(unsigned int *)ALLOCA((w)*sizeof(unsigned int)))
   
 /* cell allocators */  /* cell allocators */
   #define NEWGZ(q) ((q)=(GZ)MALLOC(sizeof(struct oGZ)),OID(q)=O_N,NID(q)=N_GZ)
   #define NEWGQ(q) ((q)=(GQ)MALLOC(sizeof(struct oGQ)),OID(q)=O_N,NID(q)=N_GQ)
 #define NEWQ(q) ((q)=(Q)MALLOC(sizeof(struct oQ)),OID(q)=O_N,NID(q)=N_Q)  #define NEWQ(q) ((q)=(Q)MALLOC(sizeof(struct oQ)),OID(q)=O_N,NID(q)=N_Q)
 #define NEWMQ(q) ((q)=(MQ)MALLOC_ATOMIC(sizeof(struct oMQ)),OID(q)=O_N,NID(q)=N_M)  #define NEWMQ(q) ((q)=(MQ)MALLOC_ATOMIC(sizeof(struct oMQ)),OID(q)=O_N,NID(q)=N_M)
 #define NEWGFS(q) ((q)=(GFS)MALLOC_ATOMIC(sizeof(struct oGFS)),OID(q)=O_N,NID(q)=N_GFS)  #define NEWGFS(q) ((q)=(GFS)MALLOC_ATOMIC(sizeof(struct oGFS)),OID(q)=O_N,NID(q)=N_GFS)
Line 818  bzero((char *)(q)->b,(w)*sizeof(unsigned int)))
Line 899  bzero((char *)(q)->b,(w)*sizeof(unsigned int)))
 #define NEWCOMP(c,n) ((c)=(COMP)MALLOC(sizeof(struct oCOMP)+((n)-1)*sizeof(Obj)),OID(c)=O_COMP)  #define NEWCOMP(c,n) ((c)=(COMP)MALLOC(sizeof(struct oCOMP)+((n)-1)*sizeof(Obj)),OID(c)=O_COMP)
 #define NEWDP(d) ((d)=(DP)MALLOC(sizeof(struct oDP)),OID(d)=O_DP)  #define NEWDP(d) ((d)=(DP)MALLOC(sizeof(struct oDP)),OID(d)=O_DP)
 #define NEWDPV(d) ((d)=(DPV)MALLOC(sizeof(struct oDPV)),OID(d)=O_DPV)  #define NEWDPV(d) ((d)=(DPV)MALLOC(sizeof(struct oDPV)),OID(d)=O_DPV)
   #define NEWDPM(d) ((d)=(DPM)MALLOC(sizeof(struct oDPM)),OID(d)=O_DPM)
 #define NEWUSINT(u) ((u)=(USINT)MALLOC_ATOMIC(sizeof(struct oUSINT)),OID(u)=O_USINT)  #define NEWUSINT(u) ((u)=(USINT)MALLOC_ATOMIC(sizeof(struct oUSINT)),OID(u)=O_USINT)
 #define NEWERR(e) ((e)=(ERR)MALLOC(sizeof(struct oERR)),OID(e)=O_ERR)  #define NEWERR(e) ((e)=(ERR)MALLOC(sizeof(struct oERR)),OID(e)=O_ERR)
 #define NEWMATHCAP(e) ((e)=(MATHCAP)MALLOC(sizeof(struct oMATHCAP)),OID(e)=O_MATHCAP)  #define NEWMATHCAP(e) ((e)=(MATHCAP)MALLOC(sizeof(struct oMATHCAP)),OID(e)=O_MATHCAP)
Line 834  bzero((char *)(q)->b,(w)*sizeof(unsigned int)))
Line 916  bzero((char *)(q)->b,(w)*sizeof(unsigned int)))
 #define NEWV(v) ((v)=(V)MALLOC(sizeof(struct oV)))  #define NEWV(v) ((v)=(V)MALLOC(sizeof(struct oV)))
 #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 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 847  bzero((char *)(q)->b,(w)*sizeof(unsigned int)))
Line 930  bzero((char *)(q)->b,(w)*sizeof(unsigned int)))
 #define NEWReal(q) ((q)=(Real)MALLOC_ATOMIC(sizeof(struct oReal)),OID(q)=O_N,NID(q)=N_R)  #define NEWReal(q) ((q)=(Real)MALLOC_ATOMIC(sizeof(struct oReal)),OID(q)=O_N,NID(q)=N_R)
 #define NEWAlg(r) ((r)=(Alg)MALLOC(sizeof(struct oAlg)),OID(r)=O_N,NID(r)=N_A)  #define NEWAlg(r) ((r)=(Alg)MALLOC(sizeof(struct oAlg)),OID(r)=O_N,NID(r)=N_A)
 #define NEWDAlg(r) ((r)=(DAlg)MALLOC(sizeof(struct oDAlg)),OID(r)=O_N,NID(r)=N_DA)  #define NEWDAlg(r) ((r)=(DAlg)MALLOC(sizeof(struct oDAlg)),OID(r)=O_N,NID(r)=N_DA)
 #define NEWBF(q,l) ((q)=(BF)MALLOC_ATOMIC(TRUESIZE(oBF,(l)-1,long)),OID(q)=O_N,NID(q)=N_B)  #define NEWBF(q) ((q)=(BF)MALLOC(sizeof(struct oBF)),OID(q)=O_N,NID(q)=N_B)
   #define NEWPARIBF(q,l) ((q)=(BF)MALLOC_ATOMIC(TRUESIZE(oBF,(l)-1,long)),OID(q)=O_N,NID(q)=N_PARIB)
 #define NEWC(r) ((r)=(C)MALLOC(sizeof(struct oC)),OID(r)=O_N,NID(r)=N_C)  #define NEWC(r) ((r)=(C)MALLOC(sizeof(struct oC)),OID(r)=O_N,NID(r)=N_C)
 #define NEWLM(r) ((r)=(LM)MALLOC(sizeof(struct oLM)),OID(r)=O_N,NID(r)=N_LM)  #define NEWLM(r) ((r)=(LM)MALLOC(sizeof(struct oLM)),OID(r)=O_N,NID(r)=N_LM)
 #define NEWGF2N(r) ((r)=(GF2N)MALLOC(sizeof(struct oGF2N)),OID(r)=O_N,NID(r)=N_GF2N)  #define NEWGF2N(r) ((r)=(GF2N)MALLOC(sizeof(struct oGF2N)),OID(r)=O_N,NID(r)=N_GF2N)
Line 879  DEG(DC(p))=ONE,COEF(DC(p))=(P)ONEM,NEXT(DC(p))=0)
Line 963  DEG(DC(p))=ONE,COEF(DC(p))=(P)ONEM,NEXT(DC(p))=0)
 #define MKSTR(a,b) (NEWSTR(a),(a)->body=(char *)(b))  #define MKSTR(a,b) (NEWSTR(a),(a)->body=(char *)(b))
 #define MKDP(n,m,d) (NEWDP(d),(d)->nv=(n),BDY(d)=(m))  #define MKDP(n,m,d) (NEWDP(d),(d)->nv=(n),BDY(d)=(m))
 #define MKDPV(len,m,d) (NEWDPV(d),(d)->len=(len),BDY(d)=(m))  #define MKDPV(len,m,d) (NEWDPV(d),(d)->len=(len),BDY(d)=(m))
   #define MKDPM(n,m,d) (NEWDPM(d),(d)->nv=(n),BDY(d)=(m))
 #define MKLM(b,l) (!(b)?(l)=0:(NEWLM(l),(l)->body=(b),(l)))  #define MKLM(b,l) (!(b)?(l)=0:(NEWLM(l),(l)->body=(b),(l)))
 #define MKGF2N(b,l) (!(b)?(l)=0:(NEWGF2N(l),(l)->body=(b),(l)))  #define MKGF2N(b,l) (!(b)?(l)=0:(NEWGF2N(l),(l)->body=(b),(l)))
 #define MKGFPN(b,l) (!(b)?(l)=0:(NEWGFPN(l),(l)->body=(b),(l)))  #define MKGFPN(b,l) (!(b)?(l)=0:(NEWGFPN(l),(l)->body=(b),(l)))
Line 904  if(!(r)){NEWDLBUCKET(r);(c)=(r);}else{NEWDLBUCKET(NEXT
Line 989  if(!(r)){NEWDLBUCKET(r);(c)=(r);}else{NEWDLBUCKET(NEXT
 if(!(r)){NEWVL(r);(c)=(r);}else{NEWVL(NEXT(c));(c)=NEXT(c);}  if(!(r)){NEWVL(r);(c)=(r);}else{NEWVL(NEXT(c));(c)=NEXT(c);}
 #define NEXTDPP(r,c) \  #define NEXTDPP(r,c) \
 if(!(r)){NEWDPP(r);(c)=(r);}else{NEWDPP(NEXT(c));(c)=NEXT(c);}  if(!(r)){NEWDPP(r);(c)=(r);}else{NEWDPP(NEXT(c));(c)=NEXT(c);}
   #define NEXTDMM(r,c) \
   if(!(r)){NEWDMM(r);(c)=(r);}else{NEWDMM(NEXT(c));(c)=NEXT(c);}
   
 /* convertors */  /* convertors */
 #define NTOQ(n,s,q) \  #define NTOQ(n,s,q) \
Line 947  PL(NM(q))=1,BD(NM(q))[0]=(unsigned int)(n),DN(q)=0,(q)
Line 1034  PL(NM(q))=1,BD(NM(q))[0]=(unsigned int)(n),DN(q)=0,(q)
 #define SL(n) ((n)->p)  #define SL(n) ((n)->p)
 #define ZALLOC(d) ((Z)MALLOC_ATOMIC(TRUESIZE(oZ,(d)-1,int)))  #define ZALLOC(d) ((Z)MALLOC_ATOMIC(TRUESIZE(oZ,(d)-1,int)))
   
 #if defined(PARI)  #define ToReal(a) (!(a)?(double)0.0:REAL(a)?BDY((Real)a):RATN(a)?RatnToReal((Q)a):BIGFLOAT(a)?mpfrtodbl(BDY((BF)a)):0)
 #define ToReal(a) (!(a)?(double)0.0:REAL(a)?BDY((Real)a):RATN(a)?RatnToReal((Q)a):BIGFLOAT(a)?rtodbl(BDY((BF)a)):0)  
 #else  
 #define ToReal(a) (!(a)?(double)0.0:REAL(a)?BDY((Real)a):RATN(a)?RatnToReal((Q)a):0.0)  
 #endif  
   
 /* predicates */  /* predicates */
 #define NUM(p) (OID(p)==O_N)  #define NUM(p) (OID(p)==O_N)
Line 966  PL(NM(q))=1,BD(NM(q))[0]=(unsigned int)(n),DN(q)=0,(q)
Line 1049  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 987  PL(NM(q))=1,BD(NM(q))[0]=(unsigned int)(n),DN(q)=0,(q)
Line 1071  PL(NM(q))=1,BD(NM(q))[0]=(unsigned int)(n),DN(q)=0,(q)
 #define FTOIF(i) ((int)(((unsigned int)(i)|0x80000000)))  #define FTOIF(i) ((int)(((unsigned int)(i)|0x80000000)))
   
 struct cdl {  struct cdl {
         P c;    Obj c;
         DL d;    DL d;
 };  };
   
 struct cdlm {  struct cdlm {
         int c;    int c;
         DL d;    DL d;
 };  };
   
 extern MP _mp_free_list;  extern MP _mp_free_list;
Line 1033  extern struct oV oVAR[];
Line 1117  extern struct oV oVAR[];
 extern struct oV oPVAR[];  extern struct oV oPVAR[];
 extern struct oVL oVLIST[];  extern struct oVL oVLIST[];
 extern struct oVL oPVLIST[];  extern struct oVL oPVLIST[];
 extern VL CO,ALG;  extern VL CO,ALG,LASTCO;
 extern VL PVL;  extern VL PVL;
 extern R ONER;  extern R ONER;
 extern Q ONE;  extern Q ONE;
Line 1095  void hybrid_mulup(int,UP,UP,UP *);
Line 1179  void hybrid_mulup(int,UP,UP,UP *);
   
 void getmod_lm(N *);  void getmod_lm(N *);
   
 int maxblenup(UP);  
 void monicup(UP,UP *);  
 void simpup(UP,UP *);  
 void simpnum(Num,Num *);  
 void decompp(P,Q,P *,P *);  
 void truncp(P,Q,P *);  
 void uremp(P,P,P *);  
 void ugcdp(P,P,P *);  
 void reversep(P,Q,P *);  
 void invmodp(P,Q,P *);  
 void addup(UP,UP,UP *);  
 void subup(UP,UP,UP *);  
 void chsgnup(UP,UP *);  
 void mulup(UP,UP,UP *);  
 void tmulup(UP,UP,int,UP *);  
 void squareup(UP,UP *);  
 void remup(UP,UP,UP *);  
 void remup_destructive(UP,UP);  
 void qrup(UP,UP,UP *,UP *);  
 void qrup_destructive(UP,UP);  
 void gcdup(UP,UP,UP *);  
 void reverseup(UP,int,UP *);  
 void invmodup(UP,int,UP *);  
 void pwrup(UP,Q,UP *);  
 void squarep_gf2n(VL,P,P *);  
 void kmulp(VL,P,P,P *);  
 void ksquarep(VL,P,P *);  
 void kmulup(UP,UP,UP *);  
 void ksquareup(UP,UP *);  
 void extractup(UP,int,int,UP *);  
 void copyup(UP,UP);  
 void c_copyup(UP,int,pointer *);  
 void kmulupmain(UP,UP,UP *);  
 void ksquareupmain(UP,UP *);  
 void rembymulup(UP,UP,UP *);  
 void rembymulup_special(UP,UP,UP,UP *);  
 void tkmulup(UP,UP,int,UP *);  
 void shiftup(UP,int,UP *);  
 void set_degreeup(UP,int);  
 void decompup(UP,int,UP *,UP *);  
 void truncup(UP,int,UP *);  
 void uptofmarray(int,UP,ModNum *);  
 void fmarraytoup(ModNum *,int,UP *);  
 void uiarraytoup(unsigned int **,int,int,UP *);  
 void adj_coefup(UP,N,N,UP *);  
 void uptolmup(UP,UP *);  
 void remcup(UP,N,UP *);  
 void fft_mulup(UP,UP,UP *);  
 void fft_squareup(UP,UP *);  
 void trunc_fft_mulup(UP,UP,int,UP *);  
 void shoup_fft_mulup(UP,UP,UP *);  
 void shoup_fft_squareup(UP,UP *);  
 void shoup_trunc_fft_mulup(UP,UP,int,UP *);  
 void crup(ModNum **,int,int *,int,N,UP *);  
 void shoup_crup(ModNum **,int,int *,int,N,N,UP *);  
 void squareup_gf2n(UP,UP *);  
 void powermodup_gf2n(UP,UP *);  
 void generic_powermodup_gf2n(UP,UP,Q,UP *);  
 void tracemodup_gf2n(UP,UP,Q,UP *);  
 void tracemodup_gf2n_slow(UP,UP,Q,UP *);  
 void tracemodup_gf2n_tab(UP,UP,Q,UP *);  
 void square_rem_tab_up_gf2n(UP,UP *,UP *);  
 void powertabup_gf2n(UP,UP,UP *);  
 void find_root_gf2n(UP,GF2N *);  
   
 int cmpdl_composite(int,DL,DL);  int cmpdl_composite(int,DL,DL);
 int cmpdl_matrix(int,DL,DL);  int cmpdl_matrix(int,DL,DL);
 int cmpdl_order_pair(int,DL,DL);  int cmpdl_order_pair(int,DL,DL);
Line 1174  int cmpdl_revgradlex(int,DL,DL);
Line 1193  int cmpdl_revgradlex(int,DL,DL);
 int cmpdl_gradlex(int,DL,DL);  int cmpdl_gradlex(int,DL,DL);
 int cmpdl_revlex(int,DL,DL);  int cmpdl_revlex(int,DL,DL);
 int cmpdl_lex(int,DL,DL);  int cmpdl_lex(int,DL,DL);
 int compd(VL,DP,DP);  
 void adddl(int,DL,DL,DL *);  
 void divsdc(VL,DP,P,DP *);  
 void muldc(VL,DP,P,DP *);  
 void muldm(VL,DP,MP,DP *);  
 void muld(VL,DP,DP,DP *);  
 void chsgnd(DP,DP *);  
 void subd(VL,DP,DP,DP *);  
 void addd(VL,DP,DP,DP *);  
 int sugard(MP);  
 void nodetod(NODE,DP *);  
 void dtop(VL,VL,DP,P *);  
 void ptod(VL,VL,P,DP *);  
 void initd(struct order_spec *);  
   
 void adddv(VL,DPV,DPV,DPV *);  void adddv(VL,DPV,DPV,DPV *);
 void subdv(VL,DPV,DPV,DPV *);  void subdv(VL,DPV,DPV,DPV *);
Line 1195  void muldv(VL,DP,DPV,DPV *);
Line 1200  void muldv(VL,DP,DPV,DPV *);
 void chsgndv(DPV,DPV *);  void chsgndv(DPV,DPV *);
 int compdv(VL,DPV,DPV);  int compdv(VL,DPV,DPV);
   
   void adddpm(VL,DPM,DPM,DPM *);
   void subdpm(VL,DPM,DPM,DPM *);
   void mulobjdpm(VL,Obj,DPM,DPM *);
   void chsgndpm(DPM,DPM *);
   int compdpm(VL,DPM,DPM);
   
 void _printdp(DP);  void _printdp(DP);
 void _dp_sp_mod(DP,DP,int,DP *);  void _dp_sp_mod(DP,DP,int,DP *);
 void _dp_mod(DP,int,NODE,DP *);  void _dp_mod(DP,int,NODE,DP *);
Line 1223  void rtime_init(void);
Line 1234  void rtime_init(void);
 void setmod_gf2n(P);  void setmod_gf2n(P);
 void mt_sgenrand(unsigned long);  void mt_sgenrand(unsigned long);
 unsigned long mt_genrand(void);  unsigned long mt_genrand(void);
 #if defined(VISUAL)  #if defined(VISUAL) || defined(__MINGW32__)
 void srandom(unsigned int);  void srandom(unsigned int);
 unsigned int random(void);  unsigned int random(void);
 #endif  #endif
Line 1235  void gcdEuclidn(N,N,N *);
Line 1246  void gcdEuclidn(N,N,N *);
 void GC_free(void *);  void GC_free(void *);
 void FFT_primes(int,int *,int *,int *);  void FFT_primes(int,int *,int *,int *);
 int FFT_pol_product(unsigned int,unsigned int *, unsigned int,unsigned int *,  int FFT_pol_product(unsigned int,unsigned int *, unsigned int,unsigned int *,
         unsigned int *,int,unsigned int *);    unsigned int *,int,unsigned int *);
 int FFT_pol_square(unsigned int,unsigned int *,  int FFT_pol_square(unsigned int,unsigned int *,
         unsigned int *,int,unsigned int *);    unsigned int *,int,unsigned int *);
 void dcptolist(DCP,LIST *);  void dcptolist(DCP,LIST *);
 void gcdprsmp(VL,int,P,P,P *);  void gcdprsmp(VL,int,P,P,P *);
 void mult_mod_tab(UM,int,UM *,UM,int);  void mult_mod_tab(UM,int,UM *,UM,int);
Line 1430  void Risa_GC_get_adj(int *,int *);
Line 1441  void Risa_GC_get_adj(int *,int *);
 void *Risa_GC_malloc(size_t);  void *Risa_GC_malloc(size_t);
 void *Risa_GC_malloc_atomic(size_t);  void *Risa_GC_malloc_atomic(size_t);
 void *Risa_GC_realloc(void *,size_t);  void *Risa_GC_realloc(void *,size_t);
   void Risa_GC_free(void *);
   void *Risa_GC_malloc_atomic_ignore_off_page(size_t);
 void *GC_malloc(size_t);  void *GC_malloc(size_t);
 void *GC_malloc_atomic(size_t);  void *GC_malloc_atomic(size_t);
 void *GC_realloc(void *,size_t);  void *GC_realloc(void *,size_t);
Line 1437  double NatToReal(N,int *);
Line 1450  double NatToReal(N,int *);
 double RatnToReal(Q);  double RatnToReal(Q);
 double pwrreal0(double,int);  double pwrreal0(double,int);
 double rtodbl(); /* XXX */  double rtodbl(); /* XXX */
   double mpfrtodbl(mpfr_t a);
 int **almat(int,int);  int **almat(int,int);
 pointer **almat_pointer(int,int);  pointer **almat_pointer(int,int);
 int berlecnt(register int,UM);  int berlecnt(register int,UM);
Line 1776  void pwrreal(Num,Num,Real *);
Line 1790  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 2089  void sfbsqfr(P f,V x,V y,DCP *dcp);
Line 2103  void sfbsqfr(P f,V x,V y,DCP *dcp);
 void sfbfctr(P f,V x,V y,int degbound,DCP *dcp);  void sfbfctr(P f,V x,V y,int degbound,DCP *dcp);
 void sfdtest(P f,ML list,V x,V y,DCP *dcp);  void sfdtest(P f,ML list,V x,V y,DCP *dcp);
 int sfdtestmain(VL vl,P lcg,UM lcg0,BM lcy,P csum,ML list,  int sfdtestmain(VL vl,P lcg,UM lcg0,BM lcy,P csum,ML list,
         int k,int *in,P *fp,P *cofp);    int k,int *in,P *fp,P *cofp);
 void const_term(P f,UM c);  void const_term(P f,UM c);
 void const_term_sfbm(BM f,UM c);  void const_term_sfbm(BM f,UM c);
 int sfctest(UM lcg0,BM lcy,ML list,int k,int *in);  int sfctest(UM lcg0,BM lcy,ML list,int k,int *in);
Line 2134  int has_fcoef(DP f);
Line 2148  int has_fcoef(DP f);
 int has_fcoef_p(P f);  int has_fcoef_p(P f);
 void initd(struct order_spec *spec);  void initd(struct order_spec *spec);
 void ptod(VL vl,VL dvl,P p,DP *pr);  void ptod(VL vl,VL dvl,P p,DP *pr);
 void dtop(VL vl,VL dvl,DP p,P *pr);  void dtop(VL vl,VL dvl,DP p,Obj *pr);
 void nodetod(NODE node,DP *dp);  void nodetod(NODE node,DP *dp);
 int sugard(MP m);  int sugard(MP m);
 void addd(VL vl,DP p1,DP p2,DP *pr);  void addd(VL vl,DP p1,DP p2,DP *pr);
Line 2150  void weyl_muld(VL vl,DP p1,DP p2,DP *pr);
Line 2164  void weyl_muld(VL vl,DP p1,DP p2,DP *pr);
 void weyl_muldm(VL vl,MP m0,DP p,DP *pr);  void weyl_muldm(VL vl,MP m0,DP p,DP *pr);
 void weyl_mulmm(VL vl,MP m0,MP m1,int n,struct cdl *rtab,int rtablen);  void weyl_mulmm(VL vl,MP m0,MP m1,int n,struct cdl *rtab,int rtablen);
 void comm_muld_tab(VL vl,int nv,struct cdl *t,int n,struct cdl *t1,int n1,struct cdl *rt);  void comm_muld_tab(VL vl,int nv,struct cdl *t,int n,struct cdl *t1,int n1,struct cdl *rt);
 void muldc(VL vl,DP p,P c,DP *pr);  void muldc(VL vl,DP p,Obj c,DP *pr);
 void divsdc(VL vl,DP p,P c,DP *pr);  void divsdc(VL vl,DP p,P c,DP *pr);
   void divdc(VL vl,DP p,Obj c,DP *pr);
 void adddl(int n,DL d1,DL d2,DL *dr);  void adddl(int n,DL d1,DL d2,DL *dr);
 void adddl_destructive(int n,DL d1,DL d2);  void adddl_destructive(int n,DL d1,DL d2);
 int compd(VL vl,DP p1,DP p2);  int compd(VL vl,DP p1,DP p2);
Line 2631  void mkwcz(int k,int l,Z *t);
Line 2646  void mkwcz(int k,int l,Z *t);
 int remzi(Z n,int m);  int remzi(Z n,int m);
   
   
 #if 0 && !defined(VISUAL)  #if 0 && !defined(VISUAL) && !defined(__MINGW32__)
 void bzero(const void *,int);  void bzero(const void *,int);
 void bcopy(const void *,void *,int);  void bcopy(const void *,void *,int);
 char *index(char *,int);  char *index(char *,int);
Line 2643  void addnbp(VL vl,NBP p1,NBP p2, NBP *rp);
Line 2658  void addnbp(VL vl,NBP p1,NBP p2, NBP *rp);
 void mulnbp(VL vl,NBP p1,NBP p2, NBP *rp);  void mulnbp(VL vl,NBP p1,NBP p2, NBP *rp);
 void pwrnbp(VL vl,NBP p1,Q n, NBP *rp);  void pwrnbp(VL vl,NBP p1,Q n, NBP *rp);
 int compnbp(VL vl,NBP p1,NBP p2);  int compnbp(VL vl,NBP p1,NBP p2);
   
   #define WORDSIZE_IN_N(a) (ABS((a)->_mp_size)*GMP_LIMB_BITS/32)
   
   #define MPZTOGZ(g,q) \
   (!mpz_sgn(g)?((q)=0):(NEWGZ(q),BDY(q)[0]=(g)[0],(q)))
   #define MPQTOGQ(g,q) \
   (!mpq_sgn(g)?((q)=0):(NEWGQ(q),BDY(q)[0]=(g)[0],(q)))
   
   #define INTMPQ(a) (!mpz_cmp_ui(mpq_numref(a),1))
   
   #define UNIGZ(a) ((a)&&NID(a)==N_GZ&&!mpz_cmp_ui(BDY(a),1))
   #define MUNIGZ(a) ((a)&&NID(a)==N_GZ&&!mpz_cmp_si(BDY(a),-1))
   
   #define INTGQ(a) ((a)&&NID(a)==N_GQ&&!mpz_cmp_ui(mpq_denref(BDY(a)),1))
   
   #define UNIGQ(a) \
   ((a)&&NID(a)==N_GQ&&!mpz_cmp_ui(mpq_numref(BDY(a)),1)&&!mpz_cmp_ui(mpq_denref(BDY(a)),1))
   #define MUNIGQ(a) \
   ((a)&&NID(a)==N_GQ&&!mpz_cmp_si(mpq_numref(BDY(a)),-1)&&!mpz_cmp_ui(mpq_denref(BDY(a)),1))
   
   #define MPZTOMPQ(z,q) \
   (mpq_init(q),mpq_numref(q)[0] = (z)[0],mpz_set_ui(mpq_denref(q),1))
   
   #define MPFRTOBF(g,q) \
   (NEWBF(q),BDY(q)[0]=(g)[0],(q))
   
   extern mpz_t ONEMPZ;
   extern GZ ONEGZ;
   
   void *gc_realloc(void *p,size_t osize,size_t nsize);
   void gc_free(void *p,size_t size);
   void init_gmpq();
   GQ mpqtogzq(mpq_t a);
   GQ qtogq(Q a);
   Q gqtoq(GQ a);
   GZ ztogz(Q a);
   Q gztoz(GZ a);
   P ptogp(P a);
   P gptop(P a);
   void addgz(GZ n1,GZ n2,GZ *nr);
   void subgz(GZ n1,GZ n2,GZ *nr);
   void mulgz(GZ n1,GZ n2,GZ *nr);
   void mul1gz(GZ n1,int n2,GZ *nr);
   void divgz(GZ n1,GZ n2,GZ *nq);
   void chsgngz(GZ n,GZ *nr);
   void pwrgz(GZ n1,Q n,GZ *nr);
   int cmpgz(GZ q1,GZ q2);
   void gcdgz(GZ n1,GZ n2,GZ *nq);
   void gcdvgz(VECT v,GZ *q);
   void addgq(GQ n1,GQ n2,GQ *nr);
   void subgq(GQ n1,GQ n2,GQ *nr);
   void mulgq(GQ n1,GQ n2,GQ *nr);
   void divgq(GQ n1,GQ n2,GQ *nq);
   void chsgngq(GQ n,GQ *nr);
   void pwrgq(GQ n1,Q n,GQ *nr);
   int cmpgq(GQ n1,GQ n2);
   void mkgwc(int k,int l,GZ *t);
   void gz_ptozp(P p,int sgn,GQ *c,P *pr);
   void gz_lgp(P p,GZ *g,GZ *l);
   void gz_qltozl(GQ *w,int n,GZ *dvr);
   
   void _mdtodp(DP p,DP *pr);
   void add_denomlist(P f);
   void algobjtorat(Obj f,Obj *r);
   void algtodalg(Alg a,DAlg *r);
   void appenduflist(NODE n);
   void arf_add(VL,Obj,Obj,Obj *);
   void arf_chsgn(Obj,Obj *);
   void arf_div(VL,Obj,Obj,Obj *);
   void arf_mul(VL,Obj,Obj,Obj *);
   void arf_sub(VL,Obj,Obj,Obj *);
   void asir_terminate(int);
   void check_intr();
   void clctalg(P,VL *);
   void comm_muld_trunc(VL vl,DP p1,DP p2,DL dl,DP *pr);
   void comm_quod(VL vl,DP p1,DP p2,DP *pr);
   void create_modorder_spec(int id,LIST shift,struct modorder_spec **s);
   void dalgtoalg(DAlg da,Alg *r);
   void divsgz(GZ n1,GZ n2,GZ *nq);
   void dp_ht(DP p,DP *rp);
   void dp_interreduce(LIST f,LIST v,int field,struct order_spec *ord,LIST *rp);
   void dp_mbase(NODE,NODE *);
   void dp_nf_tab_f(DP p,LIST *tab,DP *rp);
   void dp_ptozp(DP,DP *);
   void dp_sort(DP p,DP *rp);
   void dp_subd(DP,DP,DP *);
   void dp_true_nf(NODE,DP,DP *,int,DP *,P *);
   void dp_true_nf_marked(NODE b,DP g,DP *ps,DP *hps,DP *rp,P *nmp,P *dnp);
   void dp_true_nf_marked_mod(NODE b,DP g,DP *ps,DP *hps,int mod,DP *rp,P *dnp);
   void gbcheck_list(NODE f,int n,VECT *gp,LIST *pp);
   void gcdsf(VL vl,P *pa,int k,P *r);
   void get_algtree(Obj f,VL *r);
   void get_vars(Obj,VL *);
   void gfstopgfs(GFS a,V v,P *c);
   void henmain_incremental(LUM f,LUM *bqlist,ML cqlist, int np, int mod, int start, int bound);
   void iftogfs(int n,GFS *c);
   void indextogfs(int index,GFS *c);
   void init_denomlist();
   void inva_chrem(P p0,P p,NODE *pr);
   void itogfs(int n,GFS *c);
   void lcmn(N n1,N n2,N *nr);
   void makevar(char *,P *);
   void mdtodp(DP p,DP *pr);
   void mfctrsf(VL vl,P f,DCP *dcp);
   void mulp_trunc(VL vl,P p1,P p2,VN vn,P *pr);
   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_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);
   void ox_bcast_102(int root);
   void ox_reduce_102(int root,void (*func)());
   void print_to_wfep(Obj obj);
   void printn(N);
   void printz(Z n);
   void pthrootgfs(GFS a,GFS *b);
   void quop_trunc(VL vl,P p1,P p2,VN vn,P *pr);
   void red_by_vect_sf(int m,unsigned int *p,unsigned int *r,unsigned int hc,int len);
   void removecont_array(P *c,int n,int full);
   void reset_top_weight();
   void setfield_dalg(NODE alist);
   void setfield_gb(NODE gb,VL vl,struct order_spec *spec);
   void setsecuremode(int value);
   void sfbfctr_shift(P f,V x,V y,int degbound,GFS *evp,P *sfp,DCP *dcp);
   void sfexgcd_by_hensel(BM g,BM h,int dy,BM *ap,BM *bp);
   void sfptopsfp(P f,V v,P *gp);
   void simpdalg(DAlg da,DAlg *r);
   void simple_derivr(VL vl,Obj a,V v,Obj *b);
   void substpp(VL vl,P p,V *vvect,P *svect,int nv,P *pr);
   void ufctrsf(P p,DCP *dcp);
   void vltopl(VL vl,LIST *l);
   
   int arf_comp(VL, Obj, Obj);
   int available_mcindex(int ind);
   int compare_zero(int n,int *u,int row,int **w);
   int create_composite_order_spec(VL vl,LIST order,struct order_spec **specp);
   int create_order_spec(VL,Obj,struct order_spec **);
   int dalgtoup(DAlg da,P *up,Q *dn);
   int dl_equal(int nv,DL dl1,DL dl2);
   int dp_redble(DP,DP);
   int dpv_hp(DPV p);
   int generic_gauss_elim_hensel(MAT mat,MAT *nmmat,Q *dn,int **rindp,int **cindp);
   int generic_gauss_elim_hensel_dalg(MAT mat,DP *mb,MAT *nmmat,Q *dn,int **rindp,int **cindp);
   int generic_gauss_elim_mod(int **mat0,int row,int col,int md,int *colstat);
   int generic_gauss_elim_mod2(int **mat0,int row,int col,int md,int *colstat,int *rowstat);
   int get_field_type(P p);
   int get_ox_server_id(int index);
   int getsecuremode();
   int gz_generic_gauss_elim(MAT mat,MAT *nm,GZ *dn,int **rindp,int **cindp);
   int gz_generic_gauss_elim_full(MAT mat,MAT *nm,GZ *dn,int **rindp,int **cindp);
   int gz_gensolve_check(MAT mat,MAT nm,GZ dn,int *rind,int *cind);
   int gz_gensolve_check2(MAT mat,MAT nm,GZ *dn,int *rind,int *cind);
   int gz_intmtoratm(MAT mat,GZ md,MAT nm,GZ *dn);
   int gz_intmtoratm2(MAT mat,GZ md,MAT nm,GZ *dn,int *stat);
   int gz_inttorat(GZ c,GZ m,GZ b,int *sgnp,GZ *nmp,GZ *dnp);
   int gz_intvtoratv(GZ *v,int n,GZ md,GZ b,GZ *nm,GZ *dn);
   int invdalg(DAlg a,DAlg *c);
   int is_eq(Obj a0,Obj a1);
   int length(NODE);
   int lu_mod(unsigned int **a,int n,unsigned int md,int **rinfo);
   int n_bits_gz(GZ a);
   int nd_gauss_elim_gz(GZ **mat0,int *sugar,int row,int col,int *colstat);
   int poly_is_dependent(P p,V v);
   int setsecureflag(char *name,int value);
   int sfdegtest(int dy,int bound,UM *d1c,int k,int *in);
   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

Legend:
Removed from v.1.81  
changed lines
  Added in v.1.106

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>