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