Annotation of OpenXM_contrib2/asir2000/include/ca.h, Revision 1.3
1.3 ! noro 1: /* $OpenXM: OpenXM_contrib2/asir2000/include/ca.h,v 1.2 2000/02/08 04:47:10 noro Exp $ */
1.1 noro 2: #include <stdio.h>
3:
4: #if defined(hpux)
5: #include <netinet/in.h>
6: # define setbuffer(FP,buf,siz) setvbuf(FP,buf,_IOFBF,siz)
7: #endif
8:
9: #if defined(VISUAL)
10: #include <stdlib.h>
11: #endif
12:
13: #if defined(__MWERKS__)
14: #define THINK_C
15: #endif
16:
17: #if defined(linux) || (defined(sun) && !defined(SYSV)) || defined(news5000) || (defined(mips) && defined(ultrix))
18: #include <alloca.h>
19: #endif
20:
21: #if (defined(sun) && defined(SYSV))
22: #define alloca(x) __builtin_alloca(x)
23: #endif
24:
25: #if defined(VISUAL)
26: #include <malloc.h>
27: #endif
28:
29: #if 0
30: #include <sys/types.h>
31: typedef caddr_t pointer;
32: #endif
33:
34: typedef void * pointer;
35:
36: #if defined(VISUAL)
37: #include <string.h>
38: #define index(s,c) strchr(s,c)
39: #define bzero(s,len) memset(s,0,len)
40: #define bcopy(x,y,len) memcpy(y,x,len)
41: #endif
42:
43: #define COPY(a,b) ((b)=(a))
44: #define FREEN(p)
45: #define FREEQ(p)
46: #define FREE(p)
47: #define INITRC(p)
48:
49: /* data structures */
50:
51: #define O_N 1
52: #define O_P 2
53: #define O_R 3
54: #define O_LIST 4
55: #define O_VECT 5
56: #define O_MAT 6
57: #define O_STR 7
58: #define O_COMP 8
59: #define O_DP 9
60: #define O_USINT 10
61: #define O_ERR 11
62: #define O_GF2MAT 12
63: #define O_MATHCAP 13
64: #define O_F 14
65: #define O_GFMMAT 15
66: #define O_VOID -1
67:
68: #define N_Q 0
69: #define N_R 1
70: #define N_A 2
71: #define N_B 3
72: #define N_C 4
73: #define N_M 5
74: #define N_LM 6
75: #define N_GF2N 7
76: #define N_GFPN 8
77:
78: #define ORD_REVGRADLEX 0
79: #define ORD_GRADLEX 1
80: #define ORD_LEX 2
81:
82: #if LONG_IS_32BIT
83: #if defined(VISUAL)
84: typedef _int64 L;
85: typedef unsigned _int64 UL;
86: #else
87: typedef long long L;
88: typedef unsigned long long UL;
89: #endif
90: #else
91: typedef long L;
92: typedef unsigned long UL;
93: #endif
94:
95: typedef struct oN {
96: int p;
97: unsigned int b[1];
98: } *N;
99:
100: typedef struct oUP2 {
101: int w;
102: unsigned int b[1];
103: } *UP2;
104:
105: typedef struct _oUP2 {
106: int w;
107: unsigned int *b;
108: } *_UP2;
109:
110: #define UP2_DENSE 0
111: #define UP2_SPARSE 1
112:
113: typedef struct oGEN_UP2 {
114: int id;
115: UP2 dense;
116: UP2 sparse;
117: } *GEN_UP2;
118:
119: typedef struct oV {
120: char *name;
121: pointer attr;
122: pointer priv;
123: } *V;
124:
125: typedef struct oQ {
126: short id;
127: char nid;
128: char sgn;
129: N nm;
130: N dn;
131: } *Q;
132:
133: typedef struct oReal {
134: short id;
135: char nid;
136: char pad;
137: double body;
138: } *Real;
139:
140: typedef struct oAlg {
141: short id;
142: char nid;
143: char pad;
144: struct oObj *body;
145: } *Alg;
146:
147: typedef struct oBF {
148: short id;
149: char nid;
150: char pad;
151: long body[1];
152: } *BF;
153:
154: typedef struct oC {
155: short id;
156: char nid;
157: char pad;
158: struct oNum *r,*i;
159: } *C;
160:
161: typedef struct oLM {
162: short id;
163: char nid;
164: char pad;
165: struct oN *body;
166: } *LM;
167:
168: typedef struct oGF2N {
169: short id;
170: char nid;
171: char pad;
172: struct oUP2 *body;
173: } *GF2N;
174:
175: typedef struct oGFPN {
176: short id;
177: char nid;
178: char pad;
179: struct oUP *body;
180: } *GFPN;
181:
182: typedef struct oNum {
183: short id;
184: char nid;
185: char pad;
186: } *Num;
187:
188: typedef struct oMQ {
189: short id;
190: char nid;
191: char pad;
192: int cont;
193: } *MQ;
194:
195: typedef struct oP {
196: short id;
197: short pad;
198: V v;
199: struct oDCP *dc;
200: } *P;
201:
202: typedef struct oR {
203: short id;
204: short reduced;
205: P nm;
206: P dn;
207: } *R;
208:
209: typedef struct oVECT {
210: short id;
211: short pad;
212: int len;
213: pointer *body;
214: } *VECT;
215:
216: typedef struct oMAT {
217: short id;
218: short pad;
219: int row,col;
220: pointer **body;
221: } *MAT;
222:
223: typedef struct oGF2MAT {
224: short id;
225: short pad;
226: int row,col;
227: unsigned int **body;
228: } *GF2MAT, *GFMMAT;
229:
230: typedef struct oLIST {
231: short id;
232: short pad;
233: struct oNODE *body;
234: } *LIST;
235:
236: typedef struct oSTRING {
237: short id;
238: short pad;
239: char *body;
240: } *STRING;
241:
242: typedef struct oCOMP {
243: short id;
244: short type;
245: struct oObj *member[1];
246: } *COMP;
247:
248: typedef struct oDP {
249: short id;
250: short nv;
251: int sugar;
252: struct oMP *body;
253: } *DP;
254:
255: typedef struct oUSINT {
256: short id;
257: short pad;
258: unsigned body;
259: } *USINT;
260:
261: typedef struct oERR {
262: short id;
263: short pad;
264: struct oObj *body;
265: } *ERR;
266:
267: typedef struct oMATHCAP {
268: short id;
269: short pad;
270: struct oLIST *body;
271: } *MATHCAP;
272:
273: typedef struct oObj {
274: short id;
275: short pad;
276: } *Obj;
277:
278: typedef struct oDCP {
279: Q d;
280: P c;
281: struct oDCP *next;
282: } *DCP;
283:
284: typedef struct oMP {
285: struct oDL *dl;
286: P c;
287: struct oMP *next;
288: } *MP;
289:
290: typedef struct oDL {
291: int td;
292: int d[1];
293: } *DL;
294:
295: typedef struct oVL {
296: V v;
297: struct oVL *next;
298: } *VL;
299:
300: typedef struct oNODE {
301: pointer body;
302: struct oNODE *next;
303: } *NODE;
304:
305: typedef struct oUM {
306: int d;
307: int c[1];
308: } *UM;
309:
310: typedef struct oLUM {
311: int d;
312: int *c[1];
313: } *LUM;
314:
315: typedef struct oML {
316: int n;
317: int mod;
318: int bound;
319: pointer c[1];
320: } *ML;
321:
322: typedef struct oUB {
323: int d;
324: N c[1];
325: } *UB;
326:
327: typedef struct oVN {
328: V v;
329: int n;
330: } *VN;
331:
332: typedef struct oUP {
333: int d;
334: Num c[1];
335: } *UP;
336:
337: typedef struct oDUM {
338: int n;
339: UM f;
340: } *DUM;
341:
342: struct order_pair {
343: int order, length;
344: };
345:
346: struct order_spec {
347: int id;
348: Obj obj;
349: int nv;
350: union {
351: int simple;
352: struct {
353: int length;
354: struct order_pair *order_pair;
355: } block;
356: struct {
357: int row;
358: int **matrix;
359: } matrix;
360: } ord;
361: };
362:
363: /* structure for cputime */
364:
365: struct oEGT {
366: double exectime,gctime;
367: };
368:
369: /* constant */
370:
371: /* ground finite field specification */
372: #define FF_NOT_SET 0
373: #define FF_GFP 1
374: #define FF_GF2N 2
375: #define FF_GFPN 3
376:
377: #define INDEX 100
378:
379: #if USE_FLOAT
380: typedef float ModNum;
381: #define NPrimes 536
382: #else
383: typedef unsigned int ModNum;
384: #define NPrimes 13681
385: #endif
386:
387: /* general macros */
388: #define MAX(a,b) ((a) > (b) ? (a) : (b) )
389: #define MIN(a,b) ((a) > (b) ? (b) : (a) )
390: #ifdef ABS
391: #undef ABS
392: #endif
393: #define ABS(a) ((a)>0?(a):-(a))
394: #define ID(p) ((p)->id)
395: #define OID(p) (((Obj)(p))->id)
396: #define NID(p) (((Num)(p))->nid)
397: #define BDY(p) ((p)->body)
398: #define VR(p) ((p)->v)
399: #define NAME(p) ((p)->name)
400: #define NEXT(p) ((p)->next)
401: #define NM(q) ((q)->nm)
402: #define DN(q) ((q)->dn)
403: #define SGN(q) ((q)->sgn)
404: #define DC(p) ((p)->dc)
405: #define COEF(p) ((p)->c)
406: #define DEG(p) ((p)->d)
407: #define PL(n) ((n)->p)
408: #define BD(n) ((n)->b)
409: #define CONT(a) ((a)->cont)
410: #define UDEG(f) BD(NM(DEG(DC(f))))[0]
411: #define UCOEF(f) (COEF(DC(f)))
412: #define LC(f) (NUM(f)?(f):COEF(DC(f)))
413:
414: /* memory allocators (W_... : uses alloca) */
415:
416: #if 0
417: #define MALLOC(d) Risa_GC_malloc(d)
418: #define MALLOC_ATOMIC(d) Risa_GC_malloc_atomic(d)
419: #define REALLOC(p,d) Risa_GC_realloc(p,d)
420: #else
421: #define MALLOC(d) GC_malloc(d)
422: #define MALLOC_ATOMIC(d) GC_malloc_atomic(d)
423: #define REALLOC(p,d) GC_realloc(p,d)
424: #endif
425: #define CALLOC(d,e) MALLOC((d)*(e))
426:
427: #if (defined(__GNUC__) || defined(vax) || defined(apollo) || defined(alloca) || defined(VISUAL))
428: #define ALLOCA(d) alloca(d)
429: #else
430: #define ALLOCA(d) MALLOC(d)
431: #endif
432:
433: #define TRUESIZE(type,n,atype) (sizeof(struct type)+MAX((n),0)*sizeof(atype))
434: #define NALLOC(d) ((N)MALLOC_ATOMIC(TRUESIZE(oN,(d)-1,int)))
435: #define UMALLOC(d) ((UM)MALLOC(TRUESIZE(oUM,d,int)))
436: #define UPALLOC(d) ((UP)MALLOC(TRUESIZE(oUP,(d),Num)))
437: #define C_UMALLOC(d) ((UM)MALLOC(TRUESIZE(oUM,d,int)))
438: #define MLALLOC(d) ((ML)MALLOC(TRUESIZE(oML,d,pointer)))
439:
440: #define W_ALLOC(d) ((int *)ALLOCA(((d)+1)*sizeof(int)))
441: #define W_CALLOC(n,type,p) \
442: ((p)=(type *)ALLOCA(((n)+1)*sizeof(type)),\
443: bzero((char *)(p),(int)(((n)+1)*sizeof(type))))
444: #define W_UMALLOC(d) ((UM)ALLOCA(TRUESIZE(oUM,d,int)))
445: #define W_UPALLOC(d) ((UP)ALLOCA(TRUESIZE(oUP,(d),Num)))
446: #define W_MLALLOC(d) ((ML)ALLOCA(TRUESIZE(oML,d,pointer)))
447: #define W_LUMALLOC(n,bound,p)\
448: {\
449: LUM ___q___;\
450: int ___i___,**___c___;\
451: (___q___) = (LUM)ALLOCA(TRUESIZE(oLUM,(n),int *));\
452: DEG(___q___) = n;\
453: for ( ___i___ = 0, ___c___ = (int **)COEF(___q___); ___i___ <= n; ___i___++ ) {\
454: ___c___[___i___] = (int *)ALLOCA(((bound)+1)*sizeof(int));\
455: bzero((char *)___c___[___i___],((bound)+1)*sizeof(int));\
456: }\
457: (p) = ___q___;\
458: }
459:
460: #define NEWUP2(q,w)\
461: ((q)=(UP2)MALLOC_ATOMIC(TRUESIZE(oUP2,(w)-1,unsigned int)),\
462: bzero((char *)(q)->b,(w)*sizeof(unsigned int)))
463: #define W_NEWUP2(q,w)\
464: ((q)=(UP2)ALLOCA(TRUESIZE(oUP2,(w)-1,unsigned int)),\
465: bzero((char *)(q)->b,(w)*sizeof(unsigned int)))
466: #define W_NEW_UP2(q,w)\
467: ((q).b=(unsigned int *)ALLOCA((w)*sizeof(unsigned int)))
468:
469: /* cell allocators */
470: #define NEWQ(q) ((q)=(Q)MALLOC(sizeof(struct oQ)),OID(q)=O_N,NID(q)=N_Q)
471: #define NEWMQ(q) ((q)=(MQ)MALLOC_ATOMIC(sizeof(struct oMQ)),OID(q)=O_N,NID(q)=N_M)
472: #define NEWP(p) ((p)=(P)MALLOC(sizeof(struct oP)),OID(p)=O_P)
473: #define NEWR(r) ((r)=(R)MALLOC(sizeof(struct oR)),OID(r)=O_R,(r)->reduced=0)
474: #define NEWLIST(l) ((l)=(LIST)MALLOC(sizeof(struct oLIST)),OID(l)=O_LIST)
475: #define NEWVECT(l) ((l)=(VECT)MALLOC(sizeof(struct oVECT)),OID(l)=O_VECT)
476: #define NEWSTR(l) ((l)=(STRING)MALLOC(sizeof(struct oSTRING)),OID(l)=O_STR)
477: #define NEWCOMP(c,n) ((c)=(COMP)MALLOC(sizeof(struct oCOMP)+((n)-1)*sizeof(Obj)),OID(c)=O_COMP)
478: #define NEWDP(d) ((d)=(DP)MALLOC(sizeof(struct oDP)),OID(d)=O_DP)
479: #define NEWUSINT(u) ((u)=(USINT)MALLOC_ATOMIC(sizeof(struct oUSINT)),OID(u)=O_USINT)
480: #define NEWERR(e) ((e)=(ERR)MALLOC(sizeof(struct oERR)),OID(e)=O_ERR)
481: #define NEWMATHCAP(e) ((e)=(MATHCAP)MALLOC(sizeof(struct oMATHCAP)),OID(e)=O_MATHCAP)
482:
483: #define NEWNODE(a) ((a)=(NODE)MALLOC(sizeof(struct oNODE)))
484: #define NEWDC(dc) ((dc)=(DCP)MALLOC(sizeof(struct oDCP)))
485: #define NEWV(v) ((v)=(V)MALLOC(sizeof(struct oV)))
486: #define NEWVL(vl) ((vl)=(VL)MALLOC(sizeof(struct oVL)))
487: #define NEWMP(m) ((m)=(MP)MALLOC(sizeof(struct oMP)))
488:
489: #define NEWMAT(l) ((l)=(MAT)MALLOC(sizeof(struct oMAT)),OID(l)=O_MAT)
490: #define NEWGF2MAT(l) ((l)=(GF2MAT)MALLOC(sizeof(struct oGF2MAT)),OID(l)=O_GF2MAT)
491: #define NEWGFMMAT(l) ((l)=(GFMMAT)MALLOC(sizeof(struct oGF2MAT)),OID(l)=O_GFMMAT)
492: #define NEWReal(q) ((q)=(Real)MALLOC_ATOMIC(sizeof(struct oReal)),OID(q)=O_N,NID(q)=N_R)
493: #define NEWAlg(r) ((r)=(Alg)MALLOC(sizeof(struct oAlg)),OID(r)=O_N,NID(r)=N_A)
494: #define NEWBF(q,l) ((q)=(BF)MALLOC_ATOMIC(TRUESIZE(oBF,(l)-1,long)),OID(q)=O_N,NID(q)=N_B)
495: #define NEWC(r) ((r)=(C)MALLOC(sizeof(struct oC)),OID(r)=O_N,NID(r)=N_C)
496: #define NEWLM(r) ((r)=(LM)MALLOC(sizeof(struct oLM)),OID(r)=O_N,NID(r)=N_LM)
497: #define NEWGF2N(r) ((r)=(GF2N)MALLOC(sizeof(struct oGF2N)),OID(r)=O_N,NID(r)=N_GF2N)
498: #define NEWGFPN(r) ((r)=(GFPN)MALLOC(sizeof(struct oGFPN)),OID(r)=O_N,NID(r)=N_GFPN)
499: #define NEWDL(d,n) \
500: ((d)=(DL)MALLOC_ATOMIC(TRUESIZE(oDL,(n)-1,int)),bzero((char *)(d),TRUESIZE(oDL,(n)-1,int)))
501:
502: #define MKP(v,dc,p) \
503: (!DEG(dc)?((p)=COEF(dc)):(NEWP(p),VR(p)=(v),DC(p)=(dc),(p)))
504: #define MKV(v,p) \
505: (NEWP(p),VR(p)=(v),NEWDC(DC(p)),\
506: DEG(DC(p))=ONE,COEF(DC(p))=(P)ONE,NEXT(DC(p))=0)
507: #define MKRAT(n,d,r,p) \
508: (NEWR(p),NM(p)=(n),DN(p)=(d),(p)->reduced=(r))
509: #define MKMV(v,p) \
510: (NEWP(p),VR(p)=(v),NEWDC(DC(p)),\
511: DEG(DC(p))=ONE,COEF(DC(p))=(P)ONEM,NEXT(DC(p))=0)
512: #define MKNODE(a,b,c) \
513: (NEWNODE(a),(a)->body=(pointer)b,NEXT(a)=(NODE)(c))
514: #define MKLIST(a,b) (NEWLIST(a),(a)->body=(NODE)(b))
515: #define MKVECT(m,l) \
516: (NEWVECT(m),(m)->len=(l),(m)->body=(pointer *)CALLOC((l),sizeof(pointer)))
517: #define MKMAT(m,r,c) \
518: (NEWMAT(m),(m)->row=(r),(m)->col=(c),(m)->body=(pointer **)almat_pointer((r),(c)))
519: #define TOGF2MAT(r,c,b,m) (NEWGF2MAT(m),(m)->row=(r),(m)->col=(c),(m)->body=(b))
520: #define TOGFMMAT(r,c,b,m) (NEWGFMMAT(m),(m)->row=(r),(m)->col=(c),(m)->body=(b))
521: #define MKSTR(a,b) (NEWSTR(a),(a)->body=(char *)(b))
522: #define MKDP(n,m,d) (NEWDP(d),(d)->nv=(n),BDY(d)=(m))
523: #define MKLM(b,l) (!(b)?(l)=0:(NEWLM(l),(l)->body=(b),(l)))
524: #define MKGF2N(b,l) (!(b)?(l)=0:(NEWGF2N(l),(l)->body=(b),(l)))
525: #define MKGFPN(b,l) (!(b)?(l)=0:(NEWGFPN(l),(l)->body=(b),(l)))
526: #define MKUSINT(u,b) (NEWUSINT(u),(u)->body=(unsigned)(b))
527: #define MKERR(e,b) (NEWERR(e),(e)->body=(Obj)(b))
528: #define MKMATHCAP(e,b) (NEWMATHCAP(e),(e)->body=(LIST)(b))
529:
530: #define NEXTDC(r,c) \
531: if(!(r)){NEWDC(r);(c)=(r);}else{NEWDC(NEXT(c));(c)=NEXT(c);}
532: #define NEXTNODE(r,c) \
533: if(!(r)){NEWNODE(r);(c)=(r);}else{NEWNODE(NEXT(c));(c)=NEXT(c);}
534: #define NEXTMP(r,c) \
535: if(!(r)){NEWMP(r);(c)=(r);}else{NEWMP(NEXT(c));(c)=NEXT(c);}
536:
537: /* convertors */
538: #define NTOQ(n,s,q) \
539: (!(n)?((q)=0):(NEWQ(q),SGN(q)=(s),NM(q)=(n),DN(q)=0,(q)))
540: #define NDTOQ(n,d,s,q) \
541: ((!(d)||UNIN(d))?NTOQ(n,s,q):(NEWQ(q),SGN(q)=(s),NM(q)=(n),DN(q)=(d),(q)))
542: #define DUPQ(p,q) \
543: (NEWQ(q),SGN(q)=SGN(p),NM(q)=NM(p),DN(q)=DN(p))
544: #define STOQ(n,q) \
545: ((!(n))?((q)=(Q)NULL):(NEWQ(q),\
546: SGN(q)=((n)>0?1:-1),NM(q)=NALLOC(1),\
547: PL(NM(q))=1,BD(NM(q))[0]=ABS(n),DN(q)=0,(q)))
548: #define UTOMQ(a,b) \
549: ((a)?(NEWMQ(b),CONT(b)=(unsigned int)(a),(b)):((b)=0))
550: #define STOMQ(a,b) \
551: ((a)?(NEWMQ(b),CONT(b)=(a),(b)):((b)=0))
552: #define UTON(u,n) \
553: ((!(u))?((n)=(N)NULL):((n)=NALLOC(1),PL(n)=1,BD(n)[0]=(unsigned int)(u),(n)))
554: #define UTOQ(n,q) \
555: ((!(n))?((q)=(Q)NULL):(NEWQ(q),\
556: SGN(q)=1,NM(q)=NALLOC(1),\
557: PL(NM(q))=1,BD(NM(q))[0]=(unsigned int)(n),DN(q)=0,(q)))
558: #define QTOS(q) (!(q)?0:SGN(q)*((int)BD(NM(q))[0]))
559: #define STON(i,n)\
560: (i?((n)=NALLOC(1),PL(n)=1,BD(n)[0]=(i),(n)):((n)=(N)0))
561: #define PTOR(a,b) \
562: (!(a)?((b)=0):(NEWR(b),NM(b)=(a),DN(b)=(P)ONE,(b)->reduced=1,(b)))
563: #define RTOS(a) (!(a)?0:QTOS((Q)NM((R)a)))
564: #define MKReal(a,b) (!(a)?((b)=0):(NEWReal(b),BDY(b)=(a),(b)))
565: #define MKAlg(b,r) \
566: (!(b)?((r)=0):NUM(b)?((r)=(Alg)(b)):(NEWAlg(r),BDY(r)=(Obj)(b),(r)))
567:
1.3 ! noro 568: #if PARI
! 569: #define ToReal(a) (!(a)?(double)0.0:REAL(a)?BDY((Real)a):RATN(a)?RatnToReal((Q)a):BIGFLOAT(a)?rtodbl(BDY((BF)a)):0)
! 570: #else
! 571: #define ToReal(a) (!(a)?(double)0.0:REAL(a)?BDY((Real)a):RATN(a)?RatnToReal((Q)a):0.0)
! 572: #endif
1.1 noro 573:
574: /* predicates */
575: #define NUM(p) (OID(p)==O_N)
576: #define RAT(p) (OID(p)==O_R)
577: #define INT(q) (!DN((Q)q))
578: #define RATN(a) (NID(a)==N_Q)
579: #define REAL(a) (NID(a)==N_R)
1.3 ! noro 580: #define BIGFLOAT(a) (NID(a)==N_B)
1.1 noro 581: #define SFF(a) (NID(a)==N_M)
582: #define UNIQ(q) ((q)&&NUM(q)&&RATN(q)&&(SGN((Q)q)==1)&&UNIN(NM((Q)q))&&(!DN((Q)q)))
583: #define UNIMQ(q) ((q)&&NUM(q)&&SFF(q)&&(CONT((MQ)q)==1))
584: #define MUNIQ(q) ((q)&&NUM(q)&&RATN(q)&&(SGN((Q)q)==-1)&&UNIN(NM((Q)q))&&(!DN((Q)q)))
585: #define MUNIMQ(q) ((q)&&NUM(q)&&SFF(q)&&(CONT((MQ)q)==-1))
586: #define UNIN(n) ((n)&&(PL(n)==1)&&(BD(n)[0]==1))
587: #define EVENN(n) ((!(n))||(!(BD(n)[0]%2)))
588:
589:
590: /* externals */
591: #if 0
592: double NatToReal();
593: double RatnToReal();
594: #endif
595:
596: extern struct oR oUNIR;
597: extern struct oQ oUNIQ;
598: extern struct oMQ oUNIMQ;
599: extern struct oN oUNIN;
600: extern struct oUP2 oONEUP2;
601: extern struct oV oVAR[];
602: extern struct oV oPVAR[];
603: extern struct oVL oVLIST[];
604: extern struct oVL oPVLIST[];
605: extern VL CO,ALG;
606: extern VL PVL;
607: extern R ONER;
608: extern Q ONE;
609: extern MQ ONEM;
610: extern LM ONELM;
611: extern N ONEN;
612: extern UP2 ONEUP2;
613:
614: extern FILE *asir_out;
615: #if defined(__GNUC__) || defined(THINK_C)
616: extern const int sprime[];
617: extern const int lprime[];
618: #else
619: extern int sprime[];
620: extern int lprime[];
621: #endif
622:
623: extern void (*addnumt[])();
624: extern void (*subnumt[])();
625: extern void (*mulnumt[])();
626: extern void (*divnumt[])();
627: extern void (*pwrnumt[])();
628: extern int (*cmpnumt[])();
629: extern void (*chsgnnumt[])();
630:
631: /* prototypes */
632: int compui(VL,USINT,USINT);
633:
634: void powermodup(UP,UP *);
635: void hybrid_powermodup(UP,UP *);
636:
637: void powertabup(UP,UP,UP *);
638: void hybrid_powertabup(UP,UP,UP *);
639:
640: void generic_powermodup(UP,UP,Q,UP *);
641: void hybrid_generic_powermodup(UP,UP,Q,UP *);
642:
643: void powermod1up(UP,UP *);
644: void hybrid_rembymulup_special(int,UP,UP,UP,UP *);
645: void hybrid_tmulup(int,UP,UP,int,UP *);
646: void hybrid_squareup(int,UP,UP *);
647: void hybrid_mulup(int,UP,UP,UP *);
648:
649: void getmod_lm(N *);
650:
651: int maxblenup(UP);
652: void monicup(UP,UP *);
653: void simpup(UP,UP *);
654: void simpnum(Num,Num *);
655: void decompp(P,Q,P *,P *);
656: void truncp(P,Q,P *);
657: void uremp(P,P,P *);
658: void ugcdp(P,P,P *);
659: void reversep(P,Q,P *);
660: void invmodp(P,Q,P *);
661: void addup(UP,UP,UP *);
662: void subup(UP,UP,UP *);
663: void chsgnup(UP,UP *);
664: void mulup(UP,UP,UP *);
665: void tmulup(UP,UP,int,UP *);
666: void squareup(UP,UP *);
667: void remup(UP,UP,UP *);
668: void remup_destructive(UP,UP);
669: void qrup(UP,UP,UP *,UP *);
670: void qrup_destructive(UP,UP);
671: void gcdup(UP,UP,UP *);
672: void reverseup(UP,int,UP *);
673: void invmodup(UP,int,UP *);
674: void pwrup(UP,Q,UP *);
675: void squarep_gf2n(VL,P,P *);
676: void kmulp(VL,P,P,P *);
677: void ksquarep(VL,P,P *);
678: void kmulup(UP,UP,UP *);
679: void ksquareup(UP,UP *);
680: void extractup(UP,int,int,UP *);
681: void copyup(UP,UP);
682: void c_copyup(UP,int,pointer *);
683: void kmulupmain(UP,UP,UP *);
684: void ksquareupmain(UP,UP *);
685: void rembymulup(UP,UP,UP *);
686: void rembymulup_special(UP,UP,UP,UP *);
687: void tkmulup(UP,UP,int,UP *);
688: void shiftup(UP,int,UP *);
689: void set_degreeup(UP,int);
690: void decompup(UP,int,UP *,UP *);
691: void truncup(UP,int,UP *);
692: void uptofmarray(int,UP,ModNum *);
693: void fmarraytoup(ModNum *,int,UP *);
694: void uiarraytoup(unsigned int **,int,int,UP *);
695: void adj_coefup(UP,N,N,UP *);
696: void uptolmup(UP,UP *);
697: void remcup(UP,N,UP *);
698: void fft_mulup(UP,UP,UP *);
699: void fft_squareup(UP,UP *);
700: void trunc_fft_mulup(UP,UP,int,UP *);
701: void shoup_fft_mulup(UP,UP,UP *);
702: void shoup_fft_squareup(UP,UP *);
703: void shoup_trunc_fft_mulup(UP,UP,int,UP *);
704: void crup(ModNum **,int,int *,int,N,UP *);
705: void shoup_crup(ModNum **,int,int *,int,N,N,UP *);
706: void squareup_gf2n(UP,UP *);
707: void powermodup_gf2n(UP,UP *);
708: void generic_powermodup_gf2n(UP,UP,Q,UP *);
709: void tracemodup_gf2n(UP,UP,Q,UP *);
710: void tracemodup_gf2n_slow(UP,UP,Q,UP *);
711: void tracemodup_gf2n_tab(UP,UP,Q,UP *);
712: void square_rem_tab_up_gf2n(UP,UP *,UP *);
713: void powertabup_gf2n(UP,UP,UP *);
714: void find_root_gf2n(UP,GF2N *);
715:
716: int cmpdl_matrix(int,DL,DL);
717: int cmpdl_order_pair(int,DL,DL);
718: int cmpdl_elim(int,DL,DL);
719: int cmpdl_blexrev(int,DL,DL);
720: int cmpdl_bgradrev(int,DL,DL);
721: int cmpdl_brevrev(int,DL,DL);
722: int cmpdl_brevgradlex(int,DL,DL);
723: int cmpdl_bgradlex(int,DL,DL);
724: int cmpdl_blex(int,DL,DL);
725: int cmpdl_revgradlex(int,DL,DL);
726: int cmpdl_gradlex(int,DL,DL);
727: int cmpdl_revlex(int,DL,DL);
728: int cmpdl_lex(int,DL,DL);
729: int compd(VL,DP,DP);
730: void adddl(int,DL,DL,DL *);
731: void divsdc(VL,DP,P,DP *);
732: void muldc(VL,DP,P,DP *);
733: void muldm(VL,DP,MP,DP *);
734: void muld(VL,DP,DP,DP *);
735: void chsgnd(DP,DP *);
736: void subd(VL,DP,DP,DP *);
737: void addd(VL,DP,DP,DP *);
738: int sugard(MP);
739: void nodetod(NODE,DP *);
740: void dtop(VL,VL,DP,P *);
741: void ptod(VL,VL,P,DP *);
742: void initd(struct order_spec *);
743:
744: void _printdp(DP);
745: void _dp_sp_mod(DP,DP,int,DP *);
746: void _dp_mod(DP,int,NODE,DP *);
747: void _dp_red_mod(DP,DP,int,DP *);
748: void _dtop_mod(VL,VL,DP,P *);
749: void _mulmdm(VL,int,DP,MP,DP *);
750: void _mulmd(VL,int,DP,DP,DP *);
751: void _chsgnmd(int,DP,DP *);
752: void _submd(VL,int,DP,DP,DP *);
753: void _addmd(VL,int,DP,DP,DP *);
754: void _mdtop(VL,int,VL,DP,P *);
755: void divsmdc(VL,int,DP,P,DP *);
756: void mulmdc(VL,int,DP,P,DP *);
757: void mulmdm(VL,int,DP,MP,DP *);
758: void mulmd(VL,int,DP,DP,DP *);
759: void chsgnmd(int,DP,DP *);
760: void submd(VL,int,DP,DP,DP *);
761: void addmd(VL,int,DP,DP,DP *);
762: void mdtop(VL,int,VL,DP,P *);
763: void mptomd(VL,int,VL,P,DP *);
764: void ptomd(VL,int,VL,P,DP *);
765: int p_mag(P);
766: int n_bits(N);
767: void gcdBinary_27n(N,N,N *);
768: void rtime_init(void);
769: void setmod_gf2n(P);
770: void mt_sgenrand(unsigned long);
771: unsigned long mt_genrand(void);
772: #if defined(VISUAL)
773: void srandom(unsigned int);
774: unsigned int random(void);
775: #endif
776: void gcdbmodn(N,N,N *);
777: void gcdbinn(N,N,N *);
778: void gcdmodn(N,N,N *);
779: void gcdaccn(N,N,N *);
780: void gcdEuclidn(N,N,N *);
781: void GC_free(void *);
782: void FFT_primes(int,int *,int *,int *);
783: int FFT_pol_product(unsigned int,unsigned int *, unsigned int,unsigned int *,
784: unsigned int *,int,unsigned int *);
785: int FFT_pol_square(unsigned int,unsigned int *,
786: unsigned int *,int,unsigned int *);
787: void dcptolist(DCP,LIST *);
788: void gcdprsmp(VL,int,P,P,P *);
789: void mult_mod_tab(UM,int,UM *,UM,int);
790: int nfctr_mod(UM,int);
791: int irred_check(UM,int);
792: void modfctrp(P,int,int,DCP *);
793: void pf_init(void);
794: void binaryton(char *,N *);
795: void hexton(char *,N *);
796: void ptolmp(P,P *);
797: void lmptop(P,P *);
798: void ulmptoum(int,UP,UM);
799: void objtobobj(int,Obj,Obj *);
800: void bobjtoobj(int,Obj,Obj *);
801: void numtobnum(int,Num,Num *);
802: void bnumtonum(int,Num,Num *);
803: void ptobp(int,P,P *);
804: void bptop(int,P,P *);
805: void listtoblist(int,LIST,LIST *);
806: void blisttolist(int,LIST,LIST *);
807: void vecttobvect(int,VECT,VECT *);
808: void bvecttovect(int,VECT,VECT *);
809: void mattobmat(int,MAT,MAT *);
810: void bmattomat(int,MAT,MAT *);
811: void n32ton27(N,N *);
812: void n27ton32(N,N *);
813: void kmulum(int,UM,UM,UM);
814: void saveobj(FILE *,Obj);
815: void endian_init(void);
816: void write_char(FILE *,unsigned char *);
817: void write_short(FILE *,unsigned short *);
818: void write_int(FILE *,unsigned int *);
819: void write_double(FILE *,double *);
820: void write_intarray(FILE *,unsigned int *,int);
821: void write_string(FILE *,unsigned char *,int);
822: void savestr(FILE *,char *);
823: void loadstr(FILE *,char **);
824: void savevl(FILE *,VL);
825: void loadvl(FILE *);
826: void skipvl(FILE *);
827: void savev(FILE *,V);
828: void loadv(FILE *,V *);
829: int save_convv(V);
830: V load_convv(int);
831: void swap_bytes(char *,int,int);
832: void read_char(FILE *,unsigned char *);
833: void read_short(FILE *,unsigned short *);
834: void read_int(FILE *,unsigned int *);
835: void read_double(FILE *,double *);
836: void read_intarray(FILE *,unsigned int *,int);
837: void read_string(FILE *,unsigned char *,int);
838: void loadobj(FILE *,Obj *);
839: void invum(int,UM,UM,UM);
840: void addarray_to(unsigned int *,int,unsigned int *,int);
841: void muln_1(unsigned int *,int,unsigned int,unsigned int *);
842: unsigned int divn_1(unsigned int *,int,unsigned int,unsigned int *);
843: void ptoup(P,UP *);
844: void uptop(UP,P *);
845: void printnum(Num);
846: void printv(VL,V);
847: void kmulq(Q,Q,Q *);
848: void bshiftn(N,int,N *);
849: void remn(N,N,N*);
850: void simplm(LM,LM *);
851: void qtolm(Q,LM *);
852: int qpcheck(Obj);
853: int headsgn(P);
854: void adjsgn(P,DCP);
855: void setmod_g2n(P);
856: void simpgf2n(GF2N,GF2N *);
857: void ptogf2n(Obj,GF2N *);
858: void gf2ntop(GF2N,P *);
859: void gf2ntovect(GF2N,VECT *);
860: void squaregf2n(GF2N,GF2N *);
861: void randomgf2n(GF2N *);
862: void invgf2n(GF2N,GF2N *);
863: void kmuln(N,N,N *);
864: void extractn(N,int,int,N *);
865: void copyn(N,int,int *);
866: void kmulnmain(N,N,N *);
867: int qcoefp(Obj);
868: int qcoefr(Obj);
869: int get_allocwords(void);
870: double get_clock(void);
871: void get_eg(struct oEGT *);
872: void printtime(struct oEGT *,struct oEGT *,double);
873: void init_eg(struct oEGT *);
874: void add_eg(struct oEGT *,struct oEGT *,struct oEGT *);
875: void print_eg(char *,struct oEGT *);
876: void print_split_eg(struct oEGT *,struct oEGT *);
877: void print_split_e(struct oEGT *,struct oEGT *);
878: void suspend_timer(void);
879: void resume_timer(void);
880: void reset_engine(void);
881: void notdef(VL,Obj,Obj,Obj *);
882: void error(char *);
883: void ptoup2(P,UP2 *);
884: void ptoup2_sparse(P,UP2 *);
885: void up2top(UP2,P *);
886: void up2tovect(UP2,VECT *);
887: void up2ton(UP2,Q *);
888: void ntoup2(Q,UP2 *);
889: void gen_simpup2(UP2,GEN_UP2,UP2 *);
890: void gen_simpup2_destructive(UP2,GEN_UP2);
891: void gen_invup2(UP2,GEN_UP2,UP2 *);
892: void gen_pwrmodup2(UP2,Q,GEN_UP2,UP2 *);
893: void simpup2(UP2,UP2,UP2 *);
894: int degup2(UP2);
895: int degup2_sparse(UP2);
896: int degup2_1(unsigned int);
897: void addup2(UP2,UP2,UP2 *);
898: void subup2(UP2,UP2,UP2 *);
899: void mulup2_n1(unsigned int *,int,unsigned int,unsigned int *);
900: void mulup2_nh(unsigned int *,int,unsigned int,unsigned int *);
901: void _mulup2_1(UP2,unsigned int,UP2);
902: void _mulup2_h(UP2,unsigned int,UP2);
903: void mulup2(UP2,UP2,UP2 *);
904: void _kmulup2_(unsigned int *,unsigned int *,int,unsigned int *);
905: void _mulup2_nn(unsigned int *,unsigned int *,int,unsigned int *);
906: void _mulup2(UP2,UP2,UP2);
907: void _mulup2_(_UP2,_UP2,_UP2);
908: void squareup2(UP2,UP2 *);
909: void _adjup2(UP2);
910: void _adjup2_(_UP2);
911: void _addup2(UP2,UP2,UP2);
912: void _addup2_destructive(UP2,UP2);
913: void _addup2_(_UP2,_UP2,_UP2);
914: void _addtoup2_(_UP2,_UP2);
915: unsigned int mulup2_bb(unsigned int,unsigned int);
916: void init_up2_tab(void);
917: unsigned int quoup2_11(unsigned int,unsigned int);
918: void divup2_1(unsigned int,unsigned int,int,int,unsigned int *,unsigned int *);
919: void qrup2(UP2,UP2,UP2 *,UP2 *);
920: void _qrup2(UP2,UP2,UP2,UP2);
921: void remup2(UP2,UP2,UP2 *);
922: void _remup2(UP2,UP2,UP2);
923: void remup2_sparse(UP2,UP2,UP2 *);
924: void remup2_sparse_destructive(UP2,UP2);
925: void remup2_type1_destructive(UP2,int);
926: void remup2_3_destructive(UP2,UP2);
927: void remup2_5_destructive(UP2,UP2);
928: void _invup2_1(unsigned int,unsigned int,unsigned int *,unsigned int *);
929: void _gcdup2_1(unsigned int,unsigned int,unsigned int *);
930: void up2_init_eg(void);
931: void up2_show_eg(void);
932: void invup2(UP2,UP2,UP2 *);
933: void gcdup2(UP2,UP2,UP2 *);
934: void chsgnup2(UP2,UP2 *);
935: void pwrmodup2(UP2,Q,UP2,UP2 *);
936: void pwrmodup2_sparse(UP2,Q,UP2,UP2 *);
937: int compup2(UP2,UP2);
938: void printup2(UP2);
939: void _copyup2(UP2,UP2);
940: void _bshiftup2(UP2,int,UP2);
941: void _bshiftup2_destructive(UP2,int);
942: void diffup2(UP2,UP2 *);
943: int sqfrcheckup2(UP2);
944: int irredcheckup2(UP2);
945: int irredcheck_dddup2(UP2);
946: void _copy_up2bits(UP2,unsigned int **,int);
947: void _print_frobmat(unsigned int **,int,int);
948: int compute_multiplication_matrix(P,GF2MAT *);
949: void compute_change_of_basis_matrix(P,P,int,GF2MAT *,GF2MAT *);
950: int compute_representation_conversion_matrix(P,GF2MAT *,GF2MAT *);
951: void mul_nb(GF2MAT,unsigned int *,unsigned int *,unsigned int *);
952: void leftshift(unsigned int *,int);
953: void mat_to_gf2mat(MAT,unsigned int ***);
954: void gf2mat_to_mat(unsigned int **,int,MAT *);
955: void mulgf2mat(int,unsigned int **,unsigned int **,unsigned int **);
956: void mulgf2vectmat(int,unsigned int *,unsigned int **,unsigned int *);
957: int mulgf2vectvect(int,unsigned int *,unsigned int *);
958: int invgf2mat(int,unsigned int **,unsigned int **);
959: void _mulup2_11(unsigned int,unsigned int,unsigned int *);
960: void _mulup2_22(unsigned int *,unsigned int *,unsigned int *);
961: void _mulup2_33(unsigned int *,unsigned int *,unsigned int *);
962: void _mulup2_44(unsigned int *,unsigned int *,unsigned int *);
963: void _mulup2_55(unsigned int *,unsigned int *,unsigned int *);
964: void _mulup2_66(unsigned int *,unsigned int *,unsigned int *);
965: void printup2_(unsigned int *,int);
966: void type1_bin_invup2(UP2,int,UP2 *);
967: int int_bits(int);
968:
969:
970: LUM LUMALLOC(int, int);
971: Obj ToAlg(Num);
972: UM *berlemain(register int, UM, UM *);
973: void *Risa_GC_malloc(size_t);
974: void *Risa_GC_malloc_atomic(size_t);
975: void *Risa_GC_realloc(void *,size_t);
976: void *GC_malloc(size_t);
977: void *GC_malloc_atomic(size_t);
978: void *GC_realloc(void *,size_t);
979: double NatToReal(N,int *);
980: double RatnToReal(Q);
981: double pwrreal0(double,int);
1.3 ! noro 982: double rtodbl(); /* XXX */
1.1 noro 983: int **almat(int,int);
984: pointer **almat_pointer(int,int);
985: int berlecnt(register int,UM);
986: int berlecntmain(register int,int,int,register int **);
987: int cmpalg(Num,Num);
988: int cmpbf(Num,Num);
989: int cmpcplx(Num,Num);
990: int cmpn(N,N);
991: int cmpq(Q,Q);
992: int cmpreal(Real,Real);
993: int cmpmi(MQ,MQ);
994: int cmplm(LM,LM);
995: int compmat(VL,MAT,MAT);
996: int compnum(VL,Num,Num);
997: int compp(VL,P,P);
998: int compr(VL,Obj,Obj);
999: int compstr(VL,STRING,STRING);
1000: int compvect(VL,VECT,VECT);
1001: int ctest(P,ML,int,int *);
1002: int cycchk(P);
1003: int dbound(V,P);
1004: int dcomp(P,P);
1005: int deg(V,P);
1006: int degtest(int,int *,ML,int);
1007: int divcheck(VL,P *,int,P,P);
1008: unsigned int divin(N,unsigned int,N *);
1009: int divtdcpz(VL,P,P,P *);
1010: int divtpz(VL,P,P,P *);
1011: int divum(register int,UM,UM,UM);
1012: int dm(int,int,int *);
1013: int dmb(int,int,int,int *);
1014: int dma(int,int,int,int *);
1015: int dmab(int,int,int,int,int *);
1016: int dmar(int,int,int,int);
1017: int dtestmain(P,Q,ML,int,int *,P *,P *);
1018: int geldb(VL,P);
1019: int getchomdeg(V,P);
1020: int getdeg(V,P);
1021: int getlchomdeg(V,P,int *);
1022: int homdeg(P);
1023: unsigned int invm(unsigned int,int);
1024: int iscycm(P);
1025: int iscycp(P);
1026: int lengthp(P);
1027: int mig(int,int,P);
1028: int mignotte(int,P);
1029: int minimain(register int,int,int,register int **);
1030: int ncombi(int,int,int,int *);
1031: int nextbin(VN,int);
1032: int nmonop(P);
1033: int pcoef(VL,VL,P,P *);
1034: int pcoef0(VL,VL,P,P *);
1035: unsigned int pwrm(register int,register int,int);
1036: unsigned int rem(N,unsigned int);
1037: int sqfrchk(P);
1038: int subn(N,N,N *);
1039: int ucmpp(P,P);
1040: int valideval(VL,DCP,VN);
1041: int zerovpchk(VL,P,VN);
1042:
1043: void addgf2n(GF2N,GF2N,GF2N *);
1044: void subgf2n(GF2N,GF2N,GF2N *);
1045: void mulgf2n(GF2N,GF2N,GF2N *);
1046: void divgf2n(GF2N,GF2N,GF2N *);
1047: void chsgngf2n(GF2N,GF2N *);
1048: void pwrgf2n(GF2N,Q, GF2N *);
1049: int cmpgf2n(GF2N,GF2N);
1050:
1051: void addgfpn(GFPN,GFPN,GFPN *);
1052: void subgfpn(GFPN,GFPN,GFPN *);
1053: void mulgfpn(GFPN,GFPN,GFPN *);
1054: void divgfpn(GFPN,GFPN,GFPN *);
1055: void chsgngfpn(GFPN,GFPN *);
1056: void pwrgfpn(GFPN,Q, GFPN *);
1057: int cmpgfpn(GFPN,GFPN);
1058:
1059: void addalg(Num,Num,Num *);
1060: void addbf(Num,Num,Num *);
1061: void addcplx(Num,Num,Num *);
1062: void addm2p(VL,Q,Q,P,P,P *);
1063: void addm2q(Q,Q,Q,Q,Q *);
1064: void addmat(VL,MAT,MAT,MAT *);
1065: void addmp(VL,int,P,P,P *);
1066: void addmpq(int,P,P,P *);
1067: void addmptoc(VL,int,P,P,P *);
1068: void addmq(int,MQ,MQ,MQ *);
1069: void addn(N,N,N *);
1070: void addnum(VL,Num,Num,Num *);
1071: void addp(VL,P,P,P *);
1072: void addpadic(int,int,unsigned int *,unsigned int *);
1073: void addpq(P,P,P *);
1074: void addptoc(VL,P,P,P *);
1075: void addq(Q,Q,Q *);
1076: void addr(VL,Obj,Obj,Obj *);
1077: void addreal(Num,Num,Real *);
1078: void addmi(MQ,MQ,MQ *);
1079: void addlm(LM,LM,LM *);
1080: void addstr(VL,STRING,STRING,STRING *);
1081: void addum(int,UM,UM,UM);
1082: void addvect(VL,VECT,VECT,VECT *);
1083: void adjc(VL,P,P,P,Q,P *,P *);
1084: void afctr(VL,P,P,DCP *);
1085: void afctrmain(VL,P,P,int,DCP *);
1086: void affine(VL,P,VN,P *);
1087: void affinemain(VL,P,V,int,P *,P *);
1088: void berle(int,int,P,ML *);
1089: void bnton(register int,N,N *);
1090: void cbound(VL,P,Q *);
1091: void chnrem(int,V,P,Q,UM,P *,Q *);
1092: void chnremp(VL,int,P,Q,P,P *);
1093: void chsgnalg(Num,Num *);
1094: void chsgnbf(Num a,Num *);
1095: void chsgncplx(Num,Num *);
1096: void chsgnmat(MAT,MAT *);
1097: void chsgnmp(int,P,P *);
1098: void chsgnnum(Num,Num *);
1099: void chsgnp(P,P *);
1100: void chsgnq(Q,Q *);
1101: void chsgnr(Obj,Obj *);
1102: void chsgnreal(Num,Num *);
1103: void chsgnmi(MQ,MQ *);
1104: void chsgnlm(LM,LM *);
1105: void chsgnvect(VECT,VECT *);
1106: void clctv(VL,P,VL *);
1107: void clctvr(VL,Obj,VL *);
1108: void cm2p(Q,Q,P,P *);
1109: void cmax(P,Q *);
1110: void cmp(Q,P,P *);
1111: void coefp(P,int,P *);
1112: void cpylum(int,LUM,LUM);
1113: void cpyum(UM,UM);
1114: void csump(VL,P,Q *);
1115: void cycm(V,register int,DCP *);
1116: void cycp(V,register int,DCP *);
1117: void degp(V,P,Q *);
1118: void degum(UM,int);
1119: void detmp(VL,int,P **,int,P *);
1120: void detp(VL,P **,int,P *);
1121: void diffp(VL,P,V,P *);
1122: void diffum(register int,UM,UM);
1123: void divalg(Num,Num,Num *);
1124: void divbf(Num,Num,Num *);
1125: void divcp(P,Q,P *);
1126: void divcplx(Num,Num,Num *);
1127: void divmat(VL,Obj,Obj,Obj *);
1128: void divmq(int,MQ,MQ,MQ *);
1129: void divn(N,N,N *,N *);
1130: void divnmain(int,int,unsigned int *,unsigned int *,unsigned int *);
1131: void divnum(VL,Num,Num,Num *);
1132: void divq(Q,Q,Q *);
1133: void divr(VL,Obj,Obj,Obj *);
1134: void divreal(Num,Num,Real *);
1135: void divmi(MQ,MQ,MQ *);
1136: void divlm(LM,LM,LM *);
1137: void divsdcmp(VL,int,P,P,P *);
1138: void divsdcp(VL,P,P,P *);
1139: void divsmp(VL,int,P,P,P *);
1140: void divsn(N,N,N *);
1141: void divsp(VL,P,P,P *);
1142: void divsrdcmp(VL,int,P,P,P *,P *);
1143: void divsrdcp(VL,P,P,P *,P *);
1144: void divsrmp(VL,int,P,P,P *,P *);
1145: void divsrp(VL,P,P,P *,P *);
1146: void divvect(VL,Obj,Obj,Obj *);
1147: void dtest(P,ML,int,DCP *);
1148: void dtestroot(int,int,P,LUM,struct oDUM *,DCP *);
1149: void dtestroot1(int,int,P,LUM,P *);
1150: void dtestsq(int,int,P,LUM,P *);
1151: void dtestsql(P,ML,struct oDUM *,DCP *);
1152: void estimatelc(VL,Q,DCP,VN,P *);
1153: void eucum(register int,UM,UM,UM,UM);
1154: void exthp(VL,P,int,P *);
1155: void exthpc(VL,V,P,int,P *);
1156: void ezgcd1p(VL,P,P,P *);
1157: void ezgcdhensel(P,int,UM,UM,ML *);
1158: void ezgcdnp(VL,P,P *,int,P *);
1159: void ezgcdnpp(VL,DCP,P *,int,P *);
1160: void ezgcdnpz(VL,P *,int,P *);
1161: void ezgcdp(VL,P,P,P *);
1162: void ezgcdpp(VL,DCP,P,P *);
1163: void ezgcdpz(VL,P,P,P *);
1164: void factorial(int,Q *);
1165: void fctrp(VL,P,DCP *);
1166: void fctrwithmvp(VL,P,V,DCP *);
1167: void gcda(VL,P,P,P,P *);
1168: void gcdcp(VL,P,P *);
1169: void gcdgen(P,ML,ML *);
1170: void gcdmonomial(VL,DCP *,int,P *);
1171: void gcdn(N,N,N *);
1172: void gcdprsp(VL,P,P,P *);
1173: void gcdum(register int,UM,UM,UM);
1174: void getmindeg(V,P,Q *);
1175: void henmain(LUM,ML,ML,ML *);
1176: void henmv(VL,VN,P,P,P,P,P,P,P,P,P,Q,int,P *,P *);
1177: void henmvmain(VL,VN,P,P,P,P,P,P,P,Q,Q,int,P *,P *);
1178: void henprep(P,ML,ML,ML *,ML *);
1179: void hensel(int,int,P,ML *);
1180: void henzq(P,P,UM,P,UM,int,int,P *,P *,P *,P *,Q *);
1181: void henzq1(P,P,Q,P *,P *,Q *);
1182: void hsq(int,int,P,int *,DCP *);
1183: void intersectv(VL,VL,VL *);
1184: void invl(Q,Q,Q *);
1185: void invmq(int,MQ,MQ *);
1186: void invq(Q,Q *);
1187: void lgp(P,N *,N *);
1188: void lumtop(V,int,int,LUM,P *);
1189: void markv(VN,int,P);
1190: void maxdegp(VL,P,VL *,P *);
1191: void mergev(VL,VL,VL,VL *);
1192: void mfctr(VL,P,DCP *);
1193: void mfctrhen2(VL,VN,P,P,P,P,P,P,P *);
1194: void mfctrmain(VL,P,DCP *);
1195: void mfctrwithmv(VL,P,V,DCP *);
1196: void min_common_vars_in_coefp(VL,P,VL *,P *);
1197: void minchdegp(VL,P,VL *,P *);
1198: void mindegp(VL,P,VL *,P *);
1199: void mini(register int,UM,UM);
1200: void minlcdegp(VL,P,VL *,P *);
1201: void mkbc(int,Q *);
1202: void mkbcm(int,int,MQ *);
1203: void mkssum(V,int,int,int,P *);
1204: void monomialfctr(VL,P,P *,DCP *);
1205: void mptop(P,P *);
1206: void mptoum(P,UM);
1207: void msqfr(VL,P,DCP *);
1208: void msqfrmain(VL,P,DCP *);
1209: void msqfrmainmain(VL,P,VN,P,DCP,DCP *,P *);
1210: void mulalg(Num,Num,Num *);
1211: void mulbf(Num,Num,Num *);
1212: void mulcplx(Num,Num,Num *);
1213: void mulin(N,unsigned int,unsigned int *);
1214: void mullum(int,int,LUM,LUM,LUM);
1215: void mullumarray(P,ML,int,int *,P *);
1216: void mulm2p(VL,Q,Q,P,P,P *);
1217: void mulm2q(Q,Q,Q,Q,Q *);
1218: void mulmat(VL,Obj,Obj,Obj *);
1219: void mulmatmat(VL,MAT,MAT,MAT *);
1220: void mulmatvect(VL,MAT,VECT,VECT *);
1221: void mulmp(VL,int,P,P,P *);
1222: void mulmpc(VL,int,P,P,P *);
1223: void mulmpq(int,P,P,P *);
1224: void mulmq(int,MQ,MQ,MQ *);
1225: void muln(N,N,N *);
1226: void mulnum(VL,Num,Num,Num *);
1227: void mulp(VL,P,P,P *);
1228: void mulpadic(int,int,unsigned int *,unsigned int *,unsigned int *);
1229: void mulpc(VL,P,P,P *);
1230: void mulpq(P,P,P *);
1231: void mulq(Q,Q,Q *);
1232: void mulr(VL,Obj,Obj,Obj *);
1233: void mulreal(Num,Num,Real *);
1234: void mulmi(MQ,MQ,MQ *);
1235: void mullm(LM,LM,LM *);
1236: void mulrmat(VL,Obj,MAT,MAT *);
1237: void mulrvect(VL,Obj,VECT,VECT *);
1238: void mulsgn(VN,VN,int,VN);
1239: void mulsum(register int,UM,register int,UM);
1240: void mulum(register int,UM,UM,UM);
1241: void mulvect(VL,Obj,Obj,Obj *);
1242: void mulvectmat(VL,VECT,MAT,VECT *);
1243: void next(VN);
1244: void nezgcdnp_sqfr_primitive(VL,P,P *,int,P *);
1245: void nezgcdnpp(VL,DCP,P *,int,P *);
1246: void nezgcdnpz(VL,P *,int,P *);
1247: void nezgcdnpzmain(VL,P *,int,P *);
1248: void nglob_init(void);
1249: void norm(P,Q *);
1250: void norm1(P,P *);
1251: void norm1c(P,Q *);
1252: void normalizemp(int,P);
1253: void nthrootchk(P,struct oDUM *,ML,DCP *);
1254: void nthrootn(N,int,N *);
1255: void ntobn(register int,N,N *);
1256: void nuezgcdnpzmain(VL,P *,int,P *);
1257: void padictoq(int,int,int *,Q *);
1258: void risa_pari_init(void);
1259: void pcp(VL,P,P *,P *);
1260: void pderivr(VL,Obj,V,Obj *);
1261: void pdiva(VL,P,P,P,P *);
1262: void pinva(P,P,P *);
1263: void plisttop(P *,V,int,P *);
1264: void pmonic(VL,P,P,P *);
1265: void pqra(VL,P,P,P,P *,P *);
1266: void premmp(VL,int,P,P,P *);
1267: void premp(VL,P,P,P *);
1268: void ptolum(int,int,P,LUM);
1269: void ptomp(int,P,P *);
1270: void ptoum(int,P,UM);
1271: void ptozp(P,int,Q *,P *);
1272: void ptozp0(P,P *);
1273: void pwralg(Num,Num,Num *);
1274: void pwrbf(Num,Num,Num *);
1275: void pwrcplx(Num,Num,Num *);
1276: void pwrcplx0(Num,int,Num *);
1277: void pwrlum(int,int,LUM,int,LUM);
1278: void pwrmat(VL,MAT,Obj,MAT *);
1279: void pwrmatmain(VL,MAT,int,MAT *);
1280: void pwrmp(VL,int,P,Q,P *);
1281: void pwrmq(int,MQ,Q,MQ *);
1282: void pwrn(N,int,N *);
1283: void pwrnum(VL,Num,Num,Num *);
1284: void pwrp(VL,P,Q,P *);
1285: void pwrq(Q,Q,Q *);
1286: void pwrr(VL,Obj,Obj,Obj *);
1287: void pwrreal(Num,Num,Real *);
1288: void pwrmi(MQ,Q,MQ *);
1289: void pwrlm(LM,Q,LM *);
1290: void pwrum(int,UM,int,UM);
1291: void reallocarray(char **,int *,int *,int);
1292: void reductr(VL,Obj,Obj *);
1293: void reimtocplx(Num,Num,Num *);
1294: void rem2q(Q,Q,Q,Q *);
1295: void rema(VL,P,P,P,P *);
1296: void remq(Q,Q,Q *);
1297: void remsdcp(VL,P,P,P *);
1298: void reordermp(VL,int,VL,P,P *);
1299: void reorderp(VL,VL,P,P *);
1300: void reordvar(VL,V,VL *);
1301: void res_ch_det(VL,V,P,P,P *);
1302: void res_detmp(VL,int,V,P,P,P *);
1303: void restore(VL,P,VN,P *);
1304: void resultmp(VL,int,V,P,P,P *);
1305: void resultp(VL,V,P,P,P *);
1306: void setlum(int,int,LUM);
1307: void sort_by_deg(int,P *,P *);
1308: void sort_by_deg_rev(int,P *,P *);
1309: void sortfs(DCP *);
1310: void sortfsrev(DCP *);
1311: void sortplist(P *,int);
1312: void sortplistbyhomdeg(P *,int);
1313: void sprs(VL,V,P,P,P *);
1314: void sqa(VL,P,P,DCP *);
1315: void sqad(unsigned int,int);
1316: void sqfrp(VL,P,DCP *);
1317: void sqfrum(int,int,P,int *,struct oDUM **,ML *);
1318: void sqfrummain(int,UM,UM,struct oDUM **);
1319: void sqrtn(N,N *);
1320: void srch2(VL,V,P,P,P *);
1321: void srchmp(VL,int,V,P,P,P *);
1322: void srchump(int,P,P,P *);
1323: void srcr(VL,V,P,P,P *);
1324: void strtobf(char *,BF *);
1325: void subalg(Num,Num,Num *);
1326: void subbf(Num,Num,Num *);
1327: void subcplx(Num,Num,Num *);
1328: void subm2p(VL,Q,Q,P,P,P *);
1329: void subm2q(Q,Q,Q,Q,Q *);
1330: void submat(VL,MAT,MAT,MAT *);
1331: void submp(VL,int,P,P,P *);
1332: void submq(int,MQ,MQ,MQ *);
1333: void subnum(VL,Num,Num,Num *);
1334: void subp(VL,P,P,P *);
1335: void subq(Q,Q,Q *);
1336: void subr(VL,Obj,Obj,Obj *);
1337: void subreal(Num,Num,Real *);
1338: void submi(MQ,MQ,MQ *);
1339: void sublm(LM,LM,LM *);
1340: void substmp(VL,int,P,V,P,P *);
1341: void substp(VL,P,V,P,P *);
1342: void substvp(VL,P,VN,P *);
1343: void subum(int,UM,UM,UM);
1344: void subvect(VL,VECT,VECT,VECT *);
1345: void toreim(Num,Num *,Num *);
1346: void ucsump(P,Q *);
1347: void udivpwm(Q,P,P,P *,P *);
1348: void udivpz(P,P,P *,P *);
1349: void udivpzwm(Q,P,P,P *,P *);
1350: void uexgcdnp(VL,P,P *,int,VN,Q,P *,P *,P *,P *,Q *);
1351: void uezgcd1p(P,P,P *);
1352: void uezgcdpp(DCP,P,P *);
1353: void uezgcdpz(VL,P,P,P *);
1354: void ufctr(P,int,DCP *);
1355: void ufctrmain(P,int,DCP *);
1356: void umtomp(V,UM,P *);
1357: void umtop(V,UM,P *);
1358: void usqp(P,DCP *);
1359: void vntovl(VN,int,VL *);
1360:
1361: #if 0 && !defined(VISUAL)
1362: void bzero(const void *,int);
1363: void bcopy(const void *,void *,int);
1364: char *index(char *,int);
1365: #endif
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>