version 1.50, 2004/07/13 07:59:53 |
version 1.53, 2004/12/02 13:48:43 |
|
|
* 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.49 2004/05/14 06:02:54 noro Exp $ |
* $OpenXM: OpenXM_contrib2/asir2000/include/ca.h,v 1.52 2004/10/06 11:58:52 noro Exp $ |
*/ |
*/ |
#include <stdio.h> |
#include <stdio.h> |
#include <stdlib.h> |
#include <stdlib.h> |
Line 137 typedef void * pointer; |
|
Line 137 typedef void * pointer; |
|
#define N_GFPN 8 |
#define N_GFPN 8 |
#define N_GFS 9 |
#define N_GFS 9 |
#define N_GFSN 10 |
#define N_GFSN 10 |
|
#define N_DA 11 |
|
|
#define ORD_REVGRADLEX 0 |
#define ORD_REVGRADLEX 0 |
#define ORD_GRADLEX 1 |
#define ORD_GRADLEX 1 |
Line 164 typedef struct oN { |
|
Line 165 typedef struct oN { |
|
unsigned int b[1]; |
unsigned int b[1]; |
} *N; |
} *N; |
|
|
|
typedef struct oZ { |
|
int p; |
|
unsigned int b[1]; |
|
} *Z; |
|
|
typedef struct oUP2 { |
typedef struct oUP2 { |
int w; |
int w; |
unsigned int b[1]; |
unsigned int b[1]; |
Line 246 typedef struct oGFPN { |
|
Line 252 typedef struct oGFPN { |
|
struct oUP *body; |
struct oUP *body; |
} *GFPN; |
} *GFPN; |
|
|
|
typedef struct oDAlg { |
|
short id; |
|
char nid; |
|
char pad; |
|
struct oDP *nm; |
|
struct oQ *dn; |
|
} *DAlg; |
|
|
|
|
typedef struct oNum { |
typedef struct oNum { |
short id; |
short id; |
char nid; |
char nid; |
Line 583 struct modorder_spec { |
|
Line 598 struct modorder_spec { |
|
int *degree_shift; |
int *degree_shift; |
}; |
}; |
|
|
|
typedef struct oNumberField { |
|
int n; |
|
int dim; |
|
VL vl; |
|
P *defpoly; |
|
DP *mb; |
|
DP *ps; |
|
struct oDAlg *one; |
|
NODE ind; |
|
struct order_spec *spec; |
|
} *NumberField; |
|
|
/* structure for cputime */ |
/* structure for cputime */ |
|
|
struct oEGT { |
struct oEGT { |
Line 763 bzero((char *)(q)->b,(w)*sizeof(unsigned int))) |
|
Line 790 bzero((char *)(q)->b,(w)*sizeof(unsigned int))) |
|
#define NEWGFMMAT(l) ((l)=(GFMMAT)MALLOC(sizeof(struct oGF2MAT)),OID(l)=O_GFMMAT) |
#define NEWGFMMAT(l) ((l)=(GFMMAT)MALLOC(sizeof(struct oGF2MAT)),OID(l)=O_GFMMAT) |
#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 NEWBF(q,l) ((q)=(BF)MALLOC_ATOMIC(TRUESIZE(oBF,(l)-1,long)),OID(q)=O_N,NID(q)=N_B) |
#define NEWBF(q,l) ((q)=(BF)MALLOC_ATOMIC(TRUESIZE(oBF,(l)-1,long)),OID(q)=O_N,NID(q)=N_B) |
#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) |
Line 774 bzero((char *)(q)->b,(w)*sizeof(unsigned int))) |
|
Line 802 bzero((char *)(q)->b,(w)*sizeof(unsigned int))) |
|
((d)=(DL)MALLOC_ATOMIC(TRUESIZE(oDL,(n)-1,int))) |
((d)=(DL)MALLOC_ATOMIC(TRUESIZE(oDL,(n)-1,int))) |
|
|
#define MKP(v,dc,p) \ |
#define MKP(v,dc,p) \ |
(!DEG(dc)?((p)=COEF(dc)):(NEWP(p),VR(p)=(v),DC(p)=(dc),(p))) |
((!DEG(dc)&&!NEXT(dc))?((p)=COEF(dc)):(NEWP(p),VR(p)=(v),DC(p)=(dc),(p))) |
#define MKV(v,p) \ |
#define MKV(v,p) \ |
(NEWP(p),VR(p)=(v),NEWDC(DC(p)),\ |
(NEWP(p),VR(p)=(v),NEWDC(DC(p)),\ |
DEG(DC(p))=ONE,COEF(DC(p))=(P)ONE,NEXT(DC(p))=0) |
DEG(DC(p))=ONE,COEF(DC(p))=(P)ONE,NEXT(DC(p))=0) |
Line 855 PL(NM(q))=1,BD(NM(q))[0]=(unsigned int)(n),DN(q)=0,(q) |
|
Line 883 PL(NM(q))=1,BD(NM(q))[0]=(unsigned int)(n),DN(q)=0,(q) |
|
#define MKReal(a,b) (!(a)?((b)=0):(NEWReal(b),BDY(b)=(a),(b))) |
#define MKReal(a,b) (!(a)?((b)=0):(NEWReal(b),BDY(b)=(a),(b))) |
#define MKAlg(b,r) \ |
#define MKAlg(b,r) \ |
(!(b)?((r)=0):NUM(b)?((r)=(Alg)(b)):(NEWAlg(r),BDY(r)=(Obj)(b),(r))) |
(!(b)?((r)=0):NUM(b)?((r)=(Alg)(b)):(NEWAlg(r),BDY(r)=(Obj)(b),(r))) |
|
#define MKDAlg(dp,den,r) (NEWDAlg(r),(r)->nm = (dp),(r)->dn=(den)) |
|
|
|
#define IMM_MAX 1073741823 |
|
#define IMM_MIN -1073741823 |
|
|
|
#define SL(n) ((n)->p) |
|
#define ZALLOC(d) ((Z)MALLOC_ATOMIC(TRUESIZE(oZ,(d)-1,int))) |
|
|
#if defined(PARI) |
#if defined(PARI) |
#define ToReal(a) (!(a)?(double)0.0:REAL(a)?BDY((Real)a):RATN(a)?RatnToReal((Q)a):BIGFLOAT(a)?rtodbl(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 |
#else |
Line 1439 void chsgngfsn(GFSN,GFSN *); |
|
Line 1474 void chsgngfsn(GFSN,GFSN *); |
|
void pwrgfsn(GFSN,Q, GFSN *); |
void pwrgfsn(GFSN,Q, GFSN *); |
int cmpgfsn(GFSN,GFSN); |
int cmpgfsn(GFSN,GFSN); |
|
|
|
void adddalg(DAlg,DAlg,DAlg *); |
|
void subdalg(DAlg,DAlg,DAlg *); |
|
void muldalg(DAlg,DAlg,DAlg *); |
|
void divdalg(DAlg,DAlg,DAlg *); |
|
void chsgndalg(DAlg,DAlg *); |
|
void pwrdalg(DAlg,Q, DAlg *); |
|
int cmpdalg(DAlg,DAlg); |
|
|
void addalg(Num,Num,Num *); |
void addalg(Num,Num,Num *); |
void addbf(Num,Num,Num *); |
void addbf(Num,Num,Num *); |
void addcplx(Num,Num,Num *); |
void addcplx(Num,Num,Num *); |
Line 2486 void afctrmain(VL vl,P p0,P p,int init,DCP *dcp); |
|
Line 2529 void afctrmain(VL vl,P p0,P p,int init,DCP *dcp); |
|
int divtmp(VL vl,int mod,P p1,P p2,P *q); |
int divtmp(VL vl,int mod,P p1,P p2,P *q); |
int divtdcmp(VL vl,int mod,P p1,P p2,P *q); |
int divtdcmp(VL vl,int mod,P p1,P p2,P *q); |
void GC_gcollect(); |
void GC_gcollect(); |
|
|
|
Z stoz(int c); |
|
Z utoz(unsigned int c); |
|
Z qtoz(Q n); |
|
Q ztoq(Z n); |
|
Z chsgnz(Z n); |
|
Z simpz(Z n); |
|
Z dupz(Z n); |
|
Z absz(Z n); |
|
Z addz(Z n1,Z n2); |
|
Z subz(Z n1,Z n2); |
|
Z mulz(Z n1,Z n2); |
|
Z divsz(Z n1,Z n2); |
|
Z divz(Z n1,Z n2,Z *rem); |
|
Z gcdz(Z n1,Z n2); |
|
Z gcdz_cofactor(Z n1,Z n2,Z *c1,Z *c2); |
|
Z estimate_array_gcdz(Z *a,int n); |
|
Z array_gcdz(Z *a,int n); |
|
void mkwcz(int k,int l,Z *t); |
|
int remzi(Z n,int m); |
|
|
|
|
#if 0 && !defined(VISUAL) |
#if 0 && !defined(VISUAL) |
void bzero(const void *,int); |
void bzero(const void *,int); |