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