Annotation of OpenXM_contrib2/asir2000/include/ca.h, Revision 1.2
1.2 ! noro 1: /* $OpenXM: OpenXM_contrib2/asir2000/include/ca.h,v 1.1.1.1 1999/12/03 07:39:11 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:
568: #define ToReal(a) (!(a)?(double)0.0:REAL(a)?BDY((Real)a):RATN(a)?RatnToReal((Q)a):0)
569:
570: /* predicates */
571: #define NUM(p) (OID(p)==O_N)
572: #define RAT(p) (OID(p)==O_R)
573: #define INT(q) (!DN((Q)q))
574: #define RATN(a) (NID(a)==N_Q)
575: #define REAL(a) (NID(a)==N_R)
576: #define SFF(a) (NID(a)==N_M)
577: #define UNIQ(q) ((q)&&NUM(q)&&RATN(q)&&(SGN((Q)q)==1)&&UNIN(NM((Q)q))&&(!DN((Q)q)))
578: #define UNIMQ(q) ((q)&&NUM(q)&&SFF(q)&&(CONT((MQ)q)==1))
579: #define MUNIQ(q) ((q)&&NUM(q)&&RATN(q)&&(SGN((Q)q)==-1)&&UNIN(NM((Q)q))&&(!DN((Q)q)))
580: #define MUNIMQ(q) ((q)&&NUM(q)&&SFF(q)&&(CONT((MQ)q)==-1))
581: #define UNIN(n) ((n)&&(PL(n)==1)&&(BD(n)[0]==1))
582: #define EVENN(n) ((!(n))||(!(BD(n)[0]%2)))
583:
584:
585: /* externals */
586: #if 0
587: double NatToReal();
588: double RatnToReal();
589: #endif
590:
591: extern struct oR oUNIR;
592: extern struct oQ oUNIQ;
593: extern struct oMQ oUNIMQ;
594: extern struct oN oUNIN;
595: extern struct oUP2 oONEUP2;
596: extern struct oV oVAR[];
597: extern struct oV oPVAR[];
598: extern struct oVL oVLIST[];
599: extern struct oVL oPVLIST[];
600: extern VL CO,ALG;
601: extern VL PVL;
602: extern R ONER;
603: extern Q ONE;
604: extern MQ ONEM;
605: extern LM ONELM;
606: extern N ONEN;
607: extern UP2 ONEUP2;
608:
609: extern FILE *asir_out;
610: #if defined(__GNUC__) || defined(THINK_C)
611: extern const int sprime[];
612: extern const int lprime[];
613: #else
614: extern int sprime[];
615: extern int lprime[];
616: #endif
617:
618: extern void (*addnumt[])();
619: extern void (*subnumt[])();
620: extern void (*mulnumt[])();
621: extern void (*divnumt[])();
622: extern void (*pwrnumt[])();
623: extern int (*cmpnumt[])();
624: extern void (*chsgnnumt[])();
625:
626: /* prototypes */
627: int compui(VL,USINT,USINT);
628:
629: void powermodup(UP,UP *);
630: void hybrid_powermodup(UP,UP *);
631:
632: void powertabup(UP,UP,UP *);
633: void hybrid_powertabup(UP,UP,UP *);
634:
635: void generic_powermodup(UP,UP,Q,UP *);
636: void hybrid_generic_powermodup(UP,UP,Q,UP *);
637:
638: void powermod1up(UP,UP *);
639: void hybrid_rembymulup_special(int,UP,UP,UP,UP *);
640: void hybrid_tmulup(int,UP,UP,int,UP *);
641: void hybrid_squareup(int,UP,UP *);
642: void hybrid_mulup(int,UP,UP,UP *);
643:
644: void getmod_lm(N *);
645:
646: int maxblenup(UP);
647: void monicup(UP,UP *);
648: void simpup(UP,UP *);
649: void simpnum(Num,Num *);
650: void decompp(P,Q,P *,P *);
651: void truncp(P,Q,P *);
652: void uremp(P,P,P *);
653: void ugcdp(P,P,P *);
654: void reversep(P,Q,P *);
655: void invmodp(P,Q,P *);
656: void addup(UP,UP,UP *);
657: void subup(UP,UP,UP *);
658: void chsgnup(UP,UP *);
659: void mulup(UP,UP,UP *);
660: void tmulup(UP,UP,int,UP *);
661: void squareup(UP,UP *);
662: void remup(UP,UP,UP *);
663: void remup_destructive(UP,UP);
664: void qrup(UP,UP,UP *,UP *);
665: void qrup_destructive(UP,UP);
666: void gcdup(UP,UP,UP *);
667: void reverseup(UP,int,UP *);
668: void invmodup(UP,int,UP *);
669: void pwrup(UP,Q,UP *);
670: void squarep_gf2n(VL,P,P *);
671: void kmulp(VL,P,P,P *);
672: void ksquarep(VL,P,P *);
673: void kmulup(UP,UP,UP *);
674: void ksquareup(UP,UP *);
675: void extractup(UP,int,int,UP *);
676: void copyup(UP,UP);
677: void c_copyup(UP,int,pointer *);
678: void kmulupmain(UP,UP,UP *);
679: void ksquareupmain(UP,UP *);
680: void rembymulup(UP,UP,UP *);
681: void rembymulup_special(UP,UP,UP,UP *);
682: void tkmulup(UP,UP,int,UP *);
683: void shiftup(UP,int,UP *);
684: void set_degreeup(UP,int);
685: void decompup(UP,int,UP *,UP *);
686: void truncup(UP,int,UP *);
687: void uptofmarray(int,UP,ModNum *);
688: void fmarraytoup(ModNum *,int,UP *);
689: void uiarraytoup(unsigned int **,int,int,UP *);
690: void adj_coefup(UP,N,N,UP *);
691: void uptolmup(UP,UP *);
692: void remcup(UP,N,UP *);
693: void fft_mulup(UP,UP,UP *);
694: void fft_squareup(UP,UP *);
695: void trunc_fft_mulup(UP,UP,int,UP *);
696: void shoup_fft_mulup(UP,UP,UP *);
697: void shoup_fft_squareup(UP,UP *);
698: void shoup_trunc_fft_mulup(UP,UP,int,UP *);
699: void crup(ModNum **,int,int *,int,N,UP *);
700: void shoup_crup(ModNum **,int,int *,int,N,N,UP *);
701: void squareup_gf2n(UP,UP *);
702: void powermodup_gf2n(UP,UP *);
703: void generic_powermodup_gf2n(UP,UP,Q,UP *);
704: void tracemodup_gf2n(UP,UP,Q,UP *);
705: void tracemodup_gf2n_slow(UP,UP,Q,UP *);
706: void tracemodup_gf2n_tab(UP,UP,Q,UP *);
707: void square_rem_tab_up_gf2n(UP,UP *,UP *);
708: void powertabup_gf2n(UP,UP,UP *);
709: void find_root_gf2n(UP,GF2N *);
710:
711: int cmpdl_matrix(int,DL,DL);
712: int cmpdl_order_pair(int,DL,DL);
713: int cmpdl_elim(int,DL,DL);
714: int cmpdl_blexrev(int,DL,DL);
715: int cmpdl_bgradrev(int,DL,DL);
716: int cmpdl_brevrev(int,DL,DL);
717: int cmpdl_brevgradlex(int,DL,DL);
718: int cmpdl_bgradlex(int,DL,DL);
719: int cmpdl_blex(int,DL,DL);
720: int cmpdl_revgradlex(int,DL,DL);
721: int cmpdl_gradlex(int,DL,DL);
722: int cmpdl_revlex(int,DL,DL);
723: int cmpdl_lex(int,DL,DL);
724: int compd(VL,DP,DP);
725: void adddl(int,DL,DL,DL *);
726: void divsdc(VL,DP,P,DP *);
727: void muldc(VL,DP,P,DP *);
728: void muldm(VL,DP,MP,DP *);
729: void muld(VL,DP,DP,DP *);
730: void chsgnd(DP,DP *);
731: void subd(VL,DP,DP,DP *);
732: void addd(VL,DP,DP,DP *);
733: int sugard(MP);
734: void nodetod(NODE,DP *);
735: void dtop(VL,VL,DP,P *);
736: void ptod(VL,VL,P,DP *);
737: void initd(struct order_spec *);
738:
739: void _printdp(DP);
740: void _dp_sp_mod(DP,DP,int,DP *);
741: void _dp_mod(DP,int,NODE,DP *);
742: void _dp_red_mod(DP,DP,int,DP *);
743: void _dtop_mod(VL,VL,DP,P *);
744: void _mulmdm(VL,int,DP,MP,DP *);
745: void _mulmd(VL,int,DP,DP,DP *);
746: void _chsgnmd(int,DP,DP *);
747: void _submd(VL,int,DP,DP,DP *);
748: void _addmd(VL,int,DP,DP,DP *);
749: void _mdtop(VL,int,VL,DP,P *);
750: void divsmdc(VL,int,DP,P,DP *);
751: void mulmdc(VL,int,DP,P,DP *);
752: void mulmdm(VL,int,DP,MP,DP *);
753: void mulmd(VL,int,DP,DP,DP *);
754: void chsgnmd(int,DP,DP *);
755: void submd(VL,int,DP,DP,DP *);
756: void addmd(VL,int,DP,DP,DP *);
757: void mdtop(VL,int,VL,DP,P *);
758: void mptomd(VL,int,VL,P,DP *);
759: void ptomd(VL,int,VL,P,DP *);
760: int p_mag(P);
761: int n_bits(N);
762: void gcdBinary_27n(N,N,N *);
763: void rtime_init(void);
764: void setmod_gf2n(P);
765: void mt_sgenrand(unsigned long);
766: unsigned long mt_genrand(void);
767: #if defined(VISUAL)
768: void srandom(unsigned int);
769: unsigned int random(void);
770: #endif
771: void gcdbmodn(N,N,N *);
772: void gcdbinn(N,N,N *);
773: void gcdmodn(N,N,N *);
774: void gcdaccn(N,N,N *);
775: void gcdEuclidn(N,N,N *);
776: void GC_free(void *);
777: void FFT_primes(int,int *,int *,int *);
778: int FFT_pol_product(unsigned int,unsigned int *, unsigned int,unsigned int *,
779: unsigned int *,int,unsigned int *);
780: int FFT_pol_square(unsigned int,unsigned int *,
781: unsigned int *,int,unsigned int *);
782: void dcptolist(DCP,LIST *);
783: void gcdprsmp(VL,int,P,P,P *);
784: void mult_mod_tab(UM,int,UM *,UM,int);
785: int nfctr_mod(UM,int);
786: int irred_check(UM,int);
787: void modfctrp(P,int,int,DCP *);
788: void pf_init(void);
789: void binaryton(char *,N *);
790: void hexton(char *,N *);
791: void ptolmp(P,P *);
792: void lmptop(P,P *);
793: void ulmptoum(int,UP,UM);
794: void objtobobj(int,Obj,Obj *);
795: void bobjtoobj(int,Obj,Obj *);
796: void numtobnum(int,Num,Num *);
797: void bnumtonum(int,Num,Num *);
798: void ptobp(int,P,P *);
799: void bptop(int,P,P *);
800: void listtoblist(int,LIST,LIST *);
801: void blisttolist(int,LIST,LIST *);
802: void vecttobvect(int,VECT,VECT *);
803: void bvecttovect(int,VECT,VECT *);
804: void mattobmat(int,MAT,MAT *);
805: void bmattomat(int,MAT,MAT *);
806: void n32ton27(N,N *);
807: void n27ton32(N,N *);
808: void kmulum(int,UM,UM,UM);
809: void saveobj(FILE *,Obj);
810: void endian_init(void);
811: void write_char(FILE *,unsigned char *);
812: void write_short(FILE *,unsigned short *);
813: void write_int(FILE *,unsigned int *);
814: void write_double(FILE *,double *);
815: void write_intarray(FILE *,unsigned int *,int);
816: void write_string(FILE *,unsigned char *,int);
817: void savestr(FILE *,char *);
818: void loadstr(FILE *,char **);
819: void savevl(FILE *,VL);
820: void loadvl(FILE *);
821: void skipvl(FILE *);
822: void savev(FILE *,V);
823: void loadv(FILE *,V *);
824: int save_convv(V);
825: V load_convv(int);
826: void swap_bytes(char *,int,int);
827: void read_char(FILE *,unsigned char *);
828: void read_short(FILE *,unsigned short *);
829: void read_int(FILE *,unsigned int *);
830: void read_double(FILE *,double *);
831: void read_intarray(FILE *,unsigned int *,int);
832: void read_string(FILE *,unsigned char *,int);
833: void loadobj(FILE *,Obj *);
834: void invum(int,UM,UM,UM);
835: void addarray_to(unsigned int *,int,unsigned int *,int);
836: void muln_1(unsigned int *,int,unsigned int,unsigned int *);
837: unsigned int divn_1(unsigned int *,int,unsigned int,unsigned int *);
838: void ptoup(P,UP *);
839: void uptop(UP,P *);
840: void printnum(Num);
841: void printv(VL,V);
842: void kmulq(Q,Q,Q *);
843: void bshiftn(N,int,N *);
844: void remn(N,N,N*);
845: void simplm(LM,LM *);
846: void qtolm(Q,LM *);
847: int qpcheck(Obj);
848: int headsgn(P);
849: void adjsgn(P,DCP);
850: void setmod_g2n(P);
851: void simpgf2n(GF2N,GF2N *);
852: void ptogf2n(Obj,GF2N *);
853: void gf2ntop(GF2N,P *);
854: void gf2ntovect(GF2N,VECT *);
855: void squaregf2n(GF2N,GF2N *);
856: void randomgf2n(GF2N *);
857: void invgf2n(GF2N,GF2N *);
858: void kmuln(N,N,N *);
859: void extractn(N,int,int,N *);
860: void copyn(N,int,int *);
861: void kmulnmain(N,N,N *);
862: int qcoefp(Obj);
863: int qcoefr(Obj);
864: int get_allocwords(void);
865: double get_clock(void);
866: void get_eg(struct oEGT *);
867: void printtime(struct oEGT *,struct oEGT *,double);
868: void init_eg(struct oEGT *);
869: void add_eg(struct oEGT *,struct oEGT *,struct oEGT *);
870: void print_eg(char *,struct oEGT *);
871: void print_split_eg(struct oEGT *,struct oEGT *);
872: void print_split_e(struct oEGT *,struct oEGT *);
873: void suspend_timer(void);
874: void resume_timer(void);
875: void reset_engine(void);
876: void notdef(VL,Obj,Obj,Obj *);
877: void error(char *);
878: void ptoup2(P,UP2 *);
879: void ptoup2_sparse(P,UP2 *);
880: void up2top(UP2,P *);
881: void up2tovect(UP2,VECT *);
882: void up2ton(UP2,Q *);
883: void ntoup2(Q,UP2 *);
884: void gen_simpup2(UP2,GEN_UP2,UP2 *);
885: void gen_simpup2_destructive(UP2,GEN_UP2);
886: void gen_invup2(UP2,GEN_UP2,UP2 *);
887: void gen_pwrmodup2(UP2,Q,GEN_UP2,UP2 *);
888: void simpup2(UP2,UP2,UP2 *);
889: int degup2(UP2);
890: int degup2_sparse(UP2);
891: int degup2_1(unsigned int);
892: void addup2(UP2,UP2,UP2 *);
893: void subup2(UP2,UP2,UP2 *);
894: void mulup2_n1(unsigned int *,int,unsigned int,unsigned int *);
895: void mulup2_nh(unsigned int *,int,unsigned int,unsigned int *);
896: void _mulup2_1(UP2,unsigned int,UP2);
897: void _mulup2_h(UP2,unsigned int,UP2);
898: void mulup2(UP2,UP2,UP2 *);
899: void _kmulup2_(unsigned int *,unsigned int *,int,unsigned int *);
900: void _mulup2_nn(unsigned int *,unsigned int *,int,unsigned int *);
901: void _mulup2(UP2,UP2,UP2);
902: void _mulup2_(_UP2,_UP2,_UP2);
903: void squareup2(UP2,UP2 *);
904: void _adjup2(UP2);
905: void _adjup2_(_UP2);
906: void _addup2(UP2,UP2,UP2);
907: void _addup2_destructive(UP2,UP2);
908: void _addup2_(_UP2,_UP2,_UP2);
909: void _addtoup2_(_UP2,_UP2);
910: unsigned int mulup2_bb(unsigned int,unsigned int);
911: void init_up2_tab(void);
912: unsigned int quoup2_11(unsigned int,unsigned int);
913: void divup2_1(unsigned int,unsigned int,int,int,unsigned int *,unsigned int *);
914: void qrup2(UP2,UP2,UP2 *,UP2 *);
915: void _qrup2(UP2,UP2,UP2,UP2);
916: void remup2(UP2,UP2,UP2 *);
917: void _remup2(UP2,UP2,UP2);
918: void remup2_sparse(UP2,UP2,UP2 *);
919: void remup2_sparse_destructive(UP2,UP2);
920: void remup2_type1_destructive(UP2,int);
921: void remup2_3_destructive(UP2,UP2);
922: void remup2_5_destructive(UP2,UP2);
923: void _invup2_1(unsigned int,unsigned int,unsigned int *,unsigned int *);
924: void _gcdup2_1(unsigned int,unsigned int,unsigned int *);
925: void up2_init_eg(void);
926: void up2_show_eg(void);
927: void invup2(UP2,UP2,UP2 *);
928: void gcdup2(UP2,UP2,UP2 *);
929: void chsgnup2(UP2,UP2 *);
930: void pwrmodup2(UP2,Q,UP2,UP2 *);
931: void pwrmodup2_sparse(UP2,Q,UP2,UP2 *);
932: int compup2(UP2,UP2);
933: void printup2(UP2);
934: void _copyup2(UP2,UP2);
935: void _bshiftup2(UP2,int,UP2);
936: void _bshiftup2_destructive(UP2,int);
937: void diffup2(UP2,UP2 *);
938: int sqfrcheckup2(UP2);
939: int irredcheckup2(UP2);
940: int irredcheck_dddup2(UP2);
941: void _copy_up2bits(UP2,unsigned int **,int);
942: void _print_frobmat(unsigned int **,int,int);
943: int compute_multiplication_matrix(P,GF2MAT *);
944: void compute_change_of_basis_matrix(P,P,int,GF2MAT *,GF2MAT *);
945: int compute_representation_conversion_matrix(P,GF2MAT *,GF2MAT *);
946: void mul_nb(GF2MAT,unsigned int *,unsigned int *,unsigned int *);
947: void leftshift(unsigned int *,int);
948: void mat_to_gf2mat(MAT,unsigned int ***);
949: void gf2mat_to_mat(unsigned int **,int,MAT *);
950: void mulgf2mat(int,unsigned int **,unsigned int **,unsigned int **);
951: void mulgf2vectmat(int,unsigned int *,unsigned int **,unsigned int *);
952: int mulgf2vectvect(int,unsigned int *,unsigned int *);
953: int invgf2mat(int,unsigned int **,unsigned int **);
954: void _mulup2_11(unsigned int,unsigned int,unsigned int *);
955: void _mulup2_22(unsigned int *,unsigned int *,unsigned int *);
956: void _mulup2_33(unsigned int *,unsigned int *,unsigned int *);
957: void _mulup2_44(unsigned int *,unsigned int *,unsigned int *);
958: void _mulup2_55(unsigned int *,unsigned int *,unsigned int *);
959: void _mulup2_66(unsigned int *,unsigned int *,unsigned int *);
960: void printup2_(unsigned int *,int);
961: void type1_bin_invup2(UP2,int,UP2 *);
962: int int_bits(int);
963:
964:
965: LUM LUMALLOC(int, int);
966: Obj ToAlg(Num);
967: UM *berlemain(register int, UM, UM *);
968: void *Risa_GC_malloc(size_t);
969: void *Risa_GC_malloc_atomic(size_t);
970: void *Risa_GC_realloc(void *,size_t);
971: void *GC_malloc(size_t);
972: void *GC_malloc_atomic(size_t);
973: void *GC_realloc(void *,size_t);
974: double NatToReal(N,int *);
975: double RatnToReal(Q);
976: double pwrreal0(double,int);
977: int **almat(int,int);
978: pointer **almat_pointer(int,int);
979: int berlecnt(register int,UM);
980: int berlecntmain(register int,int,int,register int **);
981: int cmpalg(Num,Num);
982: int cmpbf(Num,Num);
983: int cmpcplx(Num,Num);
984: int cmpn(N,N);
985: int cmpq(Q,Q);
986: int cmpreal(Real,Real);
987: int cmpmi(MQ,MQ);
988: int cmplm(LM,LM);
989: int compmat(VL,MAT,MAT);
990: int compnum(VL,Num,Num);
991: int compp(VL,P,P);
992: int compr(VL,Obj,Obj);
993: int compstr(VL,STRING,STRING);
994: int compvect(VL,VECT,VECT);
995: int ctest(P,ML,int,int *);
996: int cycchk(P);
997: int dbound(V,P);
998: int dcomp(P,P);
999: int deg(V,P);
1000: int degtest(int,int *,ML,int);
1001: int divcheck(VL,P *,int,P,P);
1002: unsigned int divin(N,unsigned int,N *);
1003: int divtdcpz(VL,P,P,P *);
1004: int divtpz(VL,P,P,P *);
1005: int divum(register int,UM,UM,UM);
1006: int dm(int,int,int *);
1007: int dmb(int,int,int,int *);
1008: int dma(int,int,int,int *);
1009: int dmab(int,int,int,int,int *);
1010: int dmar(int,int,int,int);
1011: int dtestmain(P,Q,ML,int,int *,P *,P *);
1012: int geldb(VL,P);
1013: int getchomdeg(V,P);
1014: int getdeg(V,P);
1015: int getlchomdeg(V,P,int *);
1016: int homdeg(P);
1017: unsigned int invm(unsigned int,int);
1018: int iscycm(P);
1019: int iscycp(P);
1020: int lengthp(P);
1021: int mig(int,int,P);
1022: int mignotte(int,P);
1023: int minimain(register int,int,int,register int **);
1024: int ncombi(int,int,int,int *);
1025: int nextbin(VN,int);
1026: int nmonop(P);
1027: int pcoef(VL,VL,P,P *);
1028: int pcoef0(VL,VL,P,P *);
1029: unsigned int pwrm(register int,register int,int);
1030: unsigned int rem(N,unsigned int);
1031: int sqfrchk(P);
1032: int subn(N,N,N *);
1033: int ucmpp(P,P);
1034: int valideval(VL,DCP,VN);
1035: int zerovpchk(VL,P,VN);
1036:
1037: void addgf2n(GF2N,GF2N,GF2N *);
1038: void subgf2n(GF2N,GF2N,GF2N *);
1039: void mulgf2n(GF2N,GF2N,GF2N *);
1040: void divgf2n(GF2N,GF2N,GF2N *);
1041: void chsgngf2n(GF2N,GF2N *);
1042: void pwrgf2n(GF2N,Q, GF2N *);
1043: int cmpgf2n(GF2N,GF2N);
1044:
1045: void addgfpn(GFPN,GFPN,GFPN *);
1046: void subgfpn(GFPN,GFPN,GFPN *);
1047: void mulgfpn(GFPN,GFPN,GFPN *);
1048: void divgfpn(GFPN,GFPN,GFPN *);
1049: void chsgngfpn(GFPN,GFPN *);
1050: void pwrgfpn(GFPN,Q, GFPN *);
1051: int cmpgfpn(GFPN,GFPN);
1052:
1053: void addalg(Num,Num,Num *);
1054: void addbf(Num,Num,Num *);
1055: void addcplx(Num,Num,Num *);
1056: void addm2p(VL,Q,Q,P,P,P *);
1057: void addm2q(Q,Q,Q,Q,Q *);
1058: void addmat(VL,MAT,MAT,MAT *);
1059: void addmp(VL,int,P,P,P *);
1060: void addmpq(int,P,P,P *);
1061: void addmptoc(VL,int,P,P,P *);
1062: void addmq(int,MQ,MQ,MQ *);
1063: void addn(N,N,N *);
1064: void addnum(VL,Num,Num,Num *);
1065: void addp(VL,P,P,P *);
1066: void addpadic(int,int,unsigned int *,unsigned int *);
1067: void addpq(P,P,P *);
1068: void addptoc(VL,P,P,P *);
1069: void addq(Q,Q,Q *);
1070: void addr(VL,Obj,Obj,Obj *);
1071: void addreal(Num,Num,Real *);
1072: void addmi(MQ,MQ,MQ *);
1073: void addlm(LM,LM,LM *);
1074: void addstr(VL,STRING,STRING,STRING *);
1075: void addum(int,UM,UM,UM);
1076: void addvect(VL,VECT,VECT,VECT *);
1077: void adjc(VL,P,P,P,Q,P *,P *);
1078: void afctr(VL,P,P,DCP *);
1079: void afctrmain(VL,P,P,int,DCP *);
1080: void affine(VL,P,VN,P *);
1081: void affinemain(VL,P,V,int,P *,P *);
1082: void berle(int,int,P,ML *);
1083: void bnton(register int,N,N *);
1084: void cbound(VL,P,Q *);
1085: void chnrem(int,V,P,Q,UM,P *,Q *);
1086: void chnremp(VL,int,P,Q,P,P *);
1087: void chsgnalg(Num,Num *);
1088: void chsgnbf(Num a,Num *);
1089: void chsgncplx(Num,Num *);
1090: void chsgnmat(MAT,MAT *);
1091: void chsgnmp(int,P,P *);
1092: void chsgnnum(Num,Num *);
1093: void chsgnp(P,P *);
1094: void chsgnq(Q,Q *);
1095: void chsgnr(Obj,Obj *);
1096: void chsgnreal(Num,Num *);
1097: void chsgnmi(MQ,MQ *);
1098: void chsgnlm(LM,LM *);
1099: void chsgnvect(VECT,VECT *);
1100: void clctv(VL,P,VL *);
1101: void clctvr(VL,Obj,VL *);
1102: void cm2p(Q,Q,P,P *);
1103: void cmax(P,Q *);
1104: void cmp(Q,P,P *);
1105: void coefp(P,int,P *);
1106: void cpylum(int,LUM,LUM);
1107: void cpyum(UM,UM);
1108: void csump(VL,P,Q *);
1109: void cycm(V,register int,DCP *);
1110: void cycp(V,register int,DCP *);
1111: void degp(V,P,Q *);
1112: void degum(UM,int);
1113: void detmp(VL,int,P **,int,P *);
1114: void detp(VL,P **,int,P *);
1115: void diffp(VL,P,V,P *);
1116: void diffum(register int,UM,UM);
1117: void divalg(Num,Num,Num *);
1118: void divbf(Num,Num,Num *);
1119: void divcp(P,Q,P *);
1120: void divcplx(Num,Num,Num *);
1121: void divmat(VL,Obj,Obj,Obj *);
1122: void divmq(int,MQ,MQ,MQ *);
1123: void divn(N,N,N *,N *);
1124: void divnmain(int,int,unsigned int *,unsigned int *,unsigned int *);
1125: void divnum(VL,Num,Num,Num *);
1126: void divq(Q,Q,Q *);
1127: void divr(VL,Obj,Obj,Obj *);
1128: void divreal(Num,Num,Real *);
1129: void divmi(MQ,MQ,MQ *);
1130: void divlm(LM,LM,LM *);
1131: void divsdcmp(VL,int,P,P,P *);
1132: void divsdcp(VL,P,P,P *);
1133: void divsmp(VL,int,P,P,P *);
1134: void divsn(N,N,N *);
1135: void divsp(VL,P,P,P *);
1136: void divsrdcmp(VL,int,P,P,P *,P *);
1137: void divsrdcp(VL,P,P,P *,P *);
1138: void divsrmp(VL,int,P,P,P *,P *);
1139: void divsrp(VL,P,P,P *,P *);
1140: void divvect(VL,Obj,Obj,Obj *);
1141: void dtest(P,ML,int,DCP *);
1142: void dtestroot(int,int,P,LUM,struct oDUM *,DCP *);
1143: void dtestroot1(int,int,P,LUM,P *);
1144: void dtestsq(int,int,P,LUM,P *);
1145: void dtestsql(P,ML,struct oDUM *,DCP *);
1146: void estimatelc(VL,Q,DCP,VN,P *);
1147: void eucum(register int,UM,UM,UM,UM);
1148: void exthp(VL,P,int,P *);
1149: void exthpc(VL,V,P,int,P *);
1150: void ezgcd1p(VL,P,P,P *);
1151: void ezgcdhensel(P,int,UM,UM,ML *);
1152: void ezgcdnp(VL,P,P *,int,P *);
1153: void ezgcdnpp(VL,DCP,P *,int,P *);
1154: void ezgcdnpz(VL,P *,int,P *);
1155: void ezgcdp(VL,P,P,P *);
1156: void ezgcdpp(VL,DCP,P,P *);
1157: void ezgcdpz(VL,P,P,P *);
1158: void factorial(int,Q *);
1159: void fctrp(VL,P,DCP *);
1160: void fctrwithmvp(VL,P,V,DCP *);
1161: void gcda(VL,P,P,P,P *);
1162: void gcdcp(VL,P,P *);
1163: void gcdgen(P,ML,ML *);
1164: void gcdmonomial(VL,DCP *,int,P *);
1165: void gcdn(N,N,N *);
1166: void gcdprsp(VL,P,P,P *);
1167: void gcdum(register int,UM,UM,UM);
1168: void getmindeg(V,P,Q *);
1169: void henmain(LUM,ML,ML,ML *);
1170: void henmv(VL,VN,P,P,P,P,P,P,P,P,P,Q,int,P *,P *);
1171: void henmvmain(VL,VN,P,P,P,P,P,P,P,Q,Q,int,P *,P *);
1172: void henprep(P,ML,ML,ML *,ML *);
1173: void hensel(int,int,P,ML *);
1174: void henzq(P,P,UM,P,UM,int,int,P *,P *,P *,P *,Q *);
1175: void henzq1(P,P,Q,P *,P *,Q *);
1176: void hsq(int,int,P,int *,DCP *);
1177: void intersectv(VL,VL,VL *);
1178: void invl(Q,Q,Q *);
1179: void invmq(int,MQ,MQ *);
1180: void invq(Q,Q *);
1181: void lgp(P,N *,N *);
1182: void lumtop(V,int,int,LUM,P *);
1183: void markv(VN,int,P);
1184: void maxdegp(VL,P,VL *,P *);
1185: void mergev(VL,VL,VL,VL *);
1186: void mfctr(VL,P,DCP *);
1187: void mfctrhen2(VL,VN,P,P,P,P,P,P,P *);
1188: void mfctrmain(VL,P,DCP *);
1189: void mfctrwithmv(VL,P,V,DCP *);
1190: void min_common_vars_in_coefp(VL,P,VL *,P *);
1191: void minchdegp(VL,P,VL *,P *);
1192: void mindegp(VL,P,VL *,P *);
1193: void mini(register int,UM,UM);
1194: void minlcdegp(VL,P,VL *,P *);
1195: void mkbc(int,Q *);
1196: void mkbcm(int,int,MQ *);
1197: void mkssum(V,int,int,int,P *);
1198: void monomialfctr(VL,P,P *,DCP *);
1199: void mptop(P,P *);
1200: void mptoum(P,UM);
1201: void msqfr(VL,P,DCP *);
1202: void msqfrmain(VL,P,DCP *);
1203: void msqfrmainmain(VL,P,VN,P,DCP,DCP *,P *);
1204: void mulalg(Num,Num,Num *);
1205: void mulbf(Num,Num,Num *);
1206: void mulcplx(Num,Num,Num *);
1207: void mulin(N,unsigned int,unsigned int *);
1208: void mullum(int,int,LUM,LUM,LUM);
1209: void mullumarray(P,ML,int,int *,P *);
1210: void mulm2p(VL,Q,Q,P,P,P *);
1211: void mulm2q(Q,Q,Q,Q,Q *);
1212: void mulmat(VL,Obj,Obj,Obj *);
1213: void mulmatmat(VL,MAT,MAT,MAT *);
1214: void mulmatvect(VL,MAT,VECT,VECT *);
1215: void mulmp(VL,int,P,P,P *);
1216: void mulmpc(VL,int,P,P,P *);
1217: void mulmpq(int,P,P,P *);
1218: void mulmq(int,MQ,MQ,MQ *);
1219: void muln(N,N,N *);
1220: void mulnum(VL,Num,Num,Num *);
1221: void mulp(VL,P,P,P *);
1222: void mulpadic(int,int,unsigned int *,unsigned int *,unsigned int *);
1223: void mulpc(VL,P,P,P *);
1224: void mulpq(P,P,P *);
1225: void mulq(Q,Q,Q *);
1226: void mulr(VL,Obj,Obj,Obj *);
1227: void mulreal(Num,Num,Real *);
1228: void mulmi(MQ,MQ,MQ *);
1229: void mullm(LM,LM,LM *);
1230: void mulrmat(VL,Obj,MAT,MAT *);
1231: void mulrvect(VL,Obj,VECT,VECT *);
1232: void mulsgn(VN,VN,int,VN);
1233: void mulsum(register int,UM,register int,UM);
1234: void mulum(register int,UM,UM,UM);
1235: void mulvect(VL,Obj,Obj,Obj *);
1236: void mulvectmat(VL,VECT,MAT,VECT *);
1237: void next(VN);
1238: void nezgcdnp_sqfr_primitive(VL,P,P *,int,P *);
1239: void nezgcdnpp(VL,DCP,P *,int,P *);
1240: void nezgcdnpz(VL,P *,int,P *);
1241: void nezgcdnpzmain(VL,P *,int,P *);
1242: void nglob_init(void);
1243: void norm(P,Q *);
1244: void norm1(P,P *);
1245: void norm1c(P,Q *);
1246: void normalizemp(int,P);
1247: void nthrootchk(P,struct oDUM *,ML,DCP *);
1248: void nthrootn(N,int,N *);
1249: void ntobn(register int,N,N *);
1250: void nuezgcdnpzmain(VL,P *,int,P *);
1251: void padictoq(int,int,int *,Q *);
1252: void risa_pari_init(void);
1253: void pcp(VL,P,P *,P *);
1254: void pderivr(VL,Obj,V,Obj *);
1255: void pdiva(VL,P,P,P,P *);
1256: void pinva(P,P,P *);
1257: void plisttop(P *,V,int,P *);
1258: void pmonic(VL,P,P,P *);
1259: void pqra(VL,P,P,P,P *,P *);
1260: void premmp(VL,int,P,P,P *);
1261: void premp(VL,P,P,P *);
1262: void ptolum(int,int,P,LUM);
1263: void ptomp(int,P,P *);
1264: void ptoum(int,P,UM);
1265: void ptozp(P,int,Q *,P *);
1266: void ptozp0(P,P *);
1267: void pwralg(Num,Num,Num *);
1268: void pwrbf(Num,Num,Num *);
1269: void pwrcplx(Num,Num,Num *);
1270: void pwrcplx0(Num,int,Num *);
1271: void pwrlum(int,int,LUM,int,LUM);
1272: void pwrmat(VL,MAT,Obj,MAT *);
1273: void pwrmatmain(VL,MAT,int,MAT *);
1274: void pwrmp(VL,int,P,Q,P *);
1275: void pwrmq(int,MQ,Q,MQ *);
1276: void pwrn(N,int,N *);
1277: void pwrnum(VL,Num,Num,Num *);
1278: void pwrp(VL,P,Q,P *);
1279: void pwrq(Q,Q,Q *);
1280: void pwrr(VL,Obj,Obj,Obj *);
1281: void pwrreal(Num,Num,Real *);
1282: void pwrmi(MQ,Q,MQ *);
1283: void pwrlm(LM,Q,LM *);
1284: void pwrum(int,UM,int,UM);
1285: void reallocarray(char **,int *,int *,int);
1286: void reductr(VL,Obj,Obj *);
1287: void reimtocplx(Num,Num,Num *);
1288: void rem2q(Q,Q,Q,Q *);
1289: void rema(VL,P,P,P,P *);
1290: void remq(Q,Q,Q *);
1291: void remsdcp(VL,P,P,P *);
1292: void reordermp(VL,int,VL,P,P *);
1293: void reorderp(VL,VL,P,P *);
1294: void reordvar(VL,V,VL *);
1295: void res_ch_det(VL,V,P,P,P *);
1296: void res_detmp(VL,int,V,P,P,P *);
1297: void restore(VL,P,VN,P *);
1298: void resultmp(VL,int,V,P,P,P *);
1299: void resultp(VL,V,P,P,P *);
1300: void setlum(int,int,LUM);
1301: void sort_by_deg(int,P *,P *);
1302: void sort_by_deg_rev(int,P *,P *);
1303: void sortfs(DCP *);
1304: void sortfsrev(DCP *);
1305: void sortplist(P *,int);
1306: void sortplistbyhomdeg(P *,int);
1307: void sprs(VL,V,P,P,P *);
1308: void sqa(VL,P,P,DCP *);
1309: void sqad(unsigned int,int);
1310: void sqfrp(VL,P,DCP *);
1311: void sqfrum(int,int,P,int *,struct oDUM **,ML *);
1312: void sqfrummain(int,UM,UM,struct oDUM **);
1313: void sqrtn(N,N *);
1314: void srch2(VL,V,P,P,P *);
1315: void srchmp(VL,int,V,P,P,P *);
1316: void srchump(int,P,P,P *);
1317: void srcr(VL,V,P,P,P *);
1318: void strtobf(char *,BF *);
1319: void subalg(Num,Num,Num *);
1320: void subbf(Num,Num,Num *);
1321: void subcplx(Num,Num,Num *);
1322: void subm2p(VL,Q,Q,P,P,P *);
1323: void subm2q(Q,Q,Q,Q,Q *);
1324: void submat(VL,MAT,MAT,MAT *);
1325: void submp(VL,int,P,P,P *);
1326: void submq(int,MQ,MQ,MQ *);
1327: void subnum(VL,Num,Num,Num *);
1328: void subp(VL,P,P,P *);
1329: void subq(Q,Q,Q *);
1330: void subr(VL,Obj,Obj,Obj *);
1331: void subreal(Num,Num,Real *);
1332: void submi(MQ,MQ,MQ *);
1333: void sublm(LM,LM,LM *);
1334: void substmp(VL,int,P,V,P,P *);
1335: void substp(VL,P,V,P,P *);
1336: void substvp(VL,P,VN,P *);
1337: void subum(int,UM,UM,UM);
1338: void subvect(VL,VECT,VECT,VECT *);
1339: void toreim(Num,Num *,Num *);
1340: void ucsump(P,Q *);
1341: void udivpwm(Q,P,P,P *,P *);
1342: void udivpz(P,P,P *,P *);
1343: void udivpzwm(Q,P,P,P *,P *);
1344: void uexgcdnp(VL,P,P *,int,VN,Q,P *,P *,P *,P *,Q *);
1345: void uezgcd1p(P,P,P *);
1346: void uezgcdpp(DCP,P,P *);
1347: void uezgcdpz(VL,P,P,P *);
1348: void ufctr(P,int,DCP *);
1349: void ufctrmain(P,int,DCP *);
1350: void umtomp(V,UM,P *);
1351: void umtop(V,UM,P *);
1352: void usqp(P,DCP *);
1353: void vntovl(VN,int,VL *);
1354:
1355: #if 0 && !defined(VISUAL)
1356: void bzero(const void *,int);
1357: void bcopy(const void *,void *,int);
1358: char *index(char *,int);
1359: #endif
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>