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