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