Annotation of OpenXM_contrib2/asir2000/include/ca.h, Revision 1.47
1.4 noro 1: /*
2: * Copyright (c) 1994-2000 FUJITSU LABORATORIES LIMITED
3: * All rights reserved.
4: *
5: * FUJITSU LABORATORIES LIMITED ("FLL") hereby grants you a limited,
6: * non-exclusive and royalty-free license to use, copy, modify and
7: * redistribute, solely for non-commercial and non-profit purposes, the
8: * computer program, "Risa/Asir" ("SOFTWARE"), subject to the terms and
9: * conditions of this Agreement. For the avoidance of doubt, you acquire
10: * only a limited right to use the SOFTWARE hereunder, and FLL or any
11: * third party developer retains all rights, including but not limited to
12: * copyrights, in and to the SOFTWARE.
13: *
14: * (1) FLL does not grant you a license in any way for commercial
15: * purposes. You may use the SOFTWARE only for non-commercial and
16: * non-profit purposes only, such as academic, research and internal
17: * business use.
18: * (2) The SOFTWARE is protected by the Copyright Law of Japan and
19: * international copyright treaties. If you make copies of the SOFTWARE,
20: * with or without modification, as permitted hereunder, you shall affix
21: * to all such copies of the SOFTWARE the above copyright notice.
22: * (3) An explicit reference to this SOFTWARE and its copyright owner
23: * shall be made on your publication or presentation in any form of the
24: * results obtained by use of the SOFTWARE.
25: * (4) In the event that you modify the SOFTWARE, you shall notify FLL by
1.5 noro 26: * e-mail at risa-admin@sec.flab.fujitsu.co.jp of the detailed specification
1.4 noro 27: * for such modification or the source code of the modified part of the
28: * SOFTWARE.
29: *
30: * THE SOFTWARE IS PROVIDED AS IS WITHOUT ANY WARRANTY OF ANY KIND. FLL
31: * MAKES ABSOLUTELY NO WARRANTIES, EXPRESSED, IMPLIED OR STATUTORY, AND
32: * EXPRESSLY DISCLAIMS ANY IMPLIED WARRANTY OF MERCHANTABILITY, FITNESS
33: * FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT OF THIRD PARTIES'
34: * RIGHTS. NO FLL DEALER, AGENT, EMPLOYEES IS AUTHORIZED TO MAKE ANY
35: * MODIFICATIONS, EXTENSIONS, OR ADDITIONS TO THIS WARRANTY.
36: * UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, TORT, CONTRACT,
37: * OR OTHERWISE, SHALL FLL BE LIABLE TO YOU OR ANY OTHER PERSON FOR ANY
38: * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, PUNITIVE OR CONSEQUENTIAL
39: * DAMAGES OF ANY CHARACTER, INCLUDING, WITHOUT LIMITATION, DAMAGES
40: * ARISING OUT OF OR RELATING TO THE SOFTWARE OR THIS AGREEMENT, DAMAGES
41: * FOR LOSS OF GOODWILL, WORK STOPPAGE, OR LOSS OF DATA, OR FOR ANY
42: * DAMAGES, EVEN IF FLL SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF
43: * SUCH DAMAGES, OR FOR ANY CLAIM BY ANY OTHER PARTY. EVEN IF A PART
44: * OF THE SOFTWARE HAS BEEN DEVELOPED BY A THIRD PARTY, THE THIRD PARTY
45: * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE,
46: * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE.
47: *
1.47 ! noro 48: * $OpenXM: OpenXM_contrib2/asir2000/include/ca.h,v 1.46 2004/03/03 09:25:30 noro Exp $
1.4 noro 49: */
1.1 noro 50: #include <stdio.h>
1.36 ohara 51: #include <stdlib.h>
1.1 noro 52:
53: #if defined(hpux)
54: #include <netinet/in.h>
55: # define setbuffer(FP,buf,siz) setvbuf(FP,buf,_IOFBF,siz)
56: #endif
57:
1.36 ohara 58: #if !defined(VISUAL)
59: #include <unistd.h>
1.1 noro 60: #endif
61:
1.28 noro 62: #if !defined(VISUAL)
63: #include <sys/param.h>
64: #endif
65:
1.1 noro 66: #if defined(linux) || (defined(sun) && !defined(SYSV)) || defined(news5000) || (defined(mips) && defined(ultrix))
67: #include <alloca.h>
68: #endif
69:
70: #if (defined(sun) && defined(SYSV))
71: #define alloca(x) __builtin_alloca(x)
72: #endif
73:
74: #if defined(VISUAL)
75: #include <malloc.h>
76: #endif
77:
78: #if 0
79: #include <sys/types.h>
80: typedef caddr_t pointer;
81: #endif
82:
83: typedef void * pointer;
84:
1.36 ohara 85: #if defined(sun)
86: #include <strings.h>
87: #else
88: #include <string.h>
1.1 noro 89: #if defined(VISUAL)
90: #define index(s,c) strchr(s,c)
91: #define bzero(s,len) memset(s,0,len)
92: #define bcopy(x,y,len) memcpy(y,x,len)
1.36 ohara 93: #endif
1.1 noro 94: #endif
95:
96: #define COPY(a,b) ((b)=(a))
97: #define FREEN(p)
98: #define FREEQ(p)
99: #define FREE(p)
100: #define INITRC(p)
101:
102: /* data structures */
103:
104: #define O_N 1
105: #define O_P 2
106: #define O_R 3
107: #define O_LIST 4
108: #define O_VECT 5
109: #define O_MAT 6
110: #define O_STR 7
111: #define O_COMP 8
112: #define O_DP 9
113: #define O_USINT 10
114: #define O_ERR 11
115: #define O_GF2MAT 12
116: #define O_MATHCAP 13
117: #define O_F 14
118: #define O_GFMMAT 15
1.6 noro 119: #define O_BYTEARRAY 16
1.13 noro 120: #define O_QUOTE 17
1.39 noro 121: #define O_OPTLIST 18
1.43 noro 122: #define O_SYMBOL 19
1.45 noro 123: #define O_RANGE 20
1.46 noro 124: #define O_TB 21
1.1 noro 125: #define O_VOID -1
126:
127: #define N_Q 0
128: #define N_R 1
129: #define N_A 2
130: #define N_B 3
131: #define N_C 4
132: #define N_M 5
133: #define N_LM 6
134: #define N_GF2N 7
135: #define N_GFPN 8
1.12 noro 136: #define N_GFS 9
1.21 noro 137: #define N_GFSN 10
1.1 noro 138:
139: #define ORD_REVGRADLEX 0
140: #define ORD_GRADLEX 1
141: #define ORD_LEX 2
142:
1.35 ohara 143: #if defined(LONG_IS_32BIT)
1.1 noro 144: #if defined(VISUAL)
145: typedef _int64 L;
146: typedef unsigned _int64 UL;
147: #else
148: typedef long long L;
149: typedef unsigned long long UL;
150: #endif
151: #else
152: typedef long L;
153: typedef unsigned long UL;
154: #endif
155:
156: typedef struct oN {
157: int p;
158: unsigned int b[1];
159: } *N;
160:
161: typedef struct oUP2 {
162: int w;
163: unsigned int b[1];
164: } *UP2;
165:
166: typedef struct _oUP2 {
167: int w;
168: unsigned int *b;
169: } *_UP2;
170:
171: #define UP2_DENSE 0
172: #define UP2_SPARSE 1
173:
174: typedef struct oGEN_UP2 {
175: int id;
176: UP2 dense;
177: UP2 sparse;
178: } *GEN_UP2;
179:
180: typedef struct oV {
181: char *name;
182: pointer attr;
183: pointer priv;
184: } *V;
185:
186: typedef struct oQ {
187: short id;
188: char nid;
189: char sgn;
190: N nm;
191: N dn;
192: } *Q;
193:
194: typedef struct oReal {
195: short id;
196: char nid;
197: char pad;
198: double body;
199: } *Real;
200:
201: typedef struct oAlg {
202: short id;
203: char nid;
204: char pad;
205: struct oObj *body;
206: } *Alg;
207:
208: typedef struct oBF {
209: short id;
210: char nid;
211: char pad;
212: long body[1];
213: } *BF;
214:
215: typedef struct oC {
216: short id;
217: char nid;
218: char pad;
219: struct oNum *r,*i;
220: } *C;
221:
222: typedef struct oLM {
223: short id;
224: char nid;
225: char pad;
226: struct oN *body;
227: } *LM;
228:
229: typedef struct oGF2N {
230: short id;
231: char nid;
232: char pad;
233: struct oUP2 *body;
234: } *GF2N;
235:
236: typedef struct oGFPN {
237: short id;
238: char nid;
239: char pad;
240: struct oUP *body;
241: } *GFPN;
242:
243: typedef struct oNum {
244: short id;
245: char nid;
246: char pad;
247: } *Num;
248:
249: typedef struct oMQ {
250: short id;
251: char nid;
252: char pad;
253: int cont;
254: } *MQ;
255:
1.12 noro 256: typedef struct oGFS {
257: short id;
258: char nid;
259: char pad;
260: int cont;
261: } *GFS;
262:
1.21 noro 263: typedef struct oGFSN {
1.20 noro 264: short id;
265: char nid;
266: char pad;
267: struct oUM *body;
1.21 noro 268: } *GFSN;
1.12 noro 269:
1.1 noro 270: typedef struct oP {
271: short id;
272: short pad;
273: V v;
274: struct oDCP *dc;
275: } *P;
276:
277: typedef struct oR {
278: short id;
279: short reduced;
280: P nm;
281: P dn;
282: } *R;
283:
284: typedef struct oVECT {
285: short id;
286: short pad;
287: int len;
288: pointer *body;
289: } *VECT;
290:
291: typedef struct oMAT {
292: short id;
293: short pad;
294: int row,col;
295: pointer **body;
296: } *MAT;
297:
298: typedef struct oGF2MAT {
299: short id;
300: short pad;
301: int row,col;
302: unsigned int **body;
303: } *GF2MAT, *GFMMAT;
304:
305: typedef struct oLIST {
306: short id;
307: short pad;
308: struct oNODE *body;
309: } *LIST;
310:
311: typedef struct oSTRING {
312: short id;
313: short pad;
314: char *body;
315: } *STRING;
316:
317: typedef struct oCOMP {
318: short id;
319: short type;
320: struct oObj *member[1];
321: } *COMP;
322:
323: typedef struct oDP {
324: short id;
325: short nv;
326: int sugar;
327: struct oMP *body;
328: } *DP;
329:
330: typedef struct oUSINT {
331: short id;
332: short pad;
333: unsigned body;
334: } *USINT;
335:
336: typedef struct oERR {
337: short id;
338: short pad;
339: struct oObj *body;
340: } *ERR;
341:
342: typedef struct oMATHCAP {
343: short id;
344: short pad;
345: struct oLIST *body;
346: } *MATHCAP;
347:
1.6 noro 348: typedef struct oBYTEARRAY {
349: short id;
350: short pad;
351: int len;
352: unsigned char *body;
353: } *BYTEARRAY;
354:
1.13 noro 355: typedef struct oQUOTE {
356: short id;
357: short pad;
358: pointer body;
1.47 ! noro 359: struct oNODE *attr;
1.13 noro 360: } *QUOTE;
361:
1.39 noro 362: typedef struct oOPTLIST {
363: short id;
364: short pad;
365: struct oNODE *body;
366: } *OPTLIST;
367:
1.45 noro 368: typedef struct oSYMBOL {
1.43 noro 369: short id;
370: short pad;
371: char *name;
372: int value;
1.45 noro 373: } *SYMBOL;
374:
375: typedef struct oRANGE {
376: short id;
377: short pad;
378: struct oObj *start,*end;
379: } *RANGE;
380:
1.46 noro 381: typedef struct oTB {
382: short id;
383: short pad;
384: int size,next;
385: char **body;
386: } *TB;
1.43 noro 387:
1.1 noro 388: typedef struct oObj {
389: short id;
390: short pad;
391: } *Obj;
392:
393: typedef struct oDCP {
394: Q d;
395: P c;
396: struct oDCP *next;
397: } *DCP;
398:
399: typedef struct oMP {
400: struct oDL *dl;
401: P c;
402: struct oMP *next;
403: } *MP;
404:
405: typedef struct oDL {
406: int td;
407: int d[1];
408: } *DL;
1.23 noro 409:
1.29 noro 410: struct dp_pairs {
411: int dp1, dp2;
412: DL lcm;
413: int sugar;
414: struct dp_pairs *next;
415: };
416:
417: typedef struct dp_pairs *DP_pairs;
418:
419: struct p_pair {
420: struct oUM *p0;
421: struct oUM *p1;
422: struct p_pair *next;
423: };
424:
425: struct oMF {
426: int m;
427: P f;
428: };
429:
1.23 noro 430: /*
431: * compressed DP
432: */
433:
434: typedef struct oCDP {
435: int len;
1.26 noro 436: int psindex;
1.27 noro 437: unsigned int *body;
1.23 noro 438: } *CDP;
439:
1.24 noro 440: typedef struct oCM {
1.23 noro 441: int index;
442: int c;
1.24 noro 443: } *CM;
1.1 noro 444:
1.25 noro 445: /* bucket list for DL */
446:
447: typedef struct oDLBUCKET {
448: int td;
449: struct oNODE *body;
450: struct oDLBUCKET *next;
451: } *DLBUCKET;
1.37 noro 452:
453: typedef struct oGeoBucket {
454: int m;
455: struct oNODE *body[32];
456: } *GeoBucket;
1.25 noro 457:
1.1 noro 458: typedef struct oVL {
459: V v;
460: struct oVL *next;
461: } *VL;
462:
463: typedef struct oNODE {
464: pointer body;
465: struct oNODE *next;
466: } *NODE;
467:
1.16 noro 468: /* univariate poly over small finite field; dense */
1.1 noro 469: typedef struct oUM {
470: int d;
471: int c[1];
472: } *UM;
473:
1.16 noro 474: /* univariate poly with padic coeff */
1.1 noro 475: typedef struct oLUM {
476: int d;
477: int *c[1];
478: } *LUM;
479:
1.16 noro 480: /* bivariate poly over small finite field; dense */
481:
482: typedef struct oBM {
483: int d;
484: UM c[1];
485: } *BM;
486:
1.1 noro 487: typedef struct oML {
488: int n;
489: int mod;
490: int bound;
491: pointer c[1];
492: } *ML;
493:
494: typedef struct oUB {
495: int d;
496: N c[1];
497: } *UB;
498:
499: typedef struct oVN {
500: V v;
501: int n;
502: } *VN;
503:
504: typedef struct oUP {
505: int d;
506: Num c[1];
507: } *UP;
508:
509: typedef struct oDUM {
510: int n;
511: UM f;
512: } *DUM;
513:
514: struct order_pair {
515: int order, length;
516: };
517:
1.42 noro 518: struct sparse_weight {
519: int pos, value;
520: };
521:
522: #define IS_DENSE_WEIGHT 0
523: #define IS_SPARSE_WEIGHT 1
524: #define IS_BLOCK 2
525:
526: struct weight_or_block {
527: int type;
528: int length;
529: union {
530: int *dense_weight;
531: struct sparse_weight *sparse_weight;
532: struct {
533: int order, start;
534: } block;
535: } body;
536: };
537:
1.1 noro 538: struct order_spec {
539: int id;
540: Obj obj;
541: int nv;
542: union {
543: int simple;
544: struct {
545: int length;
546: struct order_pair *order_pair;
547: } block;
548: struct {
549: int row;
550: int **matrix;
551: } matrix;
1.42 noro 552: struct {
553: int length;
554: struct weight_or_block *w_or_b;
555: } composite;
1.1 noro 556: } ord;
557: };
558:
559: /* structure for cputime */
560:
561: struct oEGT {
562: double exectime,gctime;
563: };
564:
565: /* constant */
566:
567: /* ground finite field specification */
568: #define FF_NOT_SET 0
569: #define FF_GFP 1
570: #define FF_GF2N 2
571: #define FF_GFPN 3
1.12 noro 572: #define FF_GFS 4
1.21 noro 573: #define FF_GFSN 5
1.11 saito 574:
575: /* include interval.h */
576: #include "interval.h"
1.1 noro 577:
578: #define INDEX 100
579:
1.35 ohara 580: #if defined(USE_FLOAT)
1.1 noro 581: typedef float ModNum;
582: #define NPrimes 536
583: #else
584: typedef unsigned int ModNum;
585: #define NPrimes 13681
586: #endif
587:
588: /* general macros */
1.28 noro 589: #if defined(MAX)
590: #undef MAX
591: #endif
592: #if defined(MIN)
593: #undef MIN
594: #endif
1.1 noro 595: #define MAX(a,b) ((a) > (b) ? (a) : (b) )
596: #define MIN(a,b) ((a) > (b) ? (b) : (a) )
597: #ifdef ABS
598: #undef ABS
599: #endif
600: #define ABS(a) ((a)>0?(a):-(a))
601: #define ID(p) ((p)->id)
602: #define OID(p) (((Obj)(p))->id)
603: #define NID(p) (((Num)(p))->nid)
604: #define BDY(p) ((p)->body)
605: #define VR(p) ((p)->v)
606: #define NAME(p) ((p)->name)
607: #define NEXT(p) ((p)->next)
608: #define NM(q) ((q)->nm)
609: #define DN(q) ((q)->dn)
610: #define SGN(q) ((q)->sgn)
611: #define DC(p) ((p)->dc)
612: #define COEF(p) ((p)->c)
613: #define DEG(p) ((p)->d)
614: #define PL(n) ((n)->p)
615: #define BD(n) ((n)->b)
616: #define CONT(a) ((a)->cont)
617: #define UDEG(f) BD(NM(DEG(DC(f))))[0]
618: #define UCOEF(f) (COEF(DC(f)))
619: #define LC(f) (NUM(f)?(f):COEF(DC(f)))
620:
621: /* memory allocators (W_... : uses alloca) */
622:
623: #if 0
624: #define MALLOC(d) Risa_GC_malloc(d)
625: #define MALLOC_ATOMIC(d) Risa_GC_malloc_atomic(d)
626: #define REALLOC(p,d) Risa_GC_realloc(p,d)
627: #else
628: #define MALLOC(d) GC_malloc(d)
629: #define MALLOC_ATOMIC(d) GC_malloc_atomic(d)
630: #define REALLOC(p,d) GC_realloc(p,d)
631: #endif
632: #define CALLOC(d,e) MALLOC((d)*(e))
633:
1.32 noro 634: #if !defined(__CYGWIN__) && (defined(__GNUC__) || defined(vax) || defined(apollo) || defined(alloca) || defined(VISUAL))
1.1 noro 635: #define ALLOCA(d) alloca(d)
636: #else
637: #define ALLOCA(d) MALLOC(d)
1.32 noro 638: #endif
639:
640: /* for setjmp/longjmp compatibility */
1.40 noro 641: #if defined(__CYGWIN__) || defined(__x86_64)
1.32 noro 642: #define JMP_BUF sigjmp_buf
643: #define SETJMP(x) sigsetjmp(x,~0)
644: #define LONGJMP(x,y) siglongjmp(x,y)
645: #else
646: #define JMP_BUF jmp_buf
647: #define SETJMP(x) setjmp(x)
648: #define LONGJMP(x,y) longjmp(x,y)
1.1 noro 649: #endif
650:
651: #define TRUESIZE(type,n,atype) (sizeof(struct type)+MAX((n),0)*sizeof(atype))
652: #define NALLOC(d) ((N)MALLOC_ATOMIC(TRUESIZE(oN,(d)-1,int)))
653: #define UMALLOC(d) ((UM)MALLOC(TRUESIZE(oUM,d,int)))
654: #define UPALLOC(d) ((UP)MALLOC(TRUESIZE(oUP,(d),Num)))
655: #define C_UMALLOC(d) ((UM)MALLOC(TRUESIZE(oUM,d,int)))
656: #define MLALLOC(d) ((ML)MALLOC(TRUESIZE(oML,d,pointer)))
657:
658: #define W_ALLOC(d) ((int *)ALLOCA(((d)+1)*sizeof(int)))
659: #define W_CALLOC(n,type,p) \
660: ((p)=(type *)ALLOCA(((n)+1)*sizeof(type)),\
661: bzero((char *)(p),(int)(((n)+1)*sizeof(type))))
662: #define W_UMALLOC(d) ((UM)ALLOCA(TRUESIZE(oUM,d,int)))
663: #define W_UPALLOC(d) ((UP)ALLOCA(TRUESIZE(oUP,(d),Num)))
664: #define W_MLALLOC(d) ((ML)ALLOCA(TRUESIZE(oML,d,pointer)))
665: #define W_LUMALLOC(n,bound,p)\
666: {\
667: LUM ___q___;\
668: int ___i___,**___c___;\
669: (___q___) = (LUM)ALLOCA(TRUESIZE(oLUM,(n),int *));\
670: DEG(___q___) = n;\
671: for ( ___i___ = 0, ___c___ = (int **)COEF(___q___); ___i___ <= n; ___i___++ ) {\
672: ___c___[___i___] = (int *)ALLOCA(((bound)+1)*sizeof(int));\
673: bzero((char *)___c___[___i___],((bound)+1)*sizeof(int));\
674: }\
675: (p) = ___q___;\
676: }
677:
1.18 noro 678: #define W_BMALLOC(dx,dy,p)\
1.16 noro 679: {\
680: BM ___q___;\
681: int ___i___;\
682: UM *___c___;\
1.18 noro 683: (___q___) = (BM)ALLOCA(TRUESIZE(oBM,(dy),UM));\
684: DEG(___q___) = dy;\
1.16 noro 685: ___c___ = (UM *)COEF(___q___);\
1.18 noro 686: for ( ___i___ = 0; ___i___ <= dy; ___i___++ ) {\
687: ___c___[___i___] = W_UMALLOC(dx);\
688: clearum(___c___[___i___],dx);\
1.16 noro 689: }\
690: (p) = ___q___;\
691: }
692:
1.1 noro 693: #define NEWUP2(q,w)\
694: ((q)=(UP2)MALLOC_ATOMIC(TRUESIZE(oUP2,(w)-1,unsigned int)),\
695: bzero((char *)(q)->b,(w)*sizeof(unsigned int)))
696: #define W_NEWUP2(q,w)\
697: ((q)=(UP2)ALLOCA(TRUESIZE(oUP2,(w)-1,unsigned int)),\
698: bzero((char *)(q)->b,(w)*sizeof(unsigned int)))
699: #define W_NEW_UP2(q,w)\
700: ((q).b=(unsigned int *)ALLOCA((w)*sizeof(unsigned int)))
701:
702: /* cell allocators */
703: #define NEWQ(q) ((q)=(Q)MALLOC(sizeof(struct oQ)),OID(q)=O_N,NID(q)=N_Q)
704: #define NEWMQ(q) ((q)=(MQ)MALLOC_ATOMIC(sizeof(struct oMQ)),OID(q)=O_N,NID(q)=N_M)
1.12 noro 705: #define NEWGFS(q) ((q)=(GFS)MALLOC_ATOMIC(sizeof(struct oGFS)),OID(q)=O_N,NID(q)=N_GFS)
1.21 noro 706: #define NEWGFSN(q) ((q)=(GFSN)MALLOC(sizeof(struct oGFSN)),OID(q)=O_N,NID(q)=N_GFSN)
1.1 noro 707: #define NEWP(p) ((p)=(P)MALLOC(sizeof(struct oP)),OID(p)=O_P)
708: #define NEWR(r) ((r)=(R)MALLOC(sizeof(struct oR)),OID(r)=O_R,(r)->reduced=0)
709: #define NEWLIST(l) ((l)=(LIST)MALLOC(sizeof(struct oLIST)),OID(l)=O_LIST)
710: #define NEWVECT(l) ((l)=(VECT)MALLOC(sizeof(struct oVECT)),OID(l)=O_VECT)
711: #define NEWSTR(l) ((l)=(STRING)MALLOC(sizeof(struct oSTRING)),OID(l)=O_STR)
712: #define NEWCOMP(c,n) ((c)=(COMP)MALLOC(sizeof(struct oCOMP)+((n)-1)*sizeof(Obj)),OID(c)=O_COMP)
713: #define NEWDP(d) ((d)=(DP)MALLOC(sizeof(struct oDP)),OID(d)=O_DP)
714: #define NEWUSINT(u) ((u)=(USINT)MALLOC_ATOMIC(sizeof(struct oUSINT)),OID(u)=O_USINT)
715: #define NEWERR(e) ((e)=(ERR)MALLOC(sizeof(struct oERR)),OID(e)=O_ERR)
716: #define NEWMATHCAP(e) ((e)=(MATHCAP)MALLOC(sizeof(struct oMATHCAP)),OID(e)=O_MATHCAP)
1.6 noro 717: #define NEWBYTEARRAY(e) ((e)=(BYTEARRAY)MALLOC(sizeof(struct oBYTEARRAY)),OID(e)=O_BYTEARRAY)
1.13 noro 718: #define NEWQUOTE(e) ((e)=(QUOTE)MALLOC(sizeof(struct oQUOTE)),OID(e)=O_QUOTE)
1.39 noro 719: #define NEWOPTLIST(l) ((l)=(OPTLIST)MALLOC(sizeof(struct oOPTLIST)),OID(l)=O_OPTLIST)
1.43 noro 720: #define NEWSYMBOL(l) ((l)=(SYMBOL)MALLOC(sizeof(struct oSYMBOL)),OID(l)=O_SYMBOL)
1.45 noro 721: #define NEWRANGE(l) ((l)=(RANGE)MALLOC(sizeof(struct oRANGE)),OID(l)=O_RANGE)
1.46 noro 722: #define NEWTB(l) ((l)=(TB)MALLOC(sizeof(struct oTB)),OID(l)=O_TB,(l)->size=256,(l)->next=0,(l)->body=(char **)MALLOC((l)->size*sizeof(char *)))
1.1 noro 723:
724: #define NEWNODE(a) ((a)=(NODE)MALLOC(sizeof(struct oNODE)))
725: #define NEWDC(dc) ((dc)=(DCP)MALLOC(sizeof(struct oDCP)))
726: #define NEWV(v) ((v)=(V)MALLOC(sizeof(struct oV)))
727: #define NEWVL(vl) ((vl)=(VL)MALLOC(sizeof(struct oVL)))
728: #define NEWMP(m) ((m)=(MP)MALLOC(sizeof(struct oMP)))
1.25 noro 729: #define NEWDLBUCKET(a) ((a)=(DLBUCKET)MALLOC(sizeof(struct oDLBUCKET)))
1.29 noro 730: #define NEWDPP(a) ((a)=(DP_pairs)MALLOC(sizeof(struct dp_pairs)))
1.1 noro 731:
732: #define NEWMAT(l) ((l)=(MAT)MALLOC(sizeof(struct oMAT)),OID(l)=O_MAT)
733: #define NEWGF2MAT(l) ((l)=(GF2MAT)MALLOC(sizeof(struct oGF2MAT)),OID(l)=O_GF2MAT)
734: #define NEWGFMMAT(l) ((l)=(GFMMAT)MALLOC(sizeof(struct oGF2MAT)),OID(l)=O_GFMMAT)
735: #define NEWReal(q) ((q)=(Real)MALLOC_ATOMIC(sizeof(struct oReal)),OID(q)=O_N,NID(q)=N_R)
736: #define NEWAlg(r) ((r)=(Alg)MALLOC(sizeof(struct oAlg)),OID(r)=O_N,NID(r)=N_A)
737: #define NEWBF(q,l) ((q)=(BF)MALLOC_ATOMIC(TRUESIZE(oBF,(l)-1,long)),OID(q)=O_N,NID(q)=N_B)
738: #define NEWC(r) ((r)=(C)MALLOC(sizeof(struct oC)),OID(r)=O_N,NID(r)=N_C)
739: #define NEWLM(r) ((r)=(LM)MALLOC(sizeof(struct oLM)),OID(r)=O_N,NID(r)=N_LM)
740: #define NEWGF2N(r) ((r)=(GF2N)MALLOC(sizeof(struct oGF2N)),OID(r)=O_N,NID(r)=N_GF2N)
741: #define NEWGFPN(r) ((r)=(GFPN)MALLOC(sizeof(struct oGFPN)),OID(r)=O_N,NID(r)=N_GFPN)
742: #define NEWDL(d,n) \
743: ((d)=(DL)MALLOC_ATOMIC(TRUESIZE(oDL,(n)-1,int)),bzero((char *)(d),TRUESIZE(oDL,(n)-1,int)))
1.9 noro 744: #define NEWDL_NOINIT(d,n) \
745: ((d)=(DL)MALLOC_ATOMIC(TRUESIZE(oDL,(n)-1,int)))
1.1 noro 746:
747: #define MKP(v,dc,p) \
748: (!DEG(dc)?((p)=COEF(dc)):(NEWP(p),VR(p)=(v),DC(p)=(dc),(p)))
749: #define MKV(v,p) \
750: (NEWP(p),VR(p)=(v),NEWDC(DC(p)),\
751: DEG(DC(p))=ONE,COEF(DC(p))=(P)ONE,NEXT(DC(p))=0)
752: #define MKRAT(n,d,r,p) \
753: (NEWR(p),NM(p)=(n),DN(p)=(d),(p)->reduced=(r))
754: #define MKMV(v,p) \
755: (NEWP(p),VR(p)=(v),NEWDC(DC(p)),\
756: DEG(DC(p))=ONE,COEF(DC(p))=(P)ONEM,NEXT(DC(p))=0)
757: #define MKNODE(a,b,c) \
758: (NEWNODE(a),(a)->body=(pointer)b,NEXT(a)=(NODE)(c))
759: #define MKLIST(a,b) (NEWLIST(a),(a)->body=(NODE)(b))
760: #define MKVECT(m,l) \
761: (NEWVECT(m),(m)->len=(l),(m)->body=(pointer *)CALLOC((l),sizeof(pointer)))
762: #define MKMAT(m,r,c) \
763: (NEWMAT(m),(m)->row=(r),(m)->col=(c),(m)->body=(pointer **)almat_pointer((r),(c)))
764: #define TOGF2MAT(r,c,b,m) (NEWGF2MAT(m),(m)->row=(r),(m)->col=(c),(m)->body=(b))
765: #define TOGFMMAT(r,c,b,m) (NEWGFMMAT(m),(m)->row=(r),(m)->col=(c),(m)->body=(b))
766: #define MKSTR(a,b) (NEWSTR(a),(a)->body=(char *)(b))
767: #define MKDP(n,m,d) (NEWDP(d),(d)->nv=(n),BDY(d)=(m))
768: #define MKLM(b,l) (!(b)?(l)=0:(NEWLM(l),(l)->body=(b),(l)))
769: #define MKGF2N(b,l) (!(b)?(l)=0:(NEWGF2N(l),(l)->body=(b),(l)))
770: #define MKGFPN(b,l) (!(b)?(l)=0:(NEWGFPN(l),(l)->body=(b),(l)))
771: #define MKUSINT(u,b) (NEWUSINT(u),(u)->body=(unsigned)(b))
772: #define MKERR(e,b) (NEWERR(e),(e)->body=(Obj)(b))
773: #define MKMATHCAP(e,b) (NEWMATHCAP(e),(e)->body=(LIST)(b))
1.6 noro 774: #define MKBYTEARRAY(m,l) \
775: (NEWBYTEARRAY(m),(m)->len=(l),(m)->body=(char *)MALLOC_ATOMIC((l)),bzero((m)->body,(l)))
1.47 ! noro 776: #define MKQUOTE(q,b) (NEWQUOTE(q),(q)->body=(pointer)(b),(q)->attr=0)
1.1 noro 777:
778: #define NEXTDC(r,c) \
779: if(!(r)){NEWDC(r);(c)=(r);}else{NEWDC(NEXT(c));(c)=NEXT(c);}
780: #define NEXTNODE(r,c) \
781: if(!(r)){NEWNODE(r);(c)=(r);}else{NEWNODE(NEXT(c));(c)=NEXT(c);}
782: #define NEXTMP(r,c) \
783: if(!(r)){NEWMP(r);(c)=(r);}else{NEWMP(NEXT(c));(c)=NEXT(c);}
1.9 noro 784: #define NEXTMP2(r,c,s) \
785: if(!(r)){(c)=(r)=(s);}else{NEXT(c)=(s);(c)=(s);}
1.25 noro 786: #define NEXTDLBUCKET(r,c) \
787: if(!(r)){NEWDLBUCKET(r);(c)=(r);}else{NEWDLBUCKET(NEXT(c));(c)=NEXT(c);}
1.29 noro 788: #define NEXTVL(r,c) \
789: if(!(r)){NEWVL(r);(c)=(r);}else{NEWVL(NEXT(c));(c)=NEXT(c);}
790: #define NEXTDPP(r,c) \
791: if(!(r)){NEWDPP(r);(c)=(r);}else{NEWDPP(NEXT(c));(c)=NEXT(c);}
1.1 noro 792:
793: /* convertors */
794: #define NTOQ(n,s,q) \
795: (!(n)?((q)=0):(NEWQ(q),SGN(q)=(s),NM(q)=(n),DN(q)=0,(q)))
796: #define NDTOQ(n,d,s,q) \
797: ((!(d)||UNIN(d))?NTOQ(n,s,q):(NEWQ(q),SGN(q)=(s),NM(q)=(n),DN(q)=(d),(q)))
798: #define DUPQ(p,q) \
799: (NEWQ(q),SGN(q)=SGN(p),NM(q)=NM(p),DN(q)=DN(p))
800: #define STOQ(n,q) \
801: ((!(n))?((q)=(Q)NULL):(NEWQ(q),\
802: SGN(q)=((n)>0?1:-1),NM(q)=NALLOC(1),\
803: PL(NM(q))=1,BD(NM(q))[0]=ABS(n),DN(q)=0,(q)))
804: #define UTOMQ(a,b) \
805: ((a)?(NEWMQ(b),CONT(b)=(unsigned int)(a),(b)):((b)=0))
1.12 noro 806: #define MKGFS(a,b) \
807: ((NEWGFS(b),CONT(b)=(a),(b)))
1.21 noro 808: #define MKGFSN(a,b) \
809: ((DEG(a)>=0)?(NEWGFSN(b),BDY(b)=(a),(b)):((b)=0))
1.1 noro 810: #define STOMQ(a,b) \
811: ((a)?(NEWMQ(b),CONT(b)=(a),(b)):((b)=0))
812: #define UTON(u,n) \
813: ((!(u))?((n)=(N)NULL):((n)=NALLOC(1),PL(n)=1,BD(n)[0]=(unsigned int)(u),(n)))
814: #define UTOQ(n,q) \
815: ((!(n))?((q)=(Q)NULL):(NEWQ(q),\
816: SGN(q)=1,NM(q)=NALLOC(1),\
817: PL(NM(q))=1,BD(NM(q))[0]=(unsigned int)(n),DN(q)=0,(q)))
818: #define QTOS(q) (!(q)?0:SGN(q)*((int)BD(NM(q))[0]))
819: #define STON(i,n)\
820: (i?((n)=NALLOC(1),PL(n)=1,BD(n)[0]=(i),(n)):((n)=(N)0))
821: #define PTOR(a,b) \
822: (!(a)?((b)=0):(NEWR(b),NM(b)=(a),DN(b)=(P)ONE,(b)->reduced=1,(b)))
823: #define RTOS(a) (!(a)?0:QTOS((Q)NM((R)a)))
824: #define MKReal(a,b) (!(a)?((b)=0):(NEWReal(b),BDY(b)=(a),(b)))
825: #define MKAlg(b,r) \
826: (!(b)?((r)=0):NUM(b)?((r)=(Alg)(b)):(NEWAlg(r),BDY(r)=(Obj)(b),(r)))
827:
1.35 ohara 828: #if defined(PARI)
1.3 noro 829: #define ToReal(a) (!(a)?(double)0.0:REAL(a)?BDY((Real)a):RATN(a)?RatnToReal((Q)a):BIGFLOAT(a)?rtodbl(BDY((BF)a)):0)
830: #else
831: #define ToReal(a) (!(a)?(double)0.0:REAL(a)?BDY((Real)a):RATN(a)?RatnToReal((Q)a):0.0)
832: #endif
1.1 noro 833:
834: /* predicates */
835: #define NUM(p) (OID(p)==O_N)
836: #define RAT(p) (OID(p)==O_R)
837: #define RATN(a) (NID(a)==N_Q)
1.22 noro 838: #define INT(q) (!(q)||(NUM(q)&&RATN((Num)q)&&!DN((Q)q)))
1.1 noro 839: #define REAL(a) (NID(a)==N_R)
1.3 noro 840: #define BIGFLOAT(a) (NID(a)==N_B)
1.1 noro 841: #define SFF(a) (NID(a)==N_M)
842: #define UNIQ(q) ((q)&&NUM(q)&&RATN(q)&&(SGN((Q)q)==1)&&UNIN(NM((Q)q))&&(!DN((Q)q)))
843: #define UNIMQ(q) ((q)&&NUM(q)&&SFF(q)&&(CONT((MQ)q)==1))
844: #define MUNIQ(q) ((q)&&NUM(q)&&RATN(q)&&(SGN((Q)q)==-1)&&UNIN(NM((Q)q))&&(!DN((Q)q)))
845: #define MUNIMQ(q) ((q)&&NUM(q)&&SFF(q)&&(CONT((MQ)q)==-1))
846: #define UNIN(n) ((n)&&(PL(n)==1)&&(BD(n)[0]==1))
847: #define EVENN(n) ((!(n))||(!(BD(n)[0]%2)))
848:
1.8 noro 849: /* special macros for private memory management */
850:
851: #define NV(p) ((p)->nv)
852: #define C(p) ((p)->c)
1.28 noro 853: #if 0
1.8 noro 854: #define ITOS(p) (((unsigned int)(p))&0x7fffffff)
855: #define STOI(i) ((P)((unsigned int)(i)|0x80000000))
1.28 noro 856: #else
857: #define ITOS(p) (((unsigned int)(p)))
858: #define STOI(i) ((P)((unsigned int)(i)))
859: #endif
1.15 noro 860:
861: /* immediate GFS representation */
862:
863: #define IFTOF(p) ((int)(((unsigned int)(p))&0x7fffffff))
864: #define FTOIF(i) ((int)(((unsigned int)(i)|0x80000000)))
1.8 noro 865:
866: struct cdl {
867: P c;
868: DL d;
869: };
870:
871: struct cdlm {
872: int c;
873: DL d;
874: };
875:
876: extern MP _mp_free_list;
877: extern DP _dp_free_list;
878: extern DL _dl_free_list;
879: extern int current_dl_length;
880:
881: #define _NEWDL_NOINIT(d,n) if ((n)!= current_dl_length){_dl_free_list=0; current_dl_length=(n);} if(!_dl_free_list)_DL_alloc(); (d)=_dl_free_list; _dl_free_list = *((DL *)_dl_free_list)
882: #define _NEWDL(d,n) if ((n)!= current_dl_length){_dl_free_list=0; current_dl_length=(n);} if(!_dl_free_list)_DL_alloc(); (d)=_dl_free_list; _dl_free_list = *((DL *)_dl_free_list); bzero((d),(((n)+1)*sizeof(int)))
883: #define _NEWMP(m) if(!_mp_free_list)_MP_alloc(); (m)=_mp_free_list; _mp_free_list = NEXT(_mp_free_list)
1.10 noro 884: #define _MKDP(n,m,d) if(!_dp_free_list)_DP_alloc(); (d)=_dp_free_list; _dp_free_list = (DP)BDY(_dp_free_list); (d)->id = O_DP; (d)->nv=(n); BDY(d)=(m)
1.8 noro 885:
886: #define _NEXTMP(r,c) \
887: if(!(r)){_NEWMP(r);(c)=(r);}else{_NEWMP(NEXT(c));(c)=NEXT(c);}
888:
889: #define _NEXTMP2(r,c,s) \
890: if(!(r)){(c)=(r)=(s);}else{NEXT(c)=(s);(c)=(s);}
891:
892: #define _FREEDL(m) *((DL *)m)=_dl_free_list; _dl_free_list=(m)
893: #define _FREEMP(m) NEXT(m)=_mp_free_list; _mp_free_list=(m)
894: #define _FREEDP(m) BDY(m)=(MP)_dp_free_list; _dp_free_list=(m)
1.1 noro 895:
1.33 noro 896: #define MUL_WEIGHT(a,i) (current_dl_weight_vector?(a)*current_dl_weight_vector[i]:(a))
897:
1.1 noro 898: /* externals */
899: #if 0
900: double NatToReal();
901: double RatnToReal();
902: #endif
903:
904: extern struct oR oUNIR;
905: extern struct oQ oUNIQ;
906: extern struct oMQ oUNIMQ;
907: extern struct oN oUNIN;
908: extern struct oUP2 oONEUP2;
909: extern struct oV oVAR[];
910: extern struct oV oPVAR[];
911: extern struct oVL oVLIST[];
912: extern struct oVL oPVLIST[];
913: extern VL CO,ALG;
914: extern VL PVL;
915: extern R ONER;
916: extern Q ONE;
1.38 saito 917: extern Q TWO;
1.1 noro 918: extern MQ ONEM;
919: extern LM ONELM;
920: extern N ONEN;
921: extern UP2 ONEUP2;
922:
923: extern FILE *asir_out;
1.7 noro 924: #if defined(__GNUC__)
1.1 noro 925: extern const int sprime[];
926: #else
927: extern int sprime[];
928: #endif
1.14 noro 929:
930: extern int lprime_size;
931: extern int *lprime;
1.1 noro 932:
933: extern void (*addnumt[])();
934: extern void (*subnumt[])();
935: extern void (*mulnumt[])();
936: extern void (*divnumt[])();
937: extern void (*pwrnumt[])();
938: extern int (*cmpnumt[])();
939: extern void (*chsgnnumt[])();
940:
1.29 noro 941: extern int current_mod;
942: extern GEN_UP2 current_mod_gf2n;
943: extern int lm_lazy;
944: extern int current_ff;
945: extern V up_var;
946: extern V up2_var;
947: extern P current_gfs_ext;
948: extern int current_gfs_p;
949: extern int current_gfs_q;
950: extern int current_gfs_q1;
951: extern int *current_gfs_plus1;
952: extern int *current_gfs_ntoi;
953: extern int *current_gfs_iton;
1.33 noro 954:
955: extern int *current_dl_weight_vector;
1.29 noro 956:
1.1 noro 957: /* prototypes */
958: int compui(VL,USINT,USINT);
1.6 noro 959: int compbytearray(VL,BYTEARRAY,BYTEARRAY);
1.1 noro 960:
961: void powermodup(UP,UP *);
962: void hybrid_powermodup(UP,UP *);
963:
964: void powertabup(UP,UP,UP *);
965: void hybrid_powertabup(UP,UP,UP *);
966:
967: void generic_powermodup(UP,UP,Q,UP *);
968: void hybrid_generic_powermodup(UP,UP,Q,UP *);
969:
970: void powermod1up(UP,UP *);
971: void hybrid_rembymulup_special(int,UP,UP,UP,UP *);
972: void hybrid_tmulup(int,UP,UP,int,UP *);
973: void hybrid_squareup(int,UP,UP *);
974: void hybrid_mulup(int,UP,UP,UP *);
975:
976: void getmod_lm(N *);
977:
978: int maxblenup(UP);
979: void monicup(UP,UP *);
980: void simpup(UP,UP *);
981: void simpnum(Num,Num *);
982: void decompp(P,Q,P *,P *);
983: void truncp(P,Q,P *);
984: void uremp(P,P,P *);
985: void ugcdp(P,P,P *);
986: void reversep(P,Q,P *);
987: void invmodp(P,Q,P *);
988: void addup(UP,UP,UP *);
989: void subup(UP,UP,UP *);
990: void chsgnup(UP,UP *);
991: void mulup(UP,UP,UP *);
992: void tmulup(UP,UP,int,UP *);
993: void squareup(UP,UP *);
994: void remup(UP,UP,UP *);
995: void remup_destructive(UP,UP);
996: void qrup(UP,UP,UP *,UP *);
997: void qrup_destructive(UP,UP);
998: void gcdup(UP,UP,UP *);
999: void reverseup(UP,int,UP *);
1000: void invmodup(UP,int,UP *);
1001: void pwrup(UP,Q,UP *);
1002: void squarep_gf2n(VL,P,P *);
1003: void kmulp(VL,P,P,P *);
1004: void ksquarep(VL,P,P *);
1005: void kmulup(UP,UP,UP *);
1006: void ksquareup(UP,UP *);
1007: void extractup(UP,int,int,UP *);
1008: void copyup(UP,UP);
1009: void c_copyup(UP,int,pointer *);
1010: void kmulupmain(UP,UP,UP *);
1011: void ksquareupmain(UP,UP *);
1012: void rembymulup(UP,UP,UP *);
1013: void rembymulup_special(UP,UP,UP,UP *);
1014: void tkmulup(UP,UP,int,UP *);
1015: void shiftup(UP,int,UP *);
1016: void set_degreeup(UP,int);
1017: void decompup(UP,int,UP *,UP *);
1018: void truncup(UP,int,UP *);
1019: void uptofmarray(int,UP,ModNum *);
1020: void fmarraytoup(ModNum *,int,UP *);
1021: void uiarraytoup(unsigned int **,int,int,UP *);
1022: void adj_coefup(UP,N,N,UP *);
1023: void uptolmup(UP,UP *);
1024: void remcup(UP,N,UP *);
1025: void fft_mulup(UP,UP,UP *);
1026: void fft_squareup(UP,UP *);
1027: void trunc_fft_mulup(UP,UP,int,UP *);
1028: void shoup_fft_mulup(UP,UP,UP *);
1029: void shoup_fft_squareup(UP,UP *);
1030: void shoup_trunc_fft_mulup(UP,UP,int,UP *);
1031: void crup(ModNum **,int,int *,int,N,UP *);
1032: void shoup_crup(ModNum **,int,int *,int,N,N,UP *);
1033: void squareup_gf2n(UP,UP *);
1034: void powermodup_gf2n(UP,UP *);
1035: void generic_powermodup_gf2n(UP,UP,Q,UP *);
1036: void tracemodup_gf2n(UP,UP,Q,UP *);
1037: void tracemodup_gf2n_slow(UP,UP,Q,UP *);
1038: void tracemodup_gf2n_tab(UP,UP,Q,UP *);
1039: void square_rem_tab_up_gf2n(UP,UP *,UP *);
1040: void powertabup_gf2n(UP,UP,UP *);
1041: void find_root_gf2n(UP,GF2N *);
1042:
1.44 noro 1043: int cmpdl_composite(int,DL,DL);
1.1 noro 1044: int cmpdl_matrix(int,DL,DL);
1045: int cmpdl_order_pair(int,DL,DL);
1046: int cmpdl_elim(int,DL,DL);
1047: int cmpdl_blexrev(int,DL,DL);
1048: int cmpdl_bgradrev(int,DL,DL);
1049: int cmpdl_brevrev(int,DL,DL);
1050: int cmpdl_brevgradlex(int,DL,DL);
1051: int cmpdl_bgradlex(int,DL,DL);
1052: int cmpdl_blex(int,DL,DL);
1053: int cmpdl_revgradlex(int,DL,DL);
1054: int cmpdl_gradlex(int,DL,DL);
1055: int cmpdl_revlex(int,DL,DL);
1056: int cmpdl_lex(int,DL,DL);
1057: int compd(VL,DP,DP);
1058: void adddl(int,DL,DL,DL *);
1059: void divsdc(VL,DP,P,DP *);
1060: void muldc(VL,DP,P,DP *);
1061: void muldm(VL,DP,MP,DP *);
1062: void muld(VL,DP,DP,DP *);
1063: void chsgnd(DP,DP *);
1064: void subd(VL,DP,DP,DP *);
1065: void addd(VL,DP,DP,DP *);
1066: int sugard(MP);
1067: void nodetod(NODE,DP *);
1068: void dtop(VL,VL,DP,P *);
1069: void ptod(VL,VL,P,DP *);
1070: void initd(struct order_spec *);
1071:
1072: void _printdp(DP);
1073: void _dp_sp_mod(DP,DP,int,DP *);
1074: void _dp_mod(DP,int,NODE,DP *);
1075: void _dp_red_mod(DP,DP,int,DP *);
1076: void _dtop_mod(VL,VL,DP,P *);
1077: void _mulmdm(VL,int,DP,MP,DP *);
1078: void _mulmd(VL,int,DP,DP,DP *);
1079: void _chsgnmd(int,DP,DP *);
1080: void _submd(VL,int,DP,DP,DP *);
1081: void _addmd(VL,int,DP,DP,DP *);
1082: void _mdtop(VL,int,VL,DP,P *);
1083: void divsmdc(VL,int,DP,P,DP *);
1084: void mulmdc(VL,int,DP,P,DP *);
1085: void mulmdm(VL,int,DP,MP,DP *);
1086: void mulmd(VL,int,DP,DP,DP *);
1087: void chsgnmd(int,DP,DP *);
1088: void submd(VL,int,DP,DP,DP *);
1089: void addmd(VL,int,DP,DP,DP *);
1090: void mdtop(VL,int,VL,DP,P *);
1091: void mptomd(VL,int,VL,P,DP *);
1092: void ptomd(VL,int,VL,P,DP *);
1093: int p_mag(P);
1094: int n_bits(N);
1095: void gcdBinary_27n(N,N,N *);
1096: void rtime_init(void);
1097: void setmod_gf2n(P);
1098: void mt_sgenrand(unsigned long);
1099: unsigned long mt_genrand(void);
1100: #if defined(VISUAL)
1101: void srandom(unsigned int);
1102: unsigned int random(void);
1103: #endif
1104: void gcdbmodn(N,N,N *);
1105: void gcdbinn(N,N,N *);
1106: void gcdmodn(N,N,N *);
1107: void gcdaccn(N,N,N *);
1108: void gcdEuclidn(N,N,N *);
1109: void GC_free(void *);
1110: void FFT_primes(int,int *,int *,int *);
1111: int FFT_pol_product(unsigned int,unsigned int *, unsigned int,unsigned int *,
1112: unsigned int *,int,unsigned int *);
1113: int FFT_pol_square(unsigned int,unsigned int *,
1114: unsigned int *,int,unsigned int *);
1115: void dcptolist(DCP,LIST *);
1116: void gcdprsmp(VL,int,P,P,P *);
1117: void mult_mod_tab(UM,int,UM *,UM,int);
1118: int nfctr_mod(UM,int);
1119: int irred_check(UM,int);
1120: void modfctrp(P,int,int,DCP *);
1121: void pf_init(void);
1122: void binaryton(char *,N *);
1123: void hexton(char *,N *);
1124: void ptolmp(P,P *);
1125: void lmptop(P,P *);
1126: void ulmptoum(int,UP,UM);
1127: void objtobobj(int,Obj,Obj *);
1128: void bobjtoobj(int,Obj,Obj *);
1129: void numtobnum(int,Num,Num *);
1130: void bnumtonum(int,Num,Num *);
1131: void ptobp(int,P,P *);
1132: void bptop(int,P,P *);
1133: void listtoblist(int,LIST,LIST *);
1134: void blisttolist(int,LIST,LIST *);
1135: void vecttobvect(int,VECT,VECT *);
1136: void bvecttovect(int,VECT,VECT *);
1137: void mattobmat(int,MAT,MAT *);
1138: void bmattomat(int,MAT,MAT *);
1139: void n32ton27(N,N *);
1140: void n27ton32(N,N *);
1141: void kmulum(int,UM,UM,UM);
1142: void saveobj(FILE *,Obj);
1143: void endian_init(void);
1144: void write_char(FILE *,unsigned char *);
1145: void write_short(FILE *,unsigned short *);
1146: void write_int(FILE *,unsigned int *);
1147: void write_double(FILE *,double *);
1148: void write_intarray(FILE *,unsigned int *,int);
1149: void write_string(FILE *,unsigned char *,int);
1150: void savestr(FILE *,char *);
1151: void loadstr(FILE *,char **);
1152: void savevl(FILE *,VL);
1153: void loadvl(FILE *);
1154: void skipvl(FILE *);
1155: void savev(FILE *,V);
1156: void loadv(FILE *,V *);
1157: int save_convv(V);
1158: V load_convv(int);
1159: void swap_bytes(char *,int,int);
1160: void read_char(FILE *,unsigned char *);
1161: void read_short(FILE *,unsigned short *);
1162: void read_int(FILE *,unsigned int *);
1163: void read_double(FILE *,double *);
1164: void read_intarray(FILE *,unsigned int *,int);
1165: void read_string(FILE *,unsigned char *,int);
1166: void loadobj(FILE *,Obj *);
1167: void invum(int,UM,UM,UM);
1168: void addarray_to(unsigned int *,int,unsigned int *,int);
1169: void muln_1(unsigned int *,int,unsigned int,unsigned int *);
1170: unsigned int divn_1(unsigned int *,int,unsigned int,unsigned int *);
1171: void ptoup(P,UP *);
1172: void uptop(UP,P *);
1173: void printnum(Num);
1174: void printv(VL,V);
1175: void kmulq(Q,Q,Q *);
1176: void bshiftn(N,int,N *);
1177: void remn(N,N,N*);
1178: void simplm(LM,LM *);
1179: void qtolm(Q,LM *);
1180: int qpcheck(Obj);
1181: int headsgn(P);
1182: void adjsgn(P,DCP);
1183: void setmod_g2n(P);
1184: void simpgf2n(GF2N,GF2N *);
1185: void ptogf2n(Obj,GF2N *);
1186: void gf2ntop(GF2N,P *);
1187: void gf2ntovect(GF2N,VECT *);
1188: void squaregf2n(GF2N,GF2N *);
1189: void randomgf2n(GF2N *);
1190: void invgf2n(GF2N,GF2N *);
1191: void kmuln(N,N,N *);
1192: void extractn(N,int,int,N *);
1193: void copyn(N,int,int *);
1194: void kmulnmain(N,N,N *);
1195: int qcoefp(Obj);
1196: int qcoefr(Obj);
1197: int get_allocwords(void);
1198: double get_clock(void);
1199: void get_eg(struct oEGT *);
1200: void printtime(struct oEGT *,struct oEGT *,double);
1201: void init_eg(struct oEGT *);
1202: void add_eg(struct oEGT *,struct oEGT *,struct oEGT *);
1203: void print_eg(char *,struct oEGT *);
1204: void print_split_eg(struct oEGT *,struct oEGT *);
1205: void print_split_e(struct oEGT *,struct oEGT *);
1206: void suspend_timer(void);
1207: void resume_timer(void);
1208: void reset_engine(void);
1209: void notdef(VL,Obj,Obj,Obj *);
1210: void error(char *);
1211: void ptoup2(P,UP2 *);
1212: void ptoup2_sparse(P,UP2 *);
1213: void up2top(UP2,P *);
1214: void up2tovect(UP2,VECT *);
1215: void up2ton(UP2,Q *);
1216: void ntoup2(Q,UP2 *);
1217: void gen_simpup2(UP2,GEN_UP2,UP2 *);
1218: void gen_simpup2_destructive(UP2,GEN_UP2);
1219: void gen_invup2(UP2,GEN_UP2,UP2 *);
1220: void gen_pwrmodup2(UP2,Q,GEN_UP2,UP2 *);
1221: void simpup2(UP2,UP2,UP2 *);
1222: int degup2(UP2);
1223: int degup2_sparse(UP2);
1224: int degup2_1(unsigned int);
1225: void addup2(UP2,UP2,UP2 *);
1226: void subup2(UP2,UP2,UP2 *);
1227: void mulup2_n1(unsigned int *,int,unsigned int,unsigned int *);
1228: void mulup2_nh(unsigned int *,int,unsigned int,unsigned int *);
1229: void _mulup2_1(UP2,unsigned int,UP2);
1230: void _mulup2_h(UP2,unsigned int,UP2);
1231: void mulup2(UP2,UP2,UP2 *);
1232: void _kmulup2_(unsigned int *,unsigned int *,int,unsigned int *);
1233: void _mulup2_nn(unsigned int *,unsigned int *,int,unsigned int *);
1234: void _mulup2(UP2,UP2,UP2);
1235: void _mulup2_(_UP2,_UP2,_UP2);
1236: void squareup2(UP2,UP2 *);
1237: void _adjup2(UP2);
1238: void _adjup2_(_UP2);
1239: void _addup2(UP2,UP2,UP2);
1240: void _addup2_destructive(UP2,UP2);
1241: void _addup2_(_UP2,_UP2,_UP2);
1242: void _addtoup2_(_UP2,_UP2);
1243: unsigned int mulup2_bb(unsigned int,unsigned int);
1244: void init_up2_tab(void);
1245: unsigned int quoup2_11(unsigned int,unsigned int);
1246: void divup2_1(unsigned int,unsigned int,int,int,unsigned int *,unsigned int *);
1247: void qrup2(UP2,UP2,UP2 *,UP2 *);
1248: void _qrup2(UP2,UP2,UP2,UP2);
1249: void remup2(UP2,UP2,UP2 *);
1250: void _remup2(UP2,UP2,UP2);
1251: void remup2_sparse(UP2,UP2,UP2 *);
1252: void remup2_sparse_destructive(UP2,UP2);
1253: void remup2_type1_destructive(UP2,int);
1254: void remup2_3_destructive(UP2,UP2);
1255: void remup2_5_destructive(UP2,UP2);
1256: void _invup2_1(unsigned int,unsigned int,unsigned int *,unsigned int *);
1257: void _gcdup2_1(unsigned int,unsigned int,unsigned int *);
1258: void up2_init_eg(void);
1259: void up2_show_eg(void);
1260: void invup2(UP2,UP2,UP2 *);
1261: void gcdup2(UP2,UP2,UP2 *);
1262: void chsgnup2(UP2,UP2 *);
1263: void pwrmodup2(UP2,Q,UP2,UP2 *);
1264: void pwrmodup2_sparse(UP2,Q,UP2,UP2 *);
1265: int compup2(UP2,UP2);
1266: void printup2(UP2);
1267: void _copyup2(UP2,UP2);
1268: void _bshiftup2(UP2,int,UP2);
1269: void _bshiftup2_destructive(UP2,int);
1270: void diffup2(UP2,UP2 *);
1271: int sqfrcheckup2(UP2);
1272: int irredcheckup2(UP2);
1273: int irredcheck_dddup2(UP2);
1274: void _copy_up2bits(UP2,unsigned int **,int);
1275: void _print_frobmat(unsigned int **,int,int);
1276: int compute_multiplication_matrix(P,GF2MAT *);
1277: void compute_change_of_basis_matrix(P,P,int,GF2MAT *,GF2MAT *);
1278: int compute_representation_conversion_matrix(P,GF2MAT *,GF2MAT *);
1279: void mul_nb(GF2MAT,unsigned int *,unsigned int *,unsigned int *);
1280: void leftshift(unsigned int *,int);
1281: void mat_to_gf2mat(MAT,unsigned int ***);
1282: void gf2mat_to_mat(unsigned int **,int,MAT *);
1283: void mulgf2mat(int,unsigned int **,unsigned int **,unsigned int **);
1284: void mulgf2vectmat(int,unsigned int *,unsigned int **,unsigned int *);
1285: int mulgf2vectvect(int,unsigned int *,unsigned int *);
1286: int invgf2mat(int,unsigned int **,unsigned int **);
1287: void _mulup2_11(unsigned int,unsigned int,unsigned int *);
1288: void _mulup2_22(unsigned int *,unsigned int *,unsigned int *);
1289: void _mulup2_33(unsigned int *,unsigned int *,unsigned int *);
1290: void _mulup2_44(unsigned int *,unsigned int *,unsigned int *);
1291: void _mulup2_55(unsigned int *,unsigned int *,unsigned int *);
1292: void _mulup2_66(unsigned int *,unsigned int *,unsigned int *);
1293: void printup2_(unsigned int *,int);
1294: void type1_bin_invup2(UP2,int,UP2 *);
1295: int int_bits(int);
1296:
1297:
1298: LUM LUMALLOC(int, int);
1.16 noro 1299: BM BMALLOC(int, int);
1.1 noro 1300: Obj ToAlg(Num);
1301: UM *berlemain(register int, UM, UM *);
1302: void *Risa_GC_malloc(size_t);
1303: void *Risa_GC_malloc_atomic(size_t);
1304: void *Risa_GC_realloc(void *,size_t);
1305: void *GC_malloc(size_t);
1306: void *GC_malloc_atomic(size_t);
1307: void *GC_realloc(void *,size_t);
1308: double NatToReal(N,int *);
1309: double RatnToReal(Q);
1310: double pwrreal0(double,int);
1.3 noro 1311: double rtodbl(); /* XXX */
1.1 noro 1312: int **almat(int,int);
1313: pointer **almat_pointer(int,int);
1314: int berlecnt(register int,UM);
1315: int berlecntmain(register int,int,int,register int **);
1316: int cmpalg(Num,Num);
1317: int cmpbf(Num,Num);
1318: int cmpcplx(Num,Num);
1319: int cmpn(N,N);
1320: int cmpq(Q,Q);
1321: int cmpreal(Real,Real);
1322: int cmpmi(MQ,MQ);
1323: int cmplm(LM,LM);
1324: int compmat(VL,MAT,MAT);
1325: int compnum(VL,Num,Num);
1326: int compp(VL,P,P);
1327: int compr(VL,Obj,Obj);
1328: int compstr(VL,STRING,STRING);
1329: int compvect(VL,VECT,VECT);
1330: int ctest(P,ML,int,int *);
1331: int cycchk(P);
1332: int dbound(V,P);
1333: int dcomp(P,P);
1334: int deg(V,P);
1335: int degtest(int,int *,ML,int);
1336: int divcheck(VL,P *,int,P,P);
1337: unsigned int divin(N,unsigned int,N *);
1338: int divtdcpz(VL,P,P,P *);
1339: int divtpz(VL,P,P,P *);
1340: int divum(register int,UM,UM,UM);
1341: int dm(int,int,int *);
1342: int dmb(int,int,int,int *);
1343: int dma(int,int,int,int *);
1344: int dmab(int,int,int,int,int *);
1345: int dmar(int,int,int,int);
1346: int dtestmain(P,Q,ML,int,int *,P *,P *);
1347: int geldb(VL,P);
1348: int getchomdeg(V,P);
1349: int getdeg(V,P);
1350: int getlchomdeg(V,P,int *);
1.29 noro 1351: int get_lprime(int);
1.1 noro 1352: int homdeg(P);
1353: unsigned int invm(unsigned int,int);
1354: int iscycm(P);
1355: int iscycp(P);
1356: int lengthp(P);
1357: int mig(int,int,P);
1358: int mignotte(int,P);
1359: int minimain(register int,int,int,register int **);
1360: int ncombi(int,int,int,int *);
1361: int nextbin(VN,int);
1362: int nmonop(P);
1363: int pcoef(VL,VL,P,P *);
1364: int pcoef0(VL,VL,P,P *);
1365: unsigned int pwrm(register int,register int,int);
1.29 noro 1366: unsigned int rem(N,int);
1.1 noro 1367: int sqfrchk(P);
1368: int subn(N,N,N *);
1369: int ucmpp(P,P);
1370: int valideval(VL,DCP,VN);
1371: int zerovpchk(VL,P,VN);
1372:
1373: void addgf2n(GF2N,GF2N,GF2N *);
1374: void subgf2n(GF2N,GF2N,GF2N *);
1375: void mulgf2n(GF2N,GF2N,GF2N *);
1376: void divgf2n(GF2N,GF2N,GF2N *);
1377: void chsgngf2n(GF2N,GF2N *);
1378: void pwrgf2n(GF2N,Q, GF2N *);
1379: int cmpgf2n(GF2N,GF2N);
1380:
1381: void addgfpn(GFPN,GFPN,GFPN *);
1382: void subgfpn(GFPN,GFPN,GFPN *);
1383: void mulgfpn(GFPN,GFPN,GFPN *);
1384: void divgfpn(GFPN,GFPN,GFPN *);
1385: void chsgngfpn(GFPN,GFPN *);
1386: void pwrgfpn(GFPN,Q, GFPN *);
1387: int cmpgfpn(GFPN,GFPN);
1.12 noro 1388:
1389: void addgfs(GFS,GFS,GFS *);
1390: void subgfs(GFS,GFS,GFS *);
1391: void mulgfs(GFS,GFS,GFS *);
1392: void divgfs(GFS,GFS,GFS *);
1393: void chsgngfs(GFS,GFS *);
1394: void pwrgfs(GFS,Q, GFS *);
1395: int cmpgfs(GFS,GFS);
1.20 noro 1396:
1.21 noro 1397: void addgfsn(GFSN,GFSN,GFSN *);
1398: void subgfsn(GFSN,GFSN,GFSN *);
1399: void mulgfsn(GFSN,GFSN,GFSN *);
1400: void divgfsn(GFSN,GFSN,GFSN *);
1401: void chsgngfsn(GFSN,GFSN *);
1402: void pwrgfsn(GFSN,Q, GFSN *);
1403: int cmpgfsn(GFSN,GFSN);
1.1 noro 1404:
1405: void addalg(Num,Num,Num *);
1406: void addbf(Num,Num,Num *);
1407: void addcplx(Num,Num,Num *);
1408: void addm2p(VL,Q,Q,P,P,P *);
1409: void addm2q(Q,Q,Q,Q,Q *);
1410: void addmat(VL,MAT,MAT,MAT *);
1411: void addmp(VL,int,P,P,P *);
1412: void addmpq(int,P,P,P *);
1413: void addmptoc(VL,int,P,P,P *);
1414: void addmq(int,MQ,MQ,MQ *);
1415: void addn(N,N,N *);
1416: void addnum(VL,Num,Num,Num *);
1417: void addp(VL,P,P,P *);
1418: void addpadic(int,int,unsigned int *,unsigned int *);
1419: void addpq(P,P,P *);
1420: void addptoc(VL,P,P,P *);
1421: void addq(Q,Q,Q *);
1422: void addr(VL,Obj,Obj,Obj *);
1423: void addreal(Num,Num,Real *);
1424: void addmi(MQ,MQ,MQ *);
1425: void addlm(LM,LM,LM *);
1426: void addstr(VL,STRING,STRING,STRING *);
1427: void addum(int,UM,UM,UM);
1428: void addvect(VL,VECT,VECT,VECT *);
1.19 noro 1429: void addquote(VL,QUOTE,QUOTE,QUOTE *);
1.1 noro 1430: void adjc(VL,P,P,P,Q,P *,P *);
1431: void afctr(VL,P,P,DCP *);
1432: void afctrmain(VL,P,P,int,DCP *);
1433: void affine(VL,P,VN,P *);
1434: void affinemain(VL,P,V,int,P *,P *);
1435: void berle(int,int,P,ML *);
1436: void bnton(register int,N,N *);
1437: void cbound(VL,P,Q *);
1438: void chnrem(int,V,P,Q,UM,P *,Q *);
1439: void chnremp(VL,int,P,Q,P,P *);
1440: void chsgnalg(Num,Num *);
1441: void chsgnbf(Num a,Num *);
1442: void chsgncplx(Num,Num *);
1443: void chsgnmat(MAT,MAT *);
1444: void chsgnmp(int,P,P *);
1445: void chsgnnum(Num,Num *);
1446: void chsgnp(P,P *);
1447: void chsgnq(Q,Q *);
1448: void chsgnr(Obj,Obj *);
1449: void chsgnreal(Num,Num *);
1450: void chsgnmi(MQ,MQ *);
1451: void chsgnlm(LM,LM *);
1452: void chsgnvect(VECT,VECT *);
1.19 noro 1453: void chsgnquote(QUOTE,QUOTE *);
1.1 noro 1454: void clctv(VL,P,VL *);
1455: void clctvr(VL,Obj,VL *);
1456: void cm2p(Q,Q,P,P *);
1457: void cmax(P,Q *);
1458: void cmp(Q,P,P *);
1459: void coefp(P,int,P *);
1460: void cpylum(int,LUM,LUM);
1461: void cpyum(UM,UM);
1462: void csump(VL,P,Q *);
1463: void cycm(V,register int,DCP *);
1464: void cycp(V,register int,DCP *);
1465: void degp(V,P,Q *);
1466: void degum(UM,int);
1467: void detmp(VL,int,P **,int,P *);
1468: void detp(VL,P **,int,P *);
1469: void diffp(VL,P,V,P *);
1470: void diffum(register int,UM,UM);
1471: void divalg(Num,Num,Num *);
1472: void divbf(Num,Num,Num *);
1473: void divcp(P,Q,P *);
1474: void divcplx(Num,Num,Num *);
1475: void divmat(VL,Obj,Obj,Obj *);
1476: void divmq(int,MQ,MQ,MQ *);
1477: void divn(N,N,N *,N *);
1478: void divnmain(int,int,unsigned int *,unsigned int *,unsigned int *);
1479: void divnum(VL,Num,Num,Num *);
1480: void divq(Q,Q,Q *);
1481: void divr(VL,Obj,Obj,Obj *);
1482: void divreal(Num,Num,Real *);
1483: void divmi(MQ,MQ,MQ *);
1484: void divlm(LM,LM,LM *);
1485: void divsdcmp(VL,int,P,P,P *);
1486: void divsdcp(VL,P,P,P *);
1487: void divsmp(VL,int,P,P,P *);
1488: void divsn(N,N,N *);
1489: void divsp(VL,P,P,P *);
1490: void divsrdcmp(VL,int,P,P,P *,P *);
1491: void divsrdcp(VL,P,P,P *,P *);
1492: void divsrmp(VL,int,P,P,P *,P *);
1493: void divsrp(VL,P,P,P *,P *);
1494: void divvect(VL,Obj,Obj,Obj *);
1.19 noro 1495: void divquote(VL,QUOTE,QUOTE,QUOTE *);
1.1 noro 1496: void dtest(P,ML,int,DCP *);
1497: void dtestroot(int,int,P,LUM,struct oDUM *,DCP *);
1498: void dtestroot1(int,int,P,LUM,P *);
1499: void dtestsq(int,int,P,LUM,P *);
1500: void dtestsql(P,ML,struct oDUM *,DCP *);
1.41 ohara 1501: void ediffp(VL,P,V,P *);
1.1 noro 1502: void estimatelc(VL,Q,DCP,VN,P *);
1503: void eucum(register int,UM,UM,UM,UM);
1504: void exthp(VL,P,int,P *);
1505: void exthpc(VL,V,P,int,P *);
1506: void ezgcd1p(VL,P,P,P *);
1507: void ezgcdhensel(P,int,UM,UM,ML *);
1508: void ezgcdnp(VL,P,P *,int,P *);
1509: void ezgcdnpp(VL,DCP,P *,int,P *);
1510: void ezgcdnpz(VL,P *,int,P *);
1511: void ezgcdp(VL,P,P,P *);
1512: void ezgcdpp(VL,DCP,P,P *);
1513: void ezgcdpz(VL,P,P,P *);
1514: void factorial(int,Q *);
1515: void fctrp(VL,P,DCP *);
1516: void fctrwithmvp(VL,P,V,DCP *);
1517: void gcda(VL,P,P,P,P *);
1518: void gcdcp(VL,P,P *);
1519: void gcdgen(P,ML,ML *);
1520: void gcdmonomial(VL,DCP *,int,P *);
1521: void gcdn(N,N,N *);
1522: void gcdprsp(VL,P,P,P *);
1523: void gcdum(register int,UM,UM,UM);
1524: void getmindeg(V,P,Q *);
1525: void henmain(LUM,ML,ML,ML *);
1526: void henmv(VL,VN,P,P,P,P,P,P,P,P,P,Q,int,P *,P *);
1527: void henmvmain(VL,VN,P,P,P,P,P,P,P,Q,Q,int,P *,P *);
1528: void henprep(P,ML,ML,ML *,ML *);
1529: void hensel(int,int,P,ML *);
1530: void henzq(P,P,UM,P,UM,int,int,P *,P *,P *,P *,Q *);
1531: void henzq1(P,P,Q,P *,P *,Q *);
1532: void hsq(int,int,P,int *,DCP *);
1533: void intersectv(VL,VL,VL *);
1534: void invl(Q,Q,Q *);
1535: void invmq(int,MQ,MQ *);
1536: void invq(Q,Q *);
1537: void lgp(P,N *,N *);
1538: void lumtop(V,int,int,LUM,P *);
1539: void markv(VN,int,P);
1540: void maxdegp(VL,P,VL *,P *);
1541: void mergev(VL,VL,VL,VL *);
1542: void mfctr(VL,P,DCP *);
1543: void mfctrhen2(VL,VN,P,P,P,P,P,P,P *);
1544: void mfctrmain(VL,P,DCP *);
1545: void mfctrwithmv(VL,P,V,DCP *);
1546: void min_common_vars_in_coefp(VL,P,VL *,P *);
1547: void minchdegp(VL,P,VL *,P *);
1548: void mindegp(VL,P,VL *,P *);
1549: void mini(register int,UM,UM);
1550: void minlcdegp(VL,P,VL *,P *);
1551: void mkbc(int,Q *);
1552: void mkbcm(int,int,MQ *);
1553: void mkssum(V,int,int,int,P *);
1554: void monomialfctr(VL,P,P *,DCP *);
1555: void mptop(P,P *);
1556: void mptoum(P,UM);
1557: void msqfr(VL,P,DCP *);
1558: void msqfrmain(VL,P,DCP *);
1559: void msqfrmainmain(VL,P,VN,P,DCP,DCP *,P *);
1560: void mulalg(Num,Num,Num *);
1561: void mulbf(Num,Num,Num *);
1562: void mulcplx(Num,Num,Num *);
1563: void mulin(N,unsigned int,unsigned int *);
1564: void mullum(int,int,LUM,LUM,LUM);
1565: void mullumarray(P,ML,int,int *,P *);
1566: void mulm2p(VL,Q,Q,P,P,P *);
1567: void mulm2q(Q,Q,Q,Q,Q *);
1568: void mulmat(VL,Obj,Obj,Obj *);
1569: void mulmatmat(VL,MAT,MAT,MAT *);
1570: void mulmatvect(VL,MAT,VECT,VECT *);
1571: void mulmp(VL,int,P,P,P *);
1572: void mulmpc(VL,int,P,P,P *);
1573: void mulmpq(int,P,P,P *);
1574: void mulmq(int,MQ,MQ,MQ *);
1575: void muln(N,N,N *);
1576: void mulnum(VL,Num,Num,Num *);
1577: void mulp(VL,P,P,P *);
1578: void mulpadic(int,int,unsigned int *,unsigned int *,unsigned int *);
1579: void mulpc(VL,P,P,P *);
1580: void mulpq(P,P,P *);
1581: void mulq(Q,Q,Q *);
1582: void mulr(VL,Obj,Obj,Obj *);
1583: void mulreal(Num,Num,Real *);
1584: void mulmi(MQ,MQ,MQ *);
1585: void mullm(LM,LM,LM *);
1586: void mulrmat(VL,Obj,MAT,MAT *);
1587: void mulrvect(VL,Obj,VECT,VECT *);
1588: void mulsgn(VN,VN,int,VN);
1589: void mulsum(register int,UM,register int,UM);
1590: void mulum(register int,UM,UM,UM);
1591: void mulvect(VL,Obj,Obj,Obj *);
1.19 noro 1592: void mulquote(VL,QUOTE,QUOTE,QUOTE *);
1.1 noro 1593: void mulvectmat(VL,VECT,MAT,VECT *);
1594: void next(VN);
1595: void nezgcdnp_sqfr_primitive(VL,P,P *,int,P *);
1596: void nezgcdnpp(VL,DCP,P *,int,P *);
1597: void nezgcdnpz(VL,P *,int,P *);
1598: void nezgcdnpzmain(VL,P *,int,P *);
1599: void nglob_init(void);
1600: void norm(P,Q *);
1601: void norm1(P,P *);
1602: void norm1c(P,Q *);
1603: void normalizemp(int,P);
1604: void nthrootchk(P,struct oDUM *,ML,DCP *);
1605: void nthrootn(N,int,N *);
1606: void ntobn(register int,N,N *);
1607: void nuezgcdnpzmain(VL,P *,int,P *);
1608: void padictoq(int,int,int *,Q *);
1609: void risa_pari_init(void);
1610: void pcp(VL,P,P *,P *);
1611: void pderivr(VL,Obj,V,Obj *);
1612: void pdiva(VL,P,P,P,P *);
1613: void pinva(P,P,P *);
1614: void plisttop(P *,V,int,P *);
1615: void pmonic(VL,P,P,P *);
1616: void pqra(VL,P,P,P,P *,P *);
1617: void premmp(VL,int,P,P,P *);
1618: void premp(VL,P,P,P *);
1619: void ptolum(int,int,P,LUM);
1620: void ptomp(int,P,P *);
1621: void ptoum(int,P,UM);
1622: void ptozp(P,int,Q *,P *);
1623: void ptozp0(P,P *);
1624: void pwralg(Num,Num,Num *);
1625: void pwrbf(Num,Num,Num *);
1626: void pwrcplx(Num,Num,Num *);
1627: void pwrcplx0(Num,int,Num *);
1628: void pwrlum(int,int,LUM,int,LUM);
1629: void pwrmat(VL,MAT,Obj,MAT *);
1630: void pwrmatmain(VL,MAT,int,MAT *);
1631: void pwrmp(VL,int,P,Q,P *);
1632: void pwrmq(int,MQ,Q,MQ *);
1633: void pwrn(N,int,N *);
1634: void pwrnum(VL,Num,Num,Num *);
1635: void pwrp(VL,P,Q,P *);
1636: void pwrq(Q,Q,Q *);
1637: void pwrr(VL,Obj,Obj,Obj *);
1.19 noro 1638: void pwrquote(VL,QUOTE,QUOTE,QUOTE *);
1.1 noro 1639: void pwrreal(Num,Num,Real *);
1640: void pwrmi(MQ,Q,MQ *);
1641: void pwrlm(LM,Q,LM *);
1642: void pwrum(int,UM,int,UM);
1643: void reallocarray(char **,int *,int *,int);
1644: void reductr(VL,Obj,Obj *);
1645: void reimtocplx(Num,Num,Num *);
1646: void rem2q(Q,Q,Q,Q *);
1647: void rema(VL,P,P,P,P *);
1648: void remq(Q,Q,Q *);
1649: void remsdcp(VL,P,P,P *);
1650: void reordermp(VL,int,VL,P,P *);
1651: void reorderp(VL,VL,P,P *);
1652: void reordvar(VL,V,VL *);
1653: void res_ch_det(VL,V,P,P,P *);
1654: void res_detmp(VL,int,V,P,P,P *);
1655: void restore(VL,P,VN,P *);
1656: void resultmp(VL,int,V,P,P,P *);
1657: void resultp(VL,V,P,P,P *);
1658: void setlum(int,int,LUM);
1659: void sort_by_deg(int,P *,P *);
1660: void sort_by_deg_rev(int,P *,P *);
1661: void sortfs(DCP *);
1662: void sortfsrev(DCP *);
1663: void sortplist(P *,int);
1664: void sortplistbyhomdeg(P *,int);
1665: void sprs(VL,V,P,P,P *);
1666: void sqa(VL,P,P,DCP *);
1667: void sqad(unsigned int,int);
1668: void sqfrp(VL,P,DCP *);
1669: void sqfrum(int,int,P,int *,struct oDUM **,ML *);
1670: void sqfrummain(int,UM,UM,struct oDUM **);
1671: void sqrtn(N,N *);
1672: void srch2(VL,V,P,P,P *);
1673: void srchmp(VL,int,V,P,P,P *);
1674: void srchump(int,P,P,P *);
1675: void srcr(VL,V,P,P,P *);
1676: void strtobf(char *,BF *);
1677: void subalg(Num,Num,Num *);
1678: void subbf(Num,Num,Num *);
1679: void subcplx(Num,Num,Num *);
1680: void subm2p(VL,Q,Q,P,P,P *);
1681: void subm2q(Q,Q,Q,Q,Q *);
1682: void submat(VL,MAT,MAT,MAT *);
1683: void submp(VL,int,P,P,P *);
1684: void submq(int,MQ,MQ,MQ *);
1685: void subnum(VL,Num,Num,Num *);
1686: void subp(VL,P,P,P *);
1687: void subq(Q,Q,Q *);
1688: void subr(VL,Obj,Obj,Obj *);
1689: void subreal(Num,Num,Real *);
1690: void submi(MQ,MQ,MQ *);
1691: void sublm(LM,LM,LM *);
1692: void substmp(VL,int,P,V,P,P *);
1693: void substp(VL,P,V,P,P *);
1694: void substvp(VL,P,VN,P *);
1695: void subum(int,UM,UM,UM);
1696: void subvect(VL,VECT,VECT,VECT *);
1.19 noro 1697: void subquote(VL,QUOTE,QUOTE,QUOTE *);
1.1 noro 1698: void toreim(Num,Num *,Num *);
1699: void ucsump(P,Q *);
1700: void udivpwm(Q,P,P,P *,P *);
1701: void udivpz(P,P,P *,P *);
1702: void udivpzwm(Q,P,P,P *,P *);
1703: void uexgcdnp(VL,P,P *,int,VN,Q,P *,P *,P *,P *,Q *);
1704: void uezgcd1p(P,P,P *);
1705: void uezgcdpp(DCP,P,P *);
1706: void uezgcdpz(VL,P,P,P *);
1707: void ufctr(P,int,DCP *);
1708: void ufctrmain(P,int,DCP *);
1709: void umtomp(V,UM,P *);
1710: void umtop(V,UM,P *);
1711: void usqp(P,DCP *);
1712: void vntovl(VN,int,VL *);
1.29 noro 1713:
1714: void saveerror(FILE *,ERR);
1715: void saveui(FILE *,USINT);
1716: void savedp(FILE *,DP);
1717: void savestring(FILE *,STRING);
1718: void savemat(FILE *,MAT);
1719: void savevect(FILE *,VECT);
1720: void savelist(FILE *,LIST);
1721: void saver(FILE *,R);
1722: void savep(FILE *,P);
1723: void savegf2n(FILE *,GF2N);
1724: void savegfpn(FILE *,GFPN);
1725: void savegfs(FILE *,GFS);
1726: void savelm(FILE *,LM);
1727: void savemi(FILE *,MQ);
1728: void savecplx(FILE *,C);
1729: void savebf(FILE *,BF);
1730: void savereal(FILE *,Real);
1731: void saveq(FILE *,Q);
1732: void savenum(FILE *,Num);
1733: void savepfins(FILE *,V);
1734: void savegfmmat(FILE *,GFMMAT);
1735: void savebytearray(FILE *,BYTEARRAY);
1736: void savegfsn(FILE *,GFSN);
1737:
1738: void loaderror(FILE *,ERR *);
1739: void loadui(FILE *,USINT *);
1740: void loaddp(FILE *,DP *);
1741: void loadstring(FILE *,STRING *);
1742: void loadmat(FILE *,MAT *);
1743: void loadvect(FILE *,VECT *);
1744: void loadlist(FILE *,LIST *);
1745: void loadr(FILE *,R *);
1746: void loadp(FILE *,P *);
1747: void loadgf2n(FILE *,GF2N *);
1748: void loadgfpn(FILE *,GFPN *);
1749: void loadgfs(FILE *,GFS *);
1750: void loadgfsn(FILE *,GFSN *);
1751: void loadlm(FILE *,LM *);
1752: void loadmi(FILE *,MQ *);
1753: void loadcplx(FILE *,C *);
1754: void loadbf(FILE *,BF *);
1755: void loadreal(FILE *,Real *);
1756: void loadq(FILE *,Q *);
1757: void loadnum(FILE *,Num *);
1758: void loadgfmmat(FILE *,GFMMAT *);
1759: void loadbytearray(FILE *,BYTEARRAY *);
1760: V loadpfins(FILE *);
1761: void eucum2(int mod,UM f1,UM f2,UM a,UM b);
1762: void clearum(UM p,int n);
1763: BM BMALLOC(int dx,int dy);
1764: int isequalum(UM f1,UM f2);
1765: void dec_um(int p,int a,UM u);
1766: void setmod_sf(int p,int n);
1767: int search_defpoly_and_primitive_root(int p,int n,UM dp);
1768: void generate_defpoly_um(int p,int n,UM dp);
1769: int generate_primitive_root_enc(int p,int n,UM dp);
1770: int mulremum_enc(int p,int n,UM dp,int a,int b);
1771: void gfs_galois_action(GFS a,Q e,GFS *c);
1772: void gfs_embed(GFS z,int k,int pm,GFS *c);
1773: void qtogfs(Q a,GFS *c);
1774: void mqtogfs(MQ a,GFS *c);
1775: void gfstomq(GFS a,MQ *c);
1776: void ntogfs(Obj a,GFS *b);
1777: void addgfs(GFS a,GFS b,GFS *c);
1778: void subgfs(GFS a,GFS b,GFS *c);
1779: void mulgfs(GFS a,GFS b,GFS *c);
1780: void divgfs(GFS a,GFS b,GFS *c);
1781: void chsgngfs(GFS a,GFS *c);
1782: void pwrgfs(GFS a,Q b,GFS *c);
1783: int cmpgfs(GFS a,GFS b);
1784: void randomgfs(GFS *r);
1785: int _addsf(int a,int b);
1786: int _chsgnsf(int a);
1787: int _subsf(int a,int b);
1788: int _mulsf(int a,int b);
1789: int _invsf(int a);
1790: int _divsf(int a,int b);
1791: int _pwrsf(int a,int b);
1792: int _onesf();
1793: int _itosf(int n);
1794: int _isonesf(int a);
1795: int _randomsf();
1796: int field_order_sf();
1797: int characteristic_sf();
1798: int extdeg_sf();
1799: void addsfum(UM p1,UM p2,UM pr);
1800: void subsfum(UM p1,UM p2,UM pr);
1801: void gcdsfum(UM p1,UM p2,UM pr);
1802: void mulsfum(UM p1,UM p2,UM pr);
1803: void mulssfum(UM p,int n,UM pr);
1804: void kmulsfum(UM n1,UM n2,UM nr);
1805: void kmulsfummain(UM n1,UM n2,UM nr);
1806: int divsfum(UM p1,UM p2,UM pq);
1807: void diffsfum(UM f,UM fd);
1808: void monicsfum(UM f);
1809: int compsfum(UM a,UM b);
1810: void mulsfbm(BM f1,BM f2,BM fr);
1811: int degbm(BM f);
1812: void addtosfbm(BM f,BM g);
1813: void eucsfum(UM f1,UM f2,UM a,UM b);
1814: void shiftsfum(UM f,int a,UM g);
1815: void shiftsflum(int n,LUM f,int ev);
1816: void shiftsfbm(BM f,int a);
1817: void clearbm(int n,BM f);
1818:
1819: void ksquareum(int mod,UM n1,UM nr);
1820: void extractum(UM n,int index,int len,UM nr);
1821: void copyum(UM n1,UM n2);
1822: void c_copyum(UM n,int len,int *p);
1823: void kmulummain(int mod,UM n1,UM n2,UM nr);
1824: void ksquareummain(int mod,UM n1,UM nr);
1825:
1826: void simp_ff(Obj p,Obj *rp);
1827: void field_order_ff(N *order);
1828:
1829: void random_lm(LM *r);
1830: void ntosparsen(N p,N *bits);
1831: void setmod_lm(N p);
1832: void getmod_lm(N *p);
1833: void simplm(LM n,LM *r);
1834: void qtolm(Q q,LM *l);
1835: void addlm(LM a,LM b,LM *c);
1836: void sublm(LM a,LM b,LM *c);
1837: void mullm(LM a,LM b,LM *c);
1838: void divlm(LM a,LM b,LM *c);
1839: void chsgnlm(LM a,LM *c);
1840: void pwrlm(LM a,Q b,LM *c);
1841: void pwrlm0(N a,N n,N *c);
1842: int cmplm(LM a,LM b);
1843: void remn_special(N,N,int,unsigned int ,N *);;
1844: void gen_simpn(N a,N *b);
1845: void gen_simpn_force(N a,N *b);
1846: void setmod_gfpn(P p);
1847: void getmod_gfpn(UP *up);
1848: void ptogfpn(Obj q,GFPN *l);
1849: void gfpntop(GFPN q,P *l);
1850: void simpgfpn(GFPN n,GFPN *r);
1851: void ntogfpn(Obj a,GFPN *b);
1852: void addgfpn(GFPN a,GFPN b,GFPN *c);
1853: void subgfpn(GFPN a,GFPN b,GFPN *c);
1854: void mulgfpn(GFPN a,GFPN b,GFPN *c);
1855: void squaregfpn(GFPN a,GFPN *c);
1856: void divgfpn(GFPN a,GFPN b,GFPN *c);
1857: void invgfpn(GFPN b,GFPN *c);
1858: void chsgngfpn(GFPN a,GFPN *c);
1859: void pwrgfpn(GFPN a,Q b,GFPN *c);
1860: int cmpgfpn(GFPN a,GFPN b);
1861: void randomgfpn(GFPN *r);
1862: void setmod_gfsn(UM p);
1863: void getmod_gfsn(UM *up);
1864: void simpgfsn(GFSN n,GFSN *r);
1865: void ntogfsn(Obj a,GFSN *b);
1866: void addgfsn(GFSN a,GFSN b,GFSN *c);
1867: void subgfsn(GFSN a,GFSN b,GFSN *c);
1868: void mulgfsn(GFSN a,GFSN b,GFSN *c);
1869: void divgfsn(GFSN a,GFSN b,GFSN *c);
1870: void invgfsn(GFSN b,GFSN *c);
1871: void chsgngfsn(GFSN a,GFSN *c);
1872: void pwrgfsn(GFSN a,Q b,GFSN *c);
1873: int cmpgfsn(GFSN a,GFSN b);
1874: void randomgfsn(GFSN *r);
1875: void setmod_gf2n(P p);
1876: void getmod_gf2n(UP2 *p);
1877: void simpgf2n(GF2N n,GF2N *r);
1878: void ptogf2n(Obj q,GF2N *l);
1879: void gf2ntop(GF2N q,P *l);
1880: void gf2ntovect(GF2N q,VECT *l);
1881: void addgf2n(GF2N a,GF2N b,GF2N *c);
1882: void subgf2n(GF2N a,GF2N b,GF2N *c);
1883: void mulgf2n(GF2N a,GF2N b,GF2N *c);
1884: void squaregf2n(GF2N a,GF2N *c);
1885: void divgf2n(GF2N a,GF2N b,GF2N *c);
1886: void invgf2n(GF2N b,GF2N *c);
1887: void chsgngf2n(GF2N a,GF2N *c);
1888: void pwrgf2n(GF2N a,Q b,GF2N *c);
1889: int cmpgf2n(GF2N a,GF2N b);
1890: void randomgf2n(GF2N *r);
1891: void binaryton(char *binary,N *np);
1892: void hexton(char *hex,N *np);
1893: void ntobn(int base,N n,N *nrp);
1894: void bnton(int base,N n,N *nrp);
1895: void ptomp(int m,P p,P *pr);
1896: void mptop(P f,P *gp);
1897: void ptosfp(P p,P *pr);
1898: void sfptop(P f,P *gp);
1899: void sf_galois_action(P p,Q e,P *pr);
1900: void sf_embed(P p,int k,int pm,P *pr);
1901: void ptolmp(P p,P *pr);
1902: void lmptop(P f,P *gp);
1903: void ptoum(int m,P f,UM wf);
1904: void umtop(V v,UM w,P *f);
1905: void ptosfum(P f,UM wf);
1906: void sfumtop(V v,UM w,P *f);
1907: void ptoup(P n,UP *nr);
1908: void uptop(UP n,P *nr);
1909: void ulmptoum(int m,UP f,UM wf);
1910: void objtobobj(int base,Obj p,Obj *rp);
1911: void bobjtoobj(int base,Obj p,Obj *rp);
1912: void numtobnum(int base,Num p,Num *rp);
1913: void bnumtonum(int base,Num p,Num *rp);
1914: void ptobp(int base,P p,P *rp);
1915: void bptop(int base,P p,P *rp);
1916: void listtoblist(int base,LIST p,LIST *rp);
1917: void blisttolist(int base,LIST p,LIST *rp);
1918: void vecttobvect(int base,VECT p,VECT *rp);
1919: void bvecttovect(int base,VECT p,VECT *rp);
1920: void mattobmat(int base,MAT p,MAT *rp);
1921: void bmattomat(int base,MAT p,MAT *rp);
1922: void n32ton27(N g,N *rp);
1923: void n27ton32(N a,N *rp);
1924: void mptoum(P p,UM pr);
1925: void umtomp(V v,UM p,P *pr);
1926: void enc_to_p(int p,int a,V v,P *pr);
1927: int comp_dum(DUM a,DUM b);
1928: void fctrsf(P p,DCP *dcp);
1929: void gensqfrsfum(UM p,struct oDUM *dc);
1930: void randsfum(int d,UM p);
1931: void pwrmodsfum(UM p,int e,UM f,UM pr);
1932: void spwrsfum(UM m,UM f,N e,UM r);
1933: void tracemodsfum(UM m,UM f,int e,UM r);
1934: void make_qmatsf(UM p,UM *tab,int ***mp);
1935: void nullsf(int **mat,int n,int *ind);
1936: void null_to_solsf(int **mat,int *ind,int n,UM *r);
1937: void czsfum(UM f,UM *r);
1938: int berlekampsf(UM p,int df,UM *tab,UM *r);
1939: void minipolysf(UM f,UM p,UM mp);
1940: int find_rootsf(UM p,int *root);
1941: void canzassf(UM f,int d,UM *r);
1.34 noro 1942: void sfhensel(int count,P f,V x,V y,int degbound,GFS *evp,P *sfp,ML *listp);
1943: int sfberle(V x,V y,P f,int count,GFS *ev,DCP *dcp);
1.29 noro 1944: void sfgcdgen(P f,ML blist,ML *clistp);
1945: void sfhenmain2(BM f,UM g0,UM h0,int dy,BM *gp);
1946: void ptosfbm(int dy,P f,BM fl);
1947: void sfbmtop(BM f,V x,V y,P *fp);
1948: void sfsqfr(P f,DCP *dcp);
1949: void sfusqfr(P f,DCP *dcp);
1950: void sfbsqfr(P f,V x,V y,DCP *dcp);
1.30 noro 1951: void sfbfctr(P f,V x,V y,int degbound,DCP *dcp);
1.29 noro 1952: void sfdtest(P f,ML list,V x,V y,DCP *dcp);
1953: int sfdtestmain(VL vl,P lcg,UM lcg0,BM lcy,P csum,ML list,
1954: int k,int *in,P *fp,P *cofp);
1955: void const_term(P f,UM c);
1956: void const_term_sfbm(BM f,UM c);
1957: int sfctest(UM lcg0,BM lcy,ML list,int k,int *in);
1958: void mulsfbmarray(int dx,BM lcy,ML list,int k,int *in,V x,V y,P *g);
1959: void sfcsump(VL vl,P f,P *s);
1960: void cont_pp_sfp(VL vl,P f,P *cp,P *fp);
1961: int divtp_by_sfbm(VL vl,P f,P g,P *qp);
1962: void generate_defpoly_sfum(int n,UM *dp);
1963: NODE symb_merge(NODE,NODE,int);
1964: void _free_private_storage();
1965: void _DL_alloc();
1966: void _MP_alloc();
1967: void _DP_alloc();
1968: void _addmd_destructive(int mod,DP p1,DP p2,DP *pr);
1969: void _mulmd_dup(int mod,DP p1,DP p2,DP *pr);
1970: void _comm_mulmd_dup(int mod,DP p1,DP p2,DP *pr);
1971: void _weyl_mulmd_dup(int mod,DP p1,DP p2,DP *pr);
1972: void _mulmdm_dup(int mod,DP p,MP m0,DP *pr);
1973: void _weyl_mulmdm_dup(int mod,MP m0,DP p,DP *pr);
1974: void _weyl_mulmmm_dup(int mod,MP m0,MP m1,int n,struct cdlm *rtab,int rtablen);
1975: void _comm_mulmd_tab(int mod,int nv,struct cdlm *t,int n,struct cdlm *t1,int n1,struct cdlm *rt);
1976: void _comm_mulmd_tab_destructive(int mod,int nv,struct cdlm *t,int n,struct cdlm *t1,int n1);
1977: void dlto_dl(DL d,DL *dr);
1978: void _dltodl(DL d,DL *dr);
1979: void _adddl_dup(int n,DL d1,DL d2,DL *dr);
1980: void _free_dlarray(DL *a,int n);
1981: void _free_dp(DP f);
1982: void dpto_dp(DP p,DP *r);
1983: void _dptodp(DP p,DP *r);
1984: NODE _symb_merge(NODE m1,NODE m2,int n);
1985: void _addd_destructive(VL vl,DP p1,DP p2,DP *pr);
1986: void _muld_dup(VL vl,DP p1,DP p2,DP *pr);
1987: void _comm_muld_dup(VL vl,DP p1,DP p2,DP *pr);
1988: void _weyl_muld_dup(VL vl,DP p1,DP p2,DP *pr);
1989: void _muldm_dup(VL vl,DP p,MP m0,DP *pr);
1990: void _weyl_muldm_dup(VL vl,MP m0,DP p,DP *pr);
1991: void _weyl_mulmm_dup(VL vl,MP m0,MP m1,int n,struct cdl *rtab,int rtablen);
1992: void _comm_muld_tab(VL vl,int nv,struct cdl *t,int n,struct cdl *t1,int n1,struct cdl *rt);
1993: void _comm_muld_tab_destructive(VL vl,int nv,struct cdl *t,int n,struct cdl *t1,int n1);
1994:
1995: int has_fcoef(DP f);
1996: int has_fcoef_p(P f);
1997: void initd(struct order_spec *spec);
1998: void ptod(VL vl,VL dvl,P p,DP *pr);
1999: void dtop(VL vl,VL dvl,DP p,P *pr);
2000: void nodetod(NODE node,DP *dp);
2001: int sugard(MP m);
2002: void addd(VL vl,DP p1,DP p2,DP *pr);
2003: void symb_addd(DP p1,DP p2,DP *pr);
2004: NODE symb_merge(NODE m1,NODE m2,int n);
2005: DLBUCKET symb_merge_bucket(DLBUCKET m1,DLBUCKET m2,int n);
2006: void subd(VL vl,DP p1,DP p2,DP *pr);
2007: void chsgnd(DP p,DP *pr);
2008: void muld(VL vl,DP p1,DP p2,DP *pr);
2009: void comm_muld(VL vl,DP p1,DP p2,DP *pr);
2010: void muldm(VL vl,DP p,MP m0,DP *pr);
2011: void weyl_muld(VL vl,DP p1,DP p2,DP *pr);
2012: void weyl_muldm(VL vl,MP m0,DP p,DP *pr);
2013: void weyl_mulmm(VL vl,MP m0,MP m1,int n,struct cdl *rtab,int rtablen);
2014: void comm_muld_tab(VL vl,int nv,struct cdl *t,int n,struct cdl *t1,int n1,struct cdl *rt);
2015: void muldc(VL vl,DP p,P c,DP *pr);
2016: void divsdc(VL vl,DP p,P c,DP *pr);
2017: void adddl(int n,DL d1,DL d2,DL *dr);
2018: void adddl_destructive(int n,DL d1,DL d2);
2019: int compd(VL vl,DP p1,DP p2);
2020: int cmpdl_lex(int n,DL d1,DL d2);
2021: int cmpdl_revlex(int n,DL d1,DL d2);
2022: int cmpdl_gradlex(int n,DL d1,DL d2);
2023: int cmpdl_revgradlex(int n,DL d1,DL d2);
2024: int cmpdl_blex(int n,DL d1,DL d2);
2025: int cmpdl_bgradlex(int n,DL d1,DL d2);
2026: int cmpdl_brevgradlex(int n,DL d1,DL d2);
2027: int cmpdl_brevrev(int n,DL d1,DL d2);
2028: int cmpdl_bgradrev(int n,DL d1,DL d2);
2029: int cmpdl_blexrev(int n,DL d1,DL d2);
2030: int cmpdl_elim(int n,DL d1,DL d2);
2031: int cmpdl_weyl_elim(int n,DL d1,DL d2);
2032: int cmpdl_homo_ww_drl(int n,DL d1,DL d2);
2033: int cmpdl_order_pair(int n,DL d1,DL d2);
2034: int cmpdl_matrix(int n,DL d1,DL d2);
2035: void ptomd(VL vl,int mod,VL dvl,P p,DP *pr);
2036: void mptomd(VL vl,int mod,VL dvl,P p,DP *pr);
2037: void mdtop(VL vl,int mod,VL dvl,DP p,P *pr);
2038: void addmd(VL vl,int mod,DP p1,DP p2,DP *pr);
2039: void submd(VL vl,int mod,DP p1,DP p2,DP *pr);
2040: void chsgnmd(int mod,DP p,DP *pr);
2041: void mulmd(VL vl,int mod,DP p1,DP p2,DP *pr);
2042: void comm_mulmd(VL vl,int mod,DP p1,DP p2,DP *pr);
2043: void weyl_mulmd(VL vl,int mod,DP p1,DP p2,DP *pr);
2044: void mulmdm(VL vl,int mod,DP p,MP m0,DP *pr);
2045: void weyl_mulmdm(VL vl,int mod,DP p,MP m0,DP *pr);
2046: void weyl_mulmmm(VL vl,int mod,MP m0,MP m1,int n,DP *pr);
2047: void mulmdc(VL vl,int mod,DP p,P c,DP *pr);
2048: void divsmdc(VL vl,int mod,DP p,P c,DP *pr);
2049: void _dtop_mod(VL vl,VL dvl,DP p,P *pr);
2050: void _dp_mod(DP p,int mod,NODE subst,DP *rp);
2051: void _dp_monic(DP p,int mod,DP *rp);
2052: void _printdp(DP d);
2053: void addmd_destructive(int mod,DP p1,DP p2,DP *pr);
2054: void mulmd_dup(int mod,DP p1,DP p2,DP *pr);
2055: void comm_mulmd_dup(int mod,DP p1,DP p2,DP *pr);
2056: void weyl_mulmd_dup(int mod,DP p1,DP p2,DP *pr);
2057: void mulmdm_dup(int mod,DP p,MP m0,DP *pr);
2058: void weyl_mulmdm_dup(int mod,MP m0,DP p,DP *pr);
2059: void weyl_mulmmm_dup(int mod,MP m0,MP m1,int n,struct cdlm *rtab,int rtablen);
2060: void comm_mulmd_tab_destructive(int mod,int nv,struct cdlm *t,int n,struct cdlm *t1,int n1);
2061: void adddl_dup(int n,DL d1,DL d2,DL *dr);
2062: void monicup(UP a,UP *b);
2063: void simpup(UP a,UP *b);
2064: void simpnum(Num a,Num *b);
2065: void uremp(P p1,P p2,P *rp);
2066: void ugcdp(P p1,P p2,P *rp);
2067: void reversep(P p1,Q d,P *rp);
2068: void invmodp(P p1,Q d,P *rp);
2069: void addup(UP n1,UP n2,UP *nr);
2070: void subup(UP n1,UP n2,UP *nr);
2071: void chsgnup(UP n1,UP *nr);
2072: void hybrid_mulup(int ff,UP n1,UP n2,UP *nr);
2073: void hybrid_squareup(int ff,UP n1,UP *nr);
2074: void hybrid_tmulup(int ff,UP n1,UP n2,int d,UP *nr);
2075: void mulup(UP n1,UP n2,UP *nr);
2076: void mulcup(Num c,UP n1,UP *nr);
2077: void tmulup(UP n1,UP n2,int d,UP *nr);
2078: void squareup(UP n1,UP *nr);
2079: void remup(UP n1,UP n2,UP *nr);
2080: void remup_destructive(UP n1,UP n2);
2081: void qrup(UP n1,UP n2,UP *nq,UP *nr);
2082: void qrup_destructive(UP n1,UP n2);
2083: void gcdup(UP n1,UP n2,UP *nr);
2084: void extended_gcdup(UP a,UP m,UP *r);
2085: void reverseup(UP n1,int d,UP *nr);
2086: void invmodup(UP n1,int d,UP *nr);
2087: void pwrup(UP n,Q e,UP *nr);
2088: int compup(UP n1,UP n2);
2089: void kmulp(VL vl,P n1,P n2,P *nr);
2090: void ksquarep(VL vl,P n1,P *nr);
2091: void kmulup(UP n1,UP n2,UP *nr);
2092: void ksquareup(UP n1,UP *nr);
2093: void copyup(UP n1,UP n2);
2094: void c_copyup(UP n,int len,pointer *p);
2095: void kmulupmain(UP n1,UP n2,UP *nr);
2096: void ksquareupmain(UP n1,UP *nr);
2097: void rembymulup(UP n1,UP n2,UP *nr);
2098: void hybrid_rembymulup_special(int ff,UP n1,UP n2,UP inv2,UP *nr);
2099: void rembymulup_special(UP n1,UP n2,UP inv2,UP *nr);
2100: void tkmulup(UP n1,UP n2,int d,UP *nr);
2101: void shiftup(UP n,int d,UP *nr);
2102: void fft_rembymulup_special(UP n1,UP n2,UP inv2,UP *nr);
2103: void set_degreeup(UP n,int d);
2104: void decompup(UP n,int d,UP *n0,UP *n1);
2105: void truncup(UP n1,int d,UP *nr);
2106: int int_bits(int t);
2107: int maxblenup(UP n);
2108: void uptofmarray(int mod,UP n,ModNum *f);
2109: void fmarraytoup(ModNum *f,int d,UP *nr);
2110: void uiarraytoup(unsigned int **f,int n,int d,UP *nr);
2111: void adj_coefup(UP n,N m,N m2,UP *nr);
2112: void remcup(UP n,N mod,UP *nr);
2113: void fft_mulup(UP n1,UP n2,UP *nr);
2114: void trunc_fft_mulup(UP n1,UP n2,int dbd,UP *nr);
2115: void fft_squareup(UP n1,UP *nr);
2116: void fft_mulup_main(UP n1,UP n2,int dbd,UP *nr);
2117: void crup(ModNum **f,int d,int *mod,int index,N m,UP *r);
2118: void fft_mulup_specialmod_main(UP n1,UP n2,int dbd,int *modind,int nmod,UP *nr);
2119: void divn(N n1,N n2,N *nq,N *nr);
2120: void divsn(N n1,N n2,N *nq);
2121: void remn(N n1,N n2,N *nr);
2122: void remn_special(N a,N d,int bits,unsigned int lower,N *b);
2123: void mulin(N n,unsigned int d,unsigned int *p);
2124: unsigned int divin(N n,unsigned int dvr,N *q);
2125: void bprintn(N n);
2126: void bxprintn(N n);
2127: void muln(N n1,N n2,N *nr);
2128: void _muln(N n1,N n2,N nr);
2129: void muln_1(unsigned int *p,int s,unsigned int d,unsigned int *r);
2130: void divnmain(int d1,int d2,unsigned int *m1,unsigned int *m2,unsigned int *q);
2131: void divnmain_special(int d1,int d2,unsigned int *m1,unsigned int *m2,unsigned int *q);
2132: unsigned int divn_1(unsigned int *p,int s,unsigned int d,unsigned int *r);
2133: void addn(N n1,N n2,N *nr);
2134: int subn(N n1,N n2,N *nr);
2135: void _addn(N n1,N n2,N nr);
2136: int _subn(N n1,N n2,N nr);
2137: void addarray_to(unsigned int *a1,int n1,unsigned int *a2,int n2);
2138: void pwrn(N n,int e,N *nr);
2139: void gcdn(N n1,N n2,N *nr);
2140: void gcdEuclidn(N n1,N n2,N *nr);
2141: int cmpn(N n1,N n2);
2142: void bshiftn(N n,int b,N *r);
2143: void shiftn(N n,int w,N *r);
2144: void randomn(int bits,N *r);
2145: void freen(N n);
2146: int n_bits(N n);
2147: void fft_mulup_lm(UP n1,UP n2,UP *nr);
2148: void fft_squareup_lm(UP n1,UP *nr);
2149: void trunc_fft_mulup_lm(UP n1,UP n2,int dbd,UP *nr);
2150: void crup_lm(ModNum **f,int d,int *mod,int index,N m,N lm_mod,UP *r);
2151: void fft_rembymulup_special_lm(UP n1,UP n2,UP inv2,UP *nr);
2152: void uptolmup(UP n,UP *nr);
2153: void save_up(UP obj,char *name);
2154: void hybrid_powermodup(UP f,UP *xp);
2155: void powermodup(UP f,UP *xp);
2156: void hybrid_generic_powermodup(UP g,UP f,Q d,UP *xp);
2157: void generic_powermodup(UP g,UP f,Q d,UP *xp);
2158: void hybrid_powertabup(UP f,UP xp,UP *tab);
2159: void powertabup(UP f,UP xp,UP *tab);
2160: void squarep_gf2n(VL vl,P n1,P *nr);
2161: void squareup_gf2n(UP n1,UP *nr);
2162: void powermodup_gf2n(UP f,UP *xp);
2163: void generic_powermodup_gf2n(UP g,UP f,Q d,UP *xp);
2164: void tracemodup_gf2n(UP g,UP f,Q d,UP *xp);
2165: void tracemodup_gf2n_slow(UP g,UP f,Q d,UP *xp);
2166: void tracemodup_gf2n_tab(UP g,UP f,Q d,UP *xp);
2167: void square_rem_tab_up_gf2n(UP f,UP *tab,UP *rp);
2168: void powertabup_gf2n(UP f,UP xp,UP *tab);
2169: void find_root_gf2n(UP f,GF2N *r);
2170: void ptoup2(P n,UP2 *nr);
2171: void ptoup2_sparse(P n,UP2 *nr);
2172: void up2top(UP2 n,P *nr);
2173: void up2tovect(UP2 n,VECT *nr);
2174: void up2ton(UP2 p,Q *n);
2175: void ntoup2(Q n,UP2 *p);
2176: void gen_simpup2(UP2 p,GEN_UP2 m,UP2 *r);
2177: void gen_simpup2_destructive(UP2 p,GEN_UP2 m);
2178: void gen_invup2(UP2 p,GEN_UP2 m,UP2 *r);
2179: void gen_pwrmodup2(UP2 a,Q b,GEN_UP2 m,UP2 *c);
2180: void simpup2(UP2 p,UP2 m,UP2 *r);
2181: int degup2(UP2 a);
2182: int degup2_sparse(UP2 a);
2183: int degup2_1(unsigned int a);
2184: void addup2(UP2 a,UP2 b,UP2 *c);
2185: void subup2(UP2 a,UP2 b,UP2 *c);
2186: void _mulup2_1(UP2 a,unsigned int b,UP2 c);
2187: void _mulup2_h(UP2 a,unsigned int b,UP2 c);
2188: void mulup2(UP2 a,UP2 b,UP2 *c);
2189: void _kmulup2_(unsigned int *a,unsigned int *b,int w,unsigned int *c);
2190: void _mulup2_nn(unsigned int *a,unsigned int *b,int w,unsigned int *c);
2191: void _mulup2(UP2 a,UP2 b,UP2 c);
2192: void _mulup2_(_UP2 a,_UP2 b,_UP2 c);
2193: void squareup2(UP2 n,UP2 *nr);
2194: void _squareup2(UP2 n,UP2 nr);
2195: void _adjup2(UP2 n);
2196: void _adjup2_(_UP2 n);
2197: void _addup2(UP2 a,UP2 b,UP2 c);
2198: void _addup2_destructive(UP2 a,UP2 b);
2199: void _addup2_(_UP2 a,_UP2 b,_UP2 c);
2200: void _addtoup2_(_UP2 a,_UP2 b);
2201: unsigned int mulup2_bb(unsigned int a,unsigned int b);
2202: void init_up2_tab();
2203: void divup2_1(unsigned int a1,unsigned int a2,int e1,int e2,unsigned int *qp,unsigned int *rp);
2204: void qrup2(UP2 a,UP2 b,UP2 *q,UP2 *r);
2205: void _qrup2(UP2 a,UP2 b,UP2 q,UP2 r);
2206: void remup2(UP2 a,UP2 b,UP2 *c);
2207: void _remup2(UP2 a,UP2 b,UP2 c);
2208: void remup2_sparse(UP2 a,UP2 b,UP2 *c);
2209: void remup2_sparse_destructive(UP2 a,UP2 b);
2210: void remup2_type1_destructive(UP2 a,int d);
2211: void remup2_3_destructive(UP2 a,UP2 b);
2212: void remup2_5_destructive(UP2 a,UP2 b);
2213: void _invup2_1(unsigned int f1,unsigned int f2,unsigned int *a1,unsigned int *b1);
2214: void _gcdup2_1(unsigned int f1,unsigned int f2,unsigned int *gcd);
2215: void up2_init_eg();
2216: void up2_show_eg();
2217: void invup2(UP2 a,UP2 m,UP2 *inv);
2218: void gcdup2(UP2 a,UP2 m,UP2 *gcd);
2219: void chsgnup2(UP2 a,UP2 *c);
2220: void pwrmodup2(UP2 a,Q b,UP2 m,UP2 *c);
2221: void pwrmodup2_sparse(UP2 a,Q b,UP2 m,UP2 *c);
2222: int compup2(UP2 n1,UP2 n2);
2223: void _copyup2(UP2 n,UP2 r);
2224: void _bshiftup2(UP2 n,int b,UP2 r);
2225: void _bshiftup2_destructive(UP2 n,int b);
2226: void diffup2(UP2 f,UP2 *r);
2227: int sqfrcheckup2(UP2 f);
2228: int irredcheckup2(UP2 f);
2229: int irredcheck_dddup2(UP2 f);
2230: void _copy_up2bits(UP2 p,unsigned int **mat,int pos);
2231: int compute_multiplication_matrix(P p0,GF2MAT *mp);
2232: void compute_change_of_basis_matrix(P p0,P p1,int to,GF2MAT *m01,GF2MAT *m10);
2233: void compute_change_of_basis_matrix_with_root(P p0,P p1,int to,GF2N root,GF2MAT *m01,GF2MAT *m10);
2234: int compute_representation_conversion_matrix(P p0,GF2MAT *np,GF2MAT *pn);
2235: void mul_nb(GF2MAT mat,unsigned int *a,unsigned int *b,unsigned int *c);
2236: void leftshift(unsigned int *a,int n);
2237: void mat_to_gf2mat(MAT a,unsigned int ***b);
2238: void gf2mat_to_mat(unsigned int **a,int n,MAT *b);
2239: void mulgf2mat(int n,unsigned int **a,unsigned int **b,unsigned int **c);
2240: void mulgf2vectmat(int n,unsigned int *a,unsigned int **b,unsigned int *c);
2241: int mulgf2vectvect(int n,unsigned int *a,unsigned int *b);
2242: int invgf2mat(int n,unsigned int **a,unsigned int **b);
2243: void _mulup2_22(unsigned int *a1,unsigned int *a2,unsigned int *ar);
2244: void _mulup2_33(unsigned int *a1,unsigned int *a2,unsigned int *ar);
2245: void _mulup2_44(unsigned int *a1,unsigned int *a2,unsigned int *ar);
2246: void _mulup2_55(unsigned int *a1,unsigned int *a2,unsigned int *ar);
2247: void _mulup2_66(unsigned int *a1,unsigned int *a2,unsigned int *ar);
2248: void type1_bin_invup2(UP2 a,int n,UP2 *inv);
2249: UP2 *compute_tab_gf2n(UP2 f);
2250: UP compute_trace_gf2n(UP2 *tab,GF2N c,int n);
2251: void up2toup(UP2 f,UP *r);
2252: void find_root_up2(UP2 f,GF2N *r);
2253: void addq(Q n1,Q n2,Q *nr);
2254: void subq(Q n1,Q n2,Q *nr);
2255: void mulq(Q n1,Q n2,Q *nr);
2256: void divq(Q n1,Q n2,Q *nq);
2257: void divsq(Q n1,Q n2,Q *nq);
2258: void invq(Q n,Q *nr);
2259: void chsgnq(Q n,Q *nr);
2260: void pwrq(Q n1,Q n,Q *nr);
2261: int cmpq(Q q1,Q q2);
2262: void remq(Q n,Q m,Q *nr);
2263: void mkbc(int n,Q *t);
2264: void mkwc(int k,int l,Q *t);
2265: void mkwcm(int k,int l,int m,int *t);
2266: void factorial(int n,Q *r);
2267: void invl(Q a,Q mod,Q *ar);
2268: void kmuln(N n1,N n2,N *nr);
2269: void extractn(N n,int index,int len,N *nr);
2270: void copyn(N n,int len,int *p);
2271: void dupn(N n,N p);
2272: void kmulnmain(N n1,N n2,N *nr);
2273: void plisttop(P *f,V v,int n,P *gp);
2274: int divtp(VL vl,P p1,P p2,P *q);
2275: int divtdcp(VL vl,P p1,P p2,P *q);
2276: int divtpz(VL vl,P p1,P p2,P *q);
2277: int divtdcpz(VL vl,P p1,P p2,P *q);
2278: void udivpz(P f1,P f2,P *fqp,P *frp);
2279: void udivpwm(Q mod,P p1,P p2,P *q,P *r);
2280: void udivpzwm(Q mod,P f1,P f2,P *fqp,P *frp);
2281: void henmv(VL vl,VN vn,P f,P g0,P h0,P a0,P b0,P lg,P lh,P lg0,P lh0,Q q,int k,P *gp,P *hp);
2282: void henmvmain(VL vl,VN vn,P f,P fi0,P fi1,P gi0,P gi1,P l0,P l1,Q mod,Q mod2,int k,P *fr0,P *fr1);
2283: void henzq(P f,P i0,UM fi0,P i1,UM fi1,int p,int k,P *fr0p,P *fr1p,P *gr0p,P *gr1p,Q *qrp);
2284: void henzq1(P g,P h,Q bound,P *gcp,P *hcp,Q *qp);
2285: void addm2p(VL vl,Q mod,Q mod2,P n1,P n2,P *nr);
2286: void subm2p(VL vl,Q mod,Q mod2,P n1,P n2,P *nr);
2287: void mulm2p(VL vl,Q mod,Q mod2,P n1,P n2,P *nr);
2288: void cmp(Q mod,P p,P *pr);
2289: void cm2p(Q mod,Q m,P p,P *pr);
2290: void addm2q(Q mod,Q mod2,Q n1,Q n2,Q *nr);
2291: void subm2q(Q mod,Q mod2,Q n1,Q n2,Q *nr);
2292: void mulm2q(Q mod,Q mod2,Q n1,Q n2,Q *nr);
2293: void rem2q(Q n,Q m,Q m2,Q *nr);
2294: void exthpc_generic(VL vl,P p,int d,V v,P *pr);
2295: void exthp(VL vl,P p,int d,P *pr);
2296: void exthpc(VL vl,V v,P p,int d,P *pr);
2297: void cbound(VL vl,P p,Q *b);
2298: int geldb(VL vl,P p);
2299: int getdeg(V v,P p);
2300: void cmax(P p,Q *b);
2301: int nextbin(VN vn,int n);
2302: void mulsgn(VN vn,VN vnt,int n,VN vn1);
2303: void next(VN vn);
2304: void clctv(VL vl,P p,VL *nvlp);
2305: void markv(VN vn,int n,P p);
2306: void vntovl(VN vn,int n,VL *vlp);
2307: int dbound(V v,P f);
2308: int homdeg(P f);
2309: int minhomdeg(P f);
2310: void adjc(VL vl,P f,P a,P lc0,Q q,P *fr,P *ar);
2311: void affinemain(VL vl,P p,V v0,int n,P *pl,P *pr);
2312: void restore(VL vl,P f,VN vn,P *fr);
2313: void mergev(VL vl,VL vl1,VL vl2,VL *nvlp);
2314: void substvp(VL vl,P f,VN vn,P *g);
2315: void affine(VL vl,P f,VN vn,P *fr);
2316: void addnum(VL vl,Num a,Num b,Num *c);
2317: void subnum(VL vl,Num a,Num b,Num *c);
2318: void mulnum(VL vl,Num a,Num b,Num *c);
2319: void divnum(VL vl,Num a,Num b,Num *c);
2320: void pwrnum(VL vl,Num a,Num b,Num *c);
2321: void chsgnnum(Num a,Num *c);
2322: int compnum(VL vl,Num a,Num b);
2323: void one_ff(Num *c);
2324: int negative_number(Num c);
2325: void simp_ff(Obj p,Obj *rp);
2326: void field_order_ff(N *order);
2327: int fft_available(int d1,int n1,int d2,int n2);
2328: void get_fft_prime(int index,int *p,int *d);
2329: void nglob_init();
2330: void get_eg(struct oEGT *p);
2331: void init_eg(struct oEGT *eg);
2332: void add_eg(struct oEGT *base,struct oEGT *start,struct oEGT *end);
2333: void print_eg(char *item,struct oEGT *eg);
2334: void print_split_eg(struct oEGT *start,struct oEGT *end);
2335: void print_split_e(struct oEGT *start,struct oEGT *end);
2336: void suspend_timer() ;
2337: void resume_timer() ;
2338: void reset_engine() ;
2339: unsigned int get_asir_version() ;
2340: char *get_asir_distribution();
2341: void create_error(ERR *err,unsigned int serial,char *msg);
2342: void init_lprime();
2343: int get_lprime(int index);
2344: void create_new_lprimes(int index);
2345: void reorderp(VL nvl,VL ovl,P p,P *pr);
2346: void substp(VL vl,P p,V v0,P p0,P *pr);
2347: void detp(VL vl,P **rmat,int n,P *dp);
2348: void invmatp(VL vl,P **rmat,int n,P ***imatp,P *dnp);
2349: void reordvar(VL vl,V v,VL *nvlp);
2350: void gcdprsp(VL vl,P p1,P p2,P *pr);
2351: void gcdcp(VL vl,P p,P *pr);
2352: void sprs(VL vl,V v,P p1,P p2,P *pr);
2353: void resultp(VL vl,V v,P p1,P p2,P *pr);
2354: void srch2(VL vl,V v,P p1,P p2,P *pr);
2355: void srcr(VL vl,V v,P p1,P p2,P *pr);
2356: void res_ch_det(VL vl,V v,P p1,P p2,P *pr);
2357: void res_detmp(VL vl,int mod,V v,P p1,P p2,P *dp);
2358: void premp(VL vl,P p1,P p2,P *pr);
2359: void ptozp0(P p,P *pr);
2360: void mindegp(VL vl,P p,VL *mvlp,P *pr);
2361: void maxdegp(VL vl,P p,VL *mvlp,P *pr);
2362: void min_common_vars_in_coefp(VL vl,P p,VL *mvlp,P *pr);
2363: void minlcdegp(VL vl,P p,VL *mvlp,P *pr);
2364: void sort_by_deg(int n,P *p,P *pr);
2365: void sort_by_deg_rev(int n,P *p,P *pr);
2366: void getmindeg(V v,P p,Q *dp);
2367: void minchdegp(VL vl,P p,VL *mvlp,P *pr);
2368: int getchomdeg(V v,P p);
2369: int getlchomdeg(V v,P p,int *d);
2370: int nmonop(P p);
2371: int qpcheck(Obj p);
2372: int uzpcheck(Obj p);
2373: int p_mag(P p);
2374: int maxblenp(P p);
2375: void berle(int index,int count,P f,ML *listp);
2376: int berlecnt(int mod,UM f);
2377: int berlecntmain(int mod,int n,int m,int **c);
2378: UM *berlemain(int mod,UM f,UM *fp);
2379: void hensel(int index,int count,P f,ML *listp);
2380: void hensel2(int index,int count,P f,ML *listp);
2381: void henmain2(LUM f,UM g0,UM h0,UM a0,UM b0,int m,int bound,LUM *gp);
2382: void clearlum(int n,int bound,LUM f);
2383: void addtolum(int m,int bound,LUM f,LUM g);
2384: void hsq(int index,int count,P f,int *nindex,DCP *dcp);
2385: void gcdgen(P f,ML blist,ML *clistp);
2386: void henprep2(int mod,int q,int k,UM f,UM g,UM h,UM qg,UM qh,UM qa,UM qb);
2387: void henprep(P f,ML blist,ML clist,ML *bqlistp,ML *cqlistp);
2388: void henmain(LUM f,ML bqlist,ML cqlist,ML *listp);
2389: int mignotte(int q,P f);
2390: int mig(int q,int d,P f);
2391: void sqad(unsigned int man,int exp);
2392: void ptolum(int q,int bound,P f,LUM fl);
2393: void modfctrp(P p,int mod,int flag,DCP *dcp);
2394: void gensqfrum(int mod,UM p,struct oDUM *dc);
2395: void ddd(int mod,UM f,UM *r);
2396: void canzas(int mod,UM f,int d,UM *base,UM *r);
2397: void randum(int mod,int d,UM p);
2398: void pwrmodum(int mod,UM p,int e,UM f,UM pr);
2399: void spwrum(int mod,UM m,UM *base,UM f,N e,UM r);
2400: void spwrum0(int mod,UM m,UM f,N e,UM r);
2401: void mult_mod_tab(UM p,int mod,UM *tab,UM r,int d);
2402: void make_qmat(UM p,int mod,UM *tab,int ***mp);
2403: void null_mod(int **mat,int mod,int n,int *ind);
2404: void null_to_sol(int **mat,int *ind,int mod,int n,UM *r);
2405: void newddd(int mod,UM f,UM *r);
2406: int nfctr_mod(UM f,int mod);
2407: int irred_check(UM f,int mod);
2408: int berlekamp(UM p,int mod,int df,UM *tab,UM *r);
2409: void minipoly_mod(int mod,UM f,UM p,UM mp);
2410: void lnf_mod(int mod,int n,UM p0,UM p1,struct p_pair *list,UM np0,UM np1);
2411: void showum(UM p);
2412: void showumat(int **mat,int n);
2413: int find_root(int mod,UM p,int *root);
2414: void fctrp(VL vl,P f,DCP *dcp);
2415: void fctr_wrt_v_p(VL vl,P f,V v,DCP *dcp);
2416: void homfctr(VL vl,P g,DCP *dcp);
2417: void mfctr(VL vl,P f,DCP *dcp);
2418: void mfctr_wrt_v(VL vl,P f,V v,DCP *dcp);
2419: void adjsgn(P p,DCP dc);
2420: int headsgn(P p);
2421: void fctrwithmvp(VL vl,P f,V v,DCP *dcp);
2422: void mfctrwithmv(VL vl,P f,V v,DCP *dcp);
2423: void ufctr(P f,int hint,DCP *dcp);
2424: void mfctrmain(VL vl,P p,DCP *dcp);
2425: void ufctrmain(P p,int hint,DCP *dcp);
2426: void cycm(V v,int n,DCP *dcp);
2427: void cycp(V v,int n,DCP *dcp);
2428: void calcphi(V v,int n,struct oMF *mfp);
2429: void mkssum(V v,int e,int s,int sgn,P *r);
2430: int iscycp(P f);
2431: int iscycm(P f);
2432: void sortfs(DCP *dcp);
2433: void sortfsrev(DCP *dcp);
2434: void nthrootchk(P f,struct oDUM *dc,ML fp,DCP *dcp);
2435: void sqfrp(VL vl,P f,DCP *dcp);
2436: void msqfr(VL vl,P f,DCP *dcp);
2437: void usqp(P f,DCP *dcp);
2438: void msqfrmain(VL vl,P p,DCP *dcp);
2439: void msqfrmainmain(VL vl,P p,VN vn,P p0,DCP dc0,DCP *dcp,P *pp);
2440: void mfctrhen2(VL vl,VN vn,P f,P f0,P g0,P h0,P lcg,P lch,P *gp);
2441: int sqfrchk(P p);
2442: int cycchk(P p);
2443: int zerovpchk(VL vl,P p,VN vn);
2444: int valideval(VL vl,DCP dc,VN vn);
2445: void estimatelc(VL vl,Q c,DCP dc,VN vn,P *lcp);
2446: void monomialfctr(VL vl,P p,P *pr,DCP *dcp);
2447: void afctr(VL vl,P p0,P p,DCP *dcp);
2448: void afctrmain(VL vl,P p0,P p,int init,DCP *dcp);
2449: int divtmp(VL vl,int mod,P p1,P p2,P *q);
2450: int divtdcmp(VL vl,int mod,P p1,P p2,P *q);
2451: void GC_gcollect();
1.1 noro 2452:
2453: #if 0 && !defined(VISUAL)
2454: void bzero(const void *,int);
2455: void bcopy(const void *,void *,int);
2456: char *index(char *,int);
2457: #endif
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>