version 1.55, 2004/12/18 16:50:10 |
version 1.76, 2009/03/16 16:43:03 |
|
|
* 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.54 2004/12/10 07:36:34 noro Exp $ |
* $OpenXM: OpenXM_contrib2/asir2000/include/ca.h,v 1.75 2009/02/05 08:37:02 ohara Exp $ |
*/ |
*/ |
#include <stdio.h> |
#include <stdio.h> |
#include <stdlib.h> |
#include <stdlib.h> |
Line 93 typedef void * pointer; |
|
Line 93 typedef void * pointer; |
|
#endif |
#endif |
#endif |
#endif |
|
|
|
#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) |
#define FREEQ(p) |
#define FREEQ(p) |
Line 128 typedef void * pointer; |
|
Line 130 typedef void * pointer; |
|
/* IMAT */ |
/* IMAT */ |
#define O_IMAT 24 |
#define O_IMAT 24 |
/* IMAT */ |
/* IMAT */ |
|
#define O_NBP 25 |
|
|
#define N_Q 0 |
#define N_Q 0 |
#define N_R 1 |
#define N_R 1 |
|
|
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 defined(LONG_IS_32BIT) |
#if SIZEOF_LONG == 4 |
#if defined(VISUAL) |
#if defined(VISUAL) |
typedef _int64 L; |
typedef _int64 L; |
typedef unsigned _int64 UL; |
typedef unsigned _int64 UL; |
Line 444 typedef struct oTB { |
|
Line 447 typedef struct oTB { |
|
char **body; |
char **body; |
} *TB; |
} *TB; |
|
|
|
typedef struct oNBP { |
|
short id; |
|
short pad; |
|
struct oNODE *body; |
|
} *NBP; |
|
|
|
/* non-commutative bivariate monomial */ |
|
|
|
typedef struct oNBM { |
|
int d; |
|
P c; |
|
unsigned int *b; |
|
} *NBM; |
|
|
|
#define NEWNBM(p) ((p)=(NBM)MALLOC(sizeof(struct oNBM))) |
|
#define NEWNBMBDY(p,d) \ |
|
((p)->b=(unsigned int *)MALLOC((((d)+31)/32)*sizeof(unsigned int))) |
|
#define NEWNBP(p) ((p)=(NBP)MALLOC(sizeof(struct oNBP)),OID(p)=O_NBP) |
|
#define MKNBP(p,b) (NEWNBP(p),BDY(p)=(b)) |
|
|
|
#define NBM_GET(a,j) (((a)[(j)>>5]&(1<<((j)&31)))?1:0) |
|
#define NBM_SET(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; |
Line 598 struct order_spec { |
|
Line 625 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) */ |
union { |
union { |
int simple; |
int simple; |
struct { |
struct { |
Line 625 struct modorder_spec { |
|
Line 653 struct modorder_spec { |
|
|
|
typedef struct oNumberField { |
typedef struct oNumberField { |
int n; |
int n; |
|
int psn; |
int dim; |
int dim; |
VL vl; |
VL vl; |
P *defpoly; |
P *defpoly; |
Line 859 DEG(DC(p))=ONE,COEF(DC(p))=(P)ONEM,NEXT(DC(p))=0) |
|
Line 888 DEG(DC(p))=ONE,COEF(DC(p))=(P)ONEM,NEXT(DC(p))=0) |
|
#define MKERR(e,b) (NEWERR(e),(e)->body=(Obj)(b)) |
#define MKERR(e,b) (NEWERR(e),(e)->body=(Obj)(b)) |
#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=(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)) |
#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)) |
|
|
Line 912 PL(NM(q))=1,BD(NM(q))[0]=(unsigned int)(n),DN(q)=0,(q) |
|
Line 941 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 MKDAlg(dp,den,r) (!(dp)?(void *)((r)=0):(void *)(NEWDAlg(r),(r)->nm = (dp),(r)->dn=(den))) |
|
|
#define IMM_MAX 1073741823 |
#define IMM_MAX 1073741823 |
#define IMM_MIN -1073741823 |
#define IMM_MIN -1073741823 |
Line 930 PL(NM(q))=1,BD(NM(q))[0]=(unsigned int)(n),DN(q)=0,(q) |
|
Line 959 PL(NM(q))=1,BD(NM(q))[0]=(unsigned int)(n),DN(q)=0,(q) |
|
#define NUM(p) (OID(p)==O_N) |
#define NUM(p) (OID(p)==O_N) |
#define RAT(p) (OID(p)==O_R) |
#define RAT(p) (OID(p)==O_R) |
#define RATN(a) (NID(a)==N_Q) |
#define RATN(a) (NID(a)==N_Q) |
|
#define POLY(a) (!(a) ||(OID(a)<=O_P)) |
#define INT(q) (!(q)||(NUM(q)&&RATN((Num)q)&&!DN((Q)q))) |
#define INT(q) (!(q)||(NUM(q)&&RATN((Num)q)&&!DN((Q)q))) |
#define REAL(a) (NID(a)==N_R) |
#define REAL(a) (NID(a)==N_R) |
#define BIGFLOAT(a) (NID(a)==N_B) |
#define BIGFLOAT(a) (NID(a)==N_B) |
Line 1022 extern const int sprime[]; |
|
Line 1052 extern const int sprime[]; |
|
extern int sprime[]; |
extern int sprime[]; |
#endif |
#endif |
|
|
extern int lprime_size; |
|
extern int *lprime; |
|
|
|
extern void (*addnumt[])(); |
extern void (*addnumt[])(); |
extern void (*subnumt[])(); |
extern void (*subnumt[])(); |
extern void (*mulnumt[])(); |
extern void (*mulnumt[])(); |
Line 1295 void copyn(N,int,int *); |
|
Line 1322 void copyn(N,int,int *); |
|
void kmulnmain(N,N,N *); |
void kmulnmain(N,N,N *); |
int qcoefp(Obj); |
int qcoefp(Obj); |
int qcoefr(Obj); |
int qcoefr(Obj); |
int get_allocwords(void); |
long get_allocwords(void); |
double get_clock(void); |
double get_clock(void); |
void get_eg(struct oEGT *); |
void get_eg(struct oEGT *); |
void printtime(struct oEGT *,struct oEGT *,double); |
void printtime(struct oEGT *,struct oEGT *,double); |
Line 1400 LUM LUMALLOC(int, int); |
|
Line 1427 LUM LUMALLOC(int, int); |
|
BM BMALLOC(int, int); |
BM BMALLOC(int, int); |
Obj ToAlg(Num); |
Obj ToAlg(Num); |
UM *berlemain(register int, UM, UM *); |
UM *berlemain(register int, UM, UM *); |
|
void Risa_GC_set_adj(int,int); |
|
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); |
Line 2449 void resume_timer() ; |
|
Line 2478 void resume_timer() ; |
|
void reset_engine() ; |
void reset_engine() ; |
unsigned int get_asir_version() ; |
unsigned int get_asir_version() ; |
char *get_asir_distribution(); |
char *get_asir_distribution(); |
void create_error(ERR *err,unsigned int serial,char *msg); |
void create_error(ERR *err,unsigned int serial,char *msg,LIST trace); |
void init_lprime(); |
void init_lprime(); |
int get_lprime(int index); |
int get_lprime(int index); |
void create_new_lprimes(int index); |
void create_new_lprimes(int index); |
Line 2608 int remzi(Z n,int m); |
|
Line 2637 int remzi(Z n,int m); |
|
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); |
|
#endif |
|
|
|
void chsgnnbp(NBP p,NBP *rp); |
|
void subnbp(VL vl,NBP p1,NBP p2, NBP *rp); |
|
void addnbp(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); |
|
int compnbp(VL vl,NBP p1,NBP p2); |
|
|
|
#if defined(PARI23) |
|
#define prec precreal |
|
#define mppgcd(a,b) (gcdii((a),(b))) |
#endif |
#endif |