Annotation of OpenXM_contrib2/asir2000/include/ca.h, Revision 1.28
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.28 ! noro 48: * $OpenXM: OpenXM_contrib2/asir2000/include/ca.h,v 1.27 2001/09/17 08:37:31 noro Exp $
1.4 noro 49: */
1.1 noro 50: #include <stdio.h>
51:
52: #if defined(hpux)
53: #include <netinet/in.h>
54: # define setbuffer(FP,buf,siz) setvbuf(FP,buf,_IOFBF,siz)
55: #endif
56:
57: #if defined(VISUAL)
58: #include <stdlib.h>
59: #endif
60:
1.28 ! noro 61: #if !defined(VISUAL)
! 62: #include <sys/param.h>
! 63: #endif
! 64:
1.1 noro 65: #if defined(linux) || (defined(sun) && !defined(SYSV)) || defined(news5000) || (defined(mips) && defined(ultrix))
66: #include <alloca.h>
67: #endif
68:
69: #if (defined(sun) && defined(SYSV))
70: #define alloca(x) __builtin_alloca(x)
71: #endif
72:
73: #if defined(VISUAL)
74: #include <malloc.h>
75: #endif
76:
77: #if 0
78: #include <sys/types.h>
79: typedef caddr_t pointer;
80: #endif
81:
82: typedef void * pointer;
83:
84: #if defined(VISUAL)
85: #include <string.h>
86: #define index(s,c) strchr(s,c)
87: #define bzero(s,len) memset(s,0,len)
88: #define bcopy(x,y,len) memcpy(y,x,len)
89: #endif
90:
91: #define COPY(a,b) ((b)=(a))
92: #define FREEN(p)
93: #define FREEQ(p)
94: #define FREE(p)
95: #define INITRC(p)
96:
97: /* data structures */
98:
99: #define O_N 1
100: #define O_P 2
101: #define O_R 3
102: #define O_LIST 4
103: #define O_VECT 5
104: #define O_MAT 6
105: #define O_STR 7
106: #define O_COMP 8
107: #define O_DP 9
108: #define O_USINT 10
109: #define O_ERR 11
110: #define O_GF2MAT 12
111: #define O_MATHCAP 13
112: #define O_F 14
113: #define O_GFMMAT 15
1.6 noro 114: #define O_BYTEARRAY 16
1.13 noro 115: #define O_QUOTE 17
1.1 noro 116: #define O_VOID -1
117:
118: #define N_Q 0
119: #define N_R 1
120: #define N_A 2
121: #define N_B 3
122: #define N_C 4
123: #define N_M 5
124: #define N_LM 6
125: #define N_GF2N 7
126: #define N_GFPN 8
1.12 noro 127: #define N_GFS 9
1.21 noro 128: #define N_GFSN 10
1.1 noro 129:
130: #define ORD_REVGRADLEX 0
131: #define ORD_GRADLEX 1
132: #define ORD_LEX 2
133:
134: #if LONG_IS_32BIT
135: #if defined(VISUAL)
136: typedef _int64 L;
137: typedef unsigned _int64 UL;
138: #else
139: typedef long long L;
140: typedef unsigned long long UL;
141: #endif
142: #else
143: typedef long L;
144: typedef unsigned long UL;
145: #endif
146:
147: typedef struct oN {
148: int p;
149: unsigned int b[1];
150: } *N;
151:
152: typedef struct oUP2 {
153: int w;
154: unsigned int b[1];
155: } *UP2;
156:
157: typedef struct _oUP2 {
158: int w;
159: unsigned int *b;
160: } *_UP2;
161:
162: #define UP2_DENSE 0
163: #define UP2_SPARSE 1
164:
165: typedef struct oGEN_UP2 {
166: int id;
167: UP2 dense;
168: UP2 sparse;
169: } *GEN_UP2;
170:
171: typedef struct oV {
172: char *name;
173: pointer attr;
174: pointer priv;
175: } *V;
176:
177: typedef struct oQ {
178: short id;
179: char nid;
180: char sgn;
181: N nm;
182: N dn;
183: } *Q;
184:
185: typedef struct oReal {
186: short id;
187: char nid;
188: char pad;
189: double body;
190: } *Real;
191:
192: typedef struct oAlg {
193: short id;
194: char nid;
195: char pad;
196: struct oObj *body;
197: } *Alg;
198:
199: typedef struct oBF {
200: short id;
201: char nid;
202: char pad;
203: long body[1];
204: } *BF;
205:
206: typedef struct oC {
207: short id;
208: char nid;
209: char pad;
210: struct oNum *r,*i;
211: } *C;
212:
213: typedef struct oLM {
214: short id;
215: char nid;
216: char pad;
217: struct oN *body;
218: } *LM;
219:
220: typedef struct oGF2N {
221: short id;
222: char nid;
223: char pad;
224: struct oUP2 *body;
225: } *GF2N;
226:
227: typedef struct oGFPN {
228: short id;
229: char nid;
230: char pad;
231: struct oUP *body;
232: } *GFPN;
233:
234: typedef struct oNum {
235: short id;
236: char nid;
237: char pad;
238: } *Num;
239:
240: typedef struct oMQ {
241: short id;
242: char nid;
243: char pad;
244: int cont;
245: } *MQ;
246:
1.12 noro 247: typedef struct oGFS {
248: short id;
249: char nid;
250: char pad;
251: int cont;
252: } *GFS;
253:
1.21 noro 254: typedef struct oGFSN {
1.20 noro 255: short id;
256: char nid;
257: char pad;
258: struct oUM *body;
1.21 noro 259: } *GFSN;
1.12 noro 260:
1.1 noro 261: typedef struct oP {
262: short id;
263: short pad;
264: V v;
265: struct oDCP *dc;
266: } *P;
267:
268: typedef struct oR {
269: short id;
270: short reduced;
271: P nm;
272: P dn;
273: } *R;
274:
275: typedef struct oVECT {
276: short id;
277: short pad;
278: int len;
279: pointer *body;
280: } *VECT;
281:
282: typedef struct oMAT {
283: short id;
284: short pad;
285: int row,col;
286: pointer **body;
287: } *MAT;
288:
289: typedef struct oGF2MAT {
290: short id;
291: short pad;
292: int row,col;
293: unsigned int **body;
294: } *GF2MAT, *GFMMAT;
295:
296: typedef struct oLIST {
297: short id;
298: short pad;
299: struct oNODE *body;
300: } *LIST;
301:
302: typedef struct oSTRING {
303: short id;
304: short pad;
305: char *body;
306: } *STRING;
307:
308: typedef struct oCOMP {
309: short id;
310: short type;
311: struct oObj *member[1];
312: } *COMP;
313:
314: typedef struct oDP {
315: short id;
316: short nv;
317: int sugar;
318: struct oMP *body;
319: } *DP;
320:
321: typedef struct oUSINT {
322: short id;
323: short pad;
324: unsigned body;
325: } *USINT;
326:
327: typedef struct oERR {
328: short id;
329: short pad;
330: struct oObj *body;
331: } *ERR;
332:
333: typedef struct oMATHCAP {
334: short id;
335: short pad;
336: struct oLIST *body;
337: } *MATHCAP;
338:
1.6 noro 339: typedef struct oBYTEARRAY {
340: short id;
341: short pad;
342: int len;
343: unsigned char *body;
344: } *BYTEARRAY;
345:
1.13 noro 346: typedef struct oQUOTE {
347: short id;
348: short pad;
349: pointer body;
350: } *QUOTE;
351:
1.1 noro 352: typedef struct oObj {
353: short id;
354: short pad;
355: } *Obj;
356:
357: typedef struct oDCP {
358: Q d;
359: P c;
360: struct oDCP *next;
361: } *DCP;
362:
363: typedef struct oMP {
364: struct oDL *dl;
365: P c;
366: struct oMP *next;
367: } *MP;
368:
369: typedef struct oDL {
370: int td;
371: int d[1];
372: } *DL;
1.23 noro 373:
374: /*
375: * compressed DP
376: */
377:
378: typedef struct oCDP {
379: int len;
1.26 noro 380: int psindex;
1.27 noro 381: unsigned int *body;
1.23 noro 382: } *CDP;
383:
1.24 noro 384: typedef struct oCM {
1.23 noro 385: int index;
386: int c;
1.24 noro 387: } *CM;
1.1 noro 388:
1.25 noro 389: /* bucket list for DL */
390:
391: typedef struct oDLBUCKET {
392: int td;
393: struct oNODE *body;
394: struct oDLBUCKET *next;
395: } *DLBUCKET;
396:
1.1 noro 397: typedef struct oVL {
398: V v;
399: struct oVL *next;
400: } *VL;
401:
402: typedef struct oNODE {
403: pointer body;
404: struct oNODE *next;
405: } *NODE;
406:
1.16 noro 407: /* univariate poly over small finite field; dense */
1.1 noro 408: typedef struct oUM {
409: int d;
410: int c[1];
411: } *UM;
412:
1.16 noro 413: /* univariate poly with padic coeff */
1.1 noro 414: typedef struct oLUM {
415: int d;
416: int *c[1];
417: } *LUM;
418:
1.16 noro 419: /* bivariate poly over small finite field; dense */
420:
421: typedef struct oBM {
422: int d;
423: UM c[1];
424: } *BM;
425:
1.1 noro 426: typedef struct oML {
427: int n;
428: int mod;
429: int bound;
430: pointer c[1];
431: } *ML;
432:
433: typedef struct oUB {
434: int d;
435: N c[1];
436: } *UB;
437:
438: typedef struct oVN {
439: V v;
440: int n;
441: } *VN;
442:
443: typedef struct oUP {
444: int d;
445: Num c[1];
446: } *UP;
447:
448: typedef struct oDUM {
449: int n;
450: UM f;
451: } *DUM;
452:
453: struct order_pair {
454: int order, length;
455: };
456:
457: struct order_spec {
458: int id;
459: Obj obj;
460: int nv;
461: union {
462: int simple;
463: struct {
464: int length;
465: struct order_pair *order_pair;
466: } block;
467: struct {
468: int row;
469: int **matrix;
470: } matrix;
471: } ord;
472: };
473:
474: /* structure for cputime */
475:
476: struct oEGT {
477: double exectime,gctime;
478: };
479:
480: /* constant */
481:
482: /* ground finite field specification */
483: #define FF_NOT_SET 0
484: #define FF_GFP 1
485: #define FF_GF2N 2
486: #define FF_GFPN 3
1.12 noro 487: #define FF_GFS 4
1.21 noro 488: #define FF_GFSN 5
1.11 saito 489:
490: /* include interval.h */
491: #include "interval.h"
1.1 noro 492:
493: #define INDEX 100
494:
495: #if USE_FLOAT
496: typedef float ModNum;
497: #define NPrimes 536
498: #else
499: typedef unsigned int ModNum;
500: #define NPrimes 13681
501: #endif
502:
503: /* general macros */
1.28 ! noro 504: #if defined(MAX)
! 505: #undef MAX
! 506: #endif
! 507: #if defined(MIN)
! 508: #undef MIN
! 509: #endif
1.1 noro 510: #define MAX(a,b) ((a) > (b) ? (a) : (b) )
511: #define MIN(a,b) ((a) > (b) ? (b) : (a) )
512: #ifdef ABS
513: #undef ABS
514: #endif
515: #define ABS(a) ((a)>0?(a):-(a))
516: #define ID(p) ((p)->id)
517: #define OID(p) (((Obj)(p))->id)
518: #define NID(p) (((Num)(p))->nid)
519: #define BDY(p) ((p)->body)
520: #define VR(p) ((p)->v)
521: #define NAME(p) ((p)->name)
522: #define NEXT(p) ((p)->next)
523: #define NM(q) ((q)->nm)
524: #define DN(q) ((q)->dn)
525: #define SGN(q) ((q)->sgn)
526: #define DC(p) ((p)->dc)
527: #define COEF(p) ((p)->c)
528: #define DEG(p) ((p)->d)
529: #define PL(n) ((n)->p)
530: #define BD(n) ((n)->b)
531: #define CONT(a) ((a)->cont)
532: #define UDEG(f) BD(NM(DEG(DC(f))))[0]
533: #define UCOEF(f) (COEF(DC(f)))
534: #define LC(f) (NUM(f)?(f):COEF(DC(f)))
535:
536: /* memory allocators (W_... : uses alloca) */
537:
538: #if 0
539: #define MALLOC(d) Risa_GC_malloc(d)
540: #define MALLOC_ATOMIC(d) Risa_GC_malloc_atomic(d)
541: #define REALLOC(p,d) Risa_GC_realloc(p,d)
542: #else
543: #define MALLOC(d) GC_malloc(d)
544: #define MALLOC_ATOMIC(d) GC_malloc_atomic(d)
545: #define REALLOC(p,d) GC_realloc(p,d)
546: #endif
547: #define CALLOC(d,e) MALLOC((d)*(e))
548:
549: #if (defined(__GNUC__) || defined(vax) || defined(apollo) || defined(alloca) || defined(VISUAL))
550: #define ALLOCA(d) alloca(d)
551: #else
552: #define ALLOCA(d) MALLOC(d)
553: #endif
554:
555: #define TRUESIZE(type,n,atype) (sizeof(struct type)+MAX((n),0)*sizeof(atype))
556: #define NALLOC(d) ((N)MALLOC_ATOMIC(TRUESIZE(oN,(d)-1,int)))
557: #define UMALLOC(d) ((UM)MALLOC(TRUESIZE(oUM,d,int)))
558: #define UPALLOC(d) ((UP)MALLOC(TRUESIZE(oUP,(d),Num)))
559: #define C_UMALLOC(d) ((UM)MALLOC(TRUESIZE(oUM,d,int)))
560: #define MLALLOC(d) ((ML)MALLOC(TRUESIZE(oML,d,pointer)))
561:
562: #define W_ALLOC(d) ((int *)ALLOCA(((d)+1)*sizeof(int)))
563: #define W_CALLOC(n,type,p) \
564: ((p)=(type *)ALLOCA(((n)+1)*sizeof(type)),\
565: bzero((char *)(p),(int)(((n)+1)*sizeof(type))))
566: #define W_UMALLOC(d) ((UM)ALLOCA(TRUESIZE(oUM,d,int)))
567: #define W_UPALLOC(d) ((UP)ALLOCA(TRUESIZE(oUP,(d),Num)))
568: #define W_MLALLOC(d) ((ML)ALLOCA(TRUESIZE(oML,d,pointer)))
569: #define W_LUMALLOC(n,bound,p)\
570: {\
571: LUM ___q___;\
572: int ___i___,**___c___;\
573: (___q___) = (LUM)ALLOCA(TRUESIZE(oLUM,(n),int *));\
574: DEG(___q___) = n;\
575: for ( ___i___ = 0, ___c___ = (int **)COEF(___q___); ___i___ <= n; ___i___++ ) {\
576: ___c___[___i___] = (int *)ALLOCA(((bound)+1)*sizeof(int));\
577: bzero((char *)___c___[___i___],((bound)+1)*sizeof(int));\
578: }\
579: (p) = ___q___;\
580: }
581:
1.18 noro 582: #define W_BMALLOC(dx,dy,p)\
1.16 noro 583: {\
584: BM ___q___;\
585: int ___i___;\
586: UM *___c___;\
1.18 noro 587: (___q___) = (BM)ALLOCA(TRUESIZE(oBM,(dy),UM));\
588: DEG(___q___) = dy;\
1.16 noro 589: ___c___ = (UM *)COEF(___q___);\
1.18 noro 590: for ( ___i___ = 0; ___i___ <= dy; ___i___++ ) {\
591: ___c___[___i___] = W_UMALLOC(dx);\
592: clearum(___c___[___i___],dx);\
1.16 noro 593: }\
594: (p) = ___q___;\
595: }
596:
1.1 noro 597: #define NEWUP2(q,w)\
598: ((q)=(UP2)MALLOC_ATOMIC(TRUESIZE(oUP2,(w)-1,unsigned int)),\
599: bzero((char *)(q)->b,(w)*sizeof(unsigned int)))
600: #define W_NEWUP2(q,w)\
601: ((q)=(UP2)ALLOCA(TRUESIZE(oUP2,(w)-1,unsigned int)),\
602: bzero((char *)(q)->b,(w)*sizeof(unsigned int)))
603: #define W_NEW_UP2(q,w)\
604: ((q).b=(unsigned int *)ALLOCA((w)*sizeof(unsigned int)))
605:
606: /* cell allocators */
607: #define NEWQ(q) ((q)=(Q)MALLOC(sizeof(struct oQ)),OID(q)=O_N,NID(q)=N_Q)
608: #define NEWMQ(q) ((q)=(MQ)MALLOC_ATOMIC(sizeof(struct oMQ)),OID(q)=O_N,NID(q)=N_M)
1.12 noro 609: #define NEWGFS(q) ((q)=(GFS)MALLOC_ATOMIC(sizeof(struct oGFS)),OID(q)=O_N,NID(q)=N_GFS)
1.21 noro 610: #define NEWGFSN(q) ((q)=(GFSN)MALLOC(sizeof(struct oGFSN)),OID(q)=O_N,NID(q)=N_GFSN)
1.1 noro 611: #define NEWP(p) ((p)=(P)MALLOC(sizeof(struct oP)),OID(p)=O_P)
612: #define NEWR(r) ((r)=(R)MALLOC(sizeof(struct oR)),OID(r)=O_R,(r)->reduced=0)
613: #define NEWLIST(l) ((l)=(LIST)MALLOC(sizeof(struct oLIST)),OID(l)=O_LIST)
614: #define NEWVECT(l) ((l)=(VECT)MALLOC(sizeof(struct oVECT)),OID(l)=O_VECT)
615: #define NEWSTR(l) ((l)=(STRING)MALLOC(sizeof(struct oSTRING)),OID(l)=O_STR)
616: #define NEWCOMP(c,n) ((c)=(COMP)MALLOC(sizeof(struct oCOMP)+((n)-1)*sizeof(Obj)),OID(c)=O_COMP)
617: #define NEWDP(d) ((d)=(DP)MALLOC(sizeof(struct oDP)),OID(d)=O_DP)
618: #define NEWUSINT(u) ((u)=(USINT)MALLOC_ATOMIC(sizeof(struct oUSINT)),OID(u)=O_USINT)
619: #define NEWERR(e) ((e)=(ERR)MALLOC(sizeof(struct oERR)),OID(e)=O_ERR)
620: #define NEWMATHCAP(e) ((e)=(MATHCAP)MALLOC(sizeof(struct oMATHCAP)),OID(e)=O_MATHCAP)
1.6 noro 621: #define NEWBYTEARRAY(e) ((e)=(BYTEARRAY)MALLOC(sizeof(struct oBYTEARRAY)),OID(e)=O_BYTEARRAY)
1.13 noro 622: #define NEWQUOTE(e) ((e)=(QUOTE)MALLOC(sizeof(struct oQUOTE)),OID(e)=O_QUOTE)
1.1 noro 623:
624: #define NEWNODE(a) ((a)=(NODE)MALLOC(sizeof(struct oNODE)))
625: #define NEWDC(dc) ((dc)=(DCP)MALLOC(sizeof(struct oDCP)))
626: #define NEWV(v) ((v)=(V)MALLOC(sizeof(struct oV)))
627: #define NEWVL(vl) ((vl)=(VL)MALLOC(sizeof(struct oVL)))
628: #define NEWMP(m) ((m)=(MP)MALLOC(sizeof(struct oMP)))
1.25 noro 629: #define NEWDLBUCKET(a) ((a)=(DLBUCKET)MALLOC(sizeof(struct oDLBUCKET)))
1.1 noro 630:
631: #define NEWMAT(l) ((l)=(MAT)MALLOC(sizeof(struct oMAT)),OID(l)=O_MAT)
632: #define NEWGF2MAT(l) ((l)=(GF2MAT)MALLOC(sizeof(struct oGF2MAT)),OID(l)=O_GF2MAT)
633: #define NEWGFMMAT(l) ((l)=(GFMMAT)MALLOC(sizeof(struct oGF2MAT)),OID(l)=O_GFMMAT)
634: #define NEWReal(q) ((q)=(Real)MALLOC_ATOMIC(sizeof(struct oReal)),OID(q)=O_N,NID(q)=N_R)
635: #define NEWAlg(r) ((r)=(Alg)MALLOC(sizeof(struct oAlg)),OID(r)=O_N,NID(r)=N_A)
636: #define NEWBF(q,l) ((q)=(BF)MALLOC_ATOMIC(TRUESIZE(oBF,(l)-1,long)),OID(q)=O_N,NID(q)=N_B)
637: #define NEWC(r) ((r)=(C)MALLOC(sizeof(struct oC)),OID(r)=O_N,NID(r)=N_C)
638: #define NEWLM(r) ((r)=(LM)MALLOC(sizeof(struct oLM)),OID(r)=O_N,NID(r)=N_LM)
639: #define NEWGF2N(r) ((r)=(GF2N)MALLOC(sizeof(struct oGF2N)),OID(r)=O_N,NID(r)=N_GF2N)
640: #define NEWGFPN(r) ((r)=(GFPN)MALLOC(sizeof(struct oGFPN)),OID(r)=O_N,NID(r)=N_GFPN)
641: #define NEWDL(d,n) \
642: ((d)=(DL)MALLOC_ATOMIC(TRUESIZE(oDL,(n)-1,int)),bzero((char *)(d),TRUESIZE(oDL,(n)-1,int)))
1.9 noro 643: #define NEWDL_NOINIT(d,n) \
644: ((d)=(DL)MALLOC_ATOMIC(TRUESIZE(oDL,(n)-1,int)))
1.1 noro 645:
646: #define MKP(v,dc,p) \
647: (!DEG(dc)?((p)=COEF(dc)):(NEWP(p),VR(p)=(v),DC(p)=(dc),(p)))
648: #define MKV(v,p) \
649: (NEWP(p),VR(p)=(v),NEWDC(DC(p)),\
650: DEG(DC(p))=ONE,COEF(DC(p))=(P)ONE,NEXT(DC(p))=0)
651: #define MKRAT(n,d,r,p) \
652: (NEWR(p),NM(p)=(n),DN(p)=(d),(p)->reduced=(r))
653: #define MKMV(v,p) \
654: (NEWP(p),VR(p)=(v),NEWDC(DC(p)),\
655: DEG(DC(p))=ONE,COEF(DC(p))=(P)ONEM,NEXT(DC(p))=0)
656: #define MKNODE(a,b,c) \
657: (NEWNODE(a),(a)->body=(pointer)b,NEXT(a)=(NODE)(c))
658: #define MKLIST(a,b) (NEWLIST(a),(a)->body=(NODE)(b))
659: #define MKVECT(m,l) \
660: (NEWVECT(m),(m)->len=(l),(m)->body=(pointer *)CALLOC((l),sizeof(pointer)))
661: #define MKMAT(m,r,c) \
662: (NEWMAT(m),(m)->row=(r),(m)->col=(c),(m)->body=(pointer **)almat_pointer((r),(c)))
663: #define TOGF2MAT(r,c,b,m) (NEWGF2MAT(m),(m)->row=(r),(m)->col=(c),(m)->body=(b))
664: #define TOGFMMAT(r,c,b,m) (NEWGFMMAT(m),(m)->row=(r),(m)->col=(c),(m)->body=(b))
665: #define MKSTR(a,b) (NEWSTR(a),(a)->body=(char *)(b))
666: #define MKDP(n,m,d) (NEWDP(d),(d)->nv=(n),BDY(d)=(m))
667: #define MKLM(b,l) (!(b)?(l)=0:(NEWLM(l),(l)->body=(b),(l)))
668: #define MKGF2N(b,l) (!(b)?(l)=0:(NEWGF2N(l),(l)->body=(b),(l)))
669: #define MKGFPN(b,l) (!(b)?(l)=0:(NEWGFPN(l),(l)->body=(b),(l)))
670: #define MKUSINT(u,b) (NEWUSINT(u),(u)->body=(unsigned)(b))
671: #define MKERR(e,b) (NEWERR(e),(e)->body=(Obj)(b))
672: #define MKMATHCAP(e,b) (NEWMATHCAP(e),(e)->body=(LIST)(b))
1.6 noro 673: #define MKBYTEARRAY(m,l) \
674: (NEWBYTEARRAY(m),(m)->len=(l),(m)->body=(char *)MALLOC_ATOMIC((l)),bzero((m)->body,(l)))
1.13 noro 675: #define MKQUOTE(q,b) (NEWQUOTE(q),(q)->body=(pointer)(b))
1.1 noro 676:
677: #define NEXTDC(r,c) \
678: if(!(r)){NEWDC(r);(c)=(r);}else{NEWDC(NEXT(c));(c)=NEXT(c);}
679: #define NEXTNODE(r,c) \
680: if(!(r)){NEWNODE(r);(c)=(r);}else{NEWNODE(NEXT(c));(c)=NEXT(c);}
681: #define NEXTMP(r,c) \
682: if(!(r)){NEWMP(r);(c)=(r);}else{NEWMP(NEXT(c));(c)=NEXT(c);}
1.9 noro 683: #define NEXTMP2(r,c,s) \
684: if(!(r)){(c)=(r)=(s);}else{NEXT(c)=(s);(c)=(s);}
1.25 noro 685: #define NEXTDLBUCKET(r,c) \
686: if(!(r)){NEWDLBUCKET(r);(c)=(r);}else{NEWDLBUCKET(NEXT(c));(c)=NEXT(c);}
1.1 noro 687:
688: /* convertors */
689: #define NTOQ(n,s,q) \
690: (!(n)?((q)=0):(NEWQ(q),SGN(q)=(s),NM(q)=(n),DN(q)=0,(q)))
691: #define NDTOQ(n,d,s,q) \
692: ((!(d)||UNIN(d))?NTOQ(n,s,q):(NEWQ(q),SGN(q)=(s),NM(q)=(n),DN(q)=(d),(q)))
693: #define DUPQ(p,q) \
694: (NEWQ(q),SGN(q)=SGN(p),NM(q)=NM(p),DN(q)=DN(p))
695: #define STOQ(n,q) \
696: ((!(n))?((q)=(Q)NULL):(NEWQ(q),\
697: SGN(q)=((n)>0?1:-1),NM(q)=NALLOC(1),\
698: PL(NM(q))=1,BD(NM(q))[0]=ABS(n),DN(q)=0,(q)))
699: #define UTOMQ(a,b) \
700: ((a)?(NEWMQ(b),CONT(b)=(unsigned int)(a),(b)):((b)=0))
1.12 noro 701: #define MKGFS(a,b) \
702: ((NEWGFS(b),CONT(b)=(a),(b)))
1.21 noro 703: #define MKGFSN(a,b) \
704: ((DEG(a)>=0)?(NEWGFSN(b),BDY(b)=(a),(b)):((b)=0))
1.1 noro 705: #define STOMQ(a,b) \
706: ((a)?(NEWMQ(b),CONT(b)=(a),(b)):((b)=0))
707: #define UTON(u,n) \
708: ((!(u))?((n)=(N)NULL):((n)=NALLOC(1),PL(n)=1,BD(n)[0]=(unsigned int)(u),(n)))
709: #define UTOQ(n,q) \
710: ((!(n))?((q)=(Q)NULL):(NEWQ(q),\
711: SGN(q)=1,NM(q)=NALLOC(1),\
712: PL(NM(q))=1,BD(NM(q))[0]=(unsigned int)(n),DN(q)=0,(q)))
713: #define QTOS(q) (!(q)?0:SGN(q)*((int)BD(NM(q))[0]))
714: #define STON(i,n)\
715: (i?((n)=NALLOC(1),PL(n)=1,BD(n)[0]=(i),(n)):((n)=(N)0))
716: #define PTOR(a,b) \
717: (!(a)?((b)=0):(NEWR(b),NM(b)=(a),DN(b)=(P)ONE,(b)->reduced=1,(b)))
718: #define RTOS(a) (!(a)?0:QTOS((Q)NM((R)a)))
719: #define MKReal(a,b) (!(a)?((b)=0):(NEWReal(b),BDY(b)=(a),(b)))
720: #define MKAlg(b,r) \
721: (!(b)?((r)=0):NUM(b)?((r)=(Alg)(b)):(NEWAlg(r),BDY(r)=(Obj)(b),(r)))
722:
1.3 noro 723: #if PARI
724: #define ToReal(a) (!(a)?(double)0.0:REAL(a)?BDY((Real)a):RATN(a)?RatnToReal((Q)a):BIGFLOAT(a)?rtodbl(BDY((BF)a)):0)
725: #else
726: #define ToReal(a) (!(a)?(double)0.0:REAL(a)?BDY((Real)a):RATN(a)?RatnToReal((Q)a):0.0)
727: #endif
1.1 noro 728:
729: /* predicates */
730: #define NUM(p) (OID(p)==O_N)
731: #define RAT(p) (OID(p)==O_R)
732: #define RATN(a) (NID(a)==N_Q)
1.22 noro 733: #define INT(q) (!(q)||(NUM(q)&&RATN((Num)q)&&!DN((Q)q)))
1.1 noro 734: #define REAL(a) (NID(a)==N_R)
1.3 noro 735: #define BIGFLOAT(a) (NID(a)==N_B)
1.1 noro 736: #define SFF(a) (NID(a)==N_M)
737: #define UNIQ(q) ((q)&&NUM(q)&&RATN(q)&&(SGN((Q)q)==1)&&UNIN(NM((Q)q))&&(!DN((Q)q)))
738: #define UNIMQ(q) ((q)&&NUM(q)&&SFF(q)&&(CONT((MQ)q)==1))
739: #define MUNIQ(q) ((q)&&NUM(q)&&RATN(q)&&(SGN((Q)q)==-1)&&UNIN(NM((Q)q))&&(!DN((Q)q)))
740: #define MUNIMQ(q) ((q)&&NUM(q)&&SFF(q)&&(CONT((MQ)q)==-1))
741: #define UNIN(n) ((n)&&(PL(n)==1)&&(BD(n)[0]==1))
742: #define EVENN(n) ((!(n))||(!(BD(n)[0]%2)))
743:
1.8 noro 744: /* special macros for private memory management */
745:
746: #define NV(p) ((p)->nv)
747: #define C(p) ((p)->c)
1.28 ! noro 748: #if 0
1.8 noro 749: #define ITOS(p) (((unsigned int)(p))&0x7fffffff)
750: #define STOI(i) ((P)((unsigned int)(i)|0x80000000))
1.28 ! noro 751: #else
! 752: #define ITOS(p) (((unsigned int)(p)))
! 753: #define STOI(i) ((P)((unsigned int)(i)))
! 754: #endif
1.15 noro 755:
756: /* immediate GFS representation */
757:
758: #define IFTOF(p) ((int)(((unsigned int)(p))&0x7fffffff))
759: #define FTOIF(i) ((int)(((unsigned int)(i)|0x80000000)))
1.8 noro 760:
761: struct cdl {
762: P c;
763: DL d;
764: };
765:
766: struct cdlm {
767: int c;
768: DL d;
769: };
770:
771: extern MP _mp_free_list;
772: extern DP _dp_free_list;
773: extern DL _dl_free_list;
774: extern int current_dl_length;
775:
776: #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)
777: #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)))
778: #define _NEWMP(m) if(!_mp_free_list)_MP_alloc(); (m)=_mp_free_list; _mp_free_list = NEXT(_mp_free_list)
1.10 noro 779: #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 780:
781: #define _NEXTMP(r,c) \
782: if(!(r)){_NEWMP(r);(c)=(r);}else{_NEWMP(NEXT(c));(c)=NEXT(c);}
783:
784: #define _NEXTMP2(r,c,s) \
785: if(!(r)){(c)=(r)=(s);}else{NEXT(c)=(s);(c)=(s);}
786:
787: #define _FREEDL(m) *((DL *)m)=_dl_free_list; _dl_free_list=(m)
788: #define _FREEMP(m) NEXT(m)=_mp_free_list; _mp_free_list=(m)
789: #define _FREEDP(m) BDY(m)=(MP)_dp_free_list; _dp_free_list=(m)
1.1 noro 790:
791: /* externals */
792: #if 0
793: double NatToReal();
794: double RatnToReal();
795: #endif
796:
797: extern struct oR oUNIR;
798: extern struct oQ oUNIQ;
799: extern struct oMQ oUNIMQ;
800: extern struct oN oUNIN;
801: extern struct oUP2 oONEUP2;
802: extern struct oV oVAR[];
803: extern struct oV oPVAR[];
804: extern struct oVL oVLIST[];
805: extern struct oVL oPVLIST[];
806: extern VL CO,ALG;
807: extern VL PVL;
808: extern R ONER;
809: extern Q ONE;
810: extern MQ ONEM;
811: extern LM ONELM;
812: extern N ONEN;
813: extern UP2 ONEUP2;
814:
815: extern FILE *asir_out;
1.7 noro 816: #if defined(__GNUC__)
1.1 noro 817: extern const int sprime[];
818: #else
819: extern int sprime[];
820: #endif
1.14 noro 821:
822: extern int lprime_size;
823: extern int *lprime;
1.1 noro 824:
825: extern void (*addnumt[])();
826: extern void (*subnumt[])();
827: extern void (*mulnumt[])();
828: extern void (*divnumt[])();
829: extern void (*pwrnumt[])();
830: extern int (*cmpnumt[])();
831: extern void (*chsgnnumt[])();
832:
833: /* prototypes */
834: int compui(VL,USINT,USINT);
1.6 noro 835: int compbytearray(VL,BYTEARRAY,BYTEARRAY);
1.1 noro 836:
837: void powermodup(UP,UP *);
838: void hybrid_powermodup(UP,UP *);
839:
840: void powertabup(UP,UP,UP *);
841: void hybrid_powertabup(UP,UP,UP *);
842:
843: void generic_powermodup(UP,UP,Q,UP *);
844: void hybrid_generic_powermodup(UP,UP,Q,UP *);
845:
846: void powermod1up(UP,UP *);
847: void hybrid_rembymulup_special(int,UP,UP,UP,UP *);
848: void hybrid_tmulup(int,UP,UP,int,UP *);
849: void hybrid_squareup(int,UP,UP *);
850: void hybrid_mulup(int,UP,UP,UP *);
851:
852: void getmod_lm(N *);
853:
854: int maxblenup(UP);
855: void monicup(UP,UP *);
856: void simpup(UP,UP *);
857: void simpnum(Num,Num *);
858: void decompp(P,Q,P *,P *);
859: void truncp(P,Q,P *);
860: void uremp(P,P,P *);
861: void ugcdp(P,P,P *);
862: void reversep(P,Q,P *);
863: void invmodp(P,Q,P *);
864: void addup(UP,UP,UP *);
865: void subup(UP,UP,UP *);
866: void chsgnup(UP,UP *);
867: void mulup(UP,UP,UP *);
868: void tmulup(UP,UP,int,UP *);
869: void squareup(UP,UP *);
870: void remup(UP,UP,UP *);
871: void remup_destructive(UP,UP);
872: void qrup(UP,UP,UP *,UP *);
873: void qrup_destructive(UP,UP);
874: void gcdup(UP,UP,UP *);
875: void reverseup(UP,int,UP *);
876: void invmodup(UP,int,UP *);
877: void pwrup(UP,Q,UP *);
878: void squarep_gf2n(VL,P,P *);
879: void kmulp(VL,P,P,P *);
880: void ksquarep(VL,P,P *);
881: void kmulup(UP,UP,UP *);
882: void ksquareup(UP,UP *);
883: void extractup(UP,int,int,UP *);
884: void copyup(UP,UP);
885: void c_copyup(UP,int,pointer *);
886: void kmulupmain(UP,UP,UP *);
887: void ksquareupmain(UP,UP *);
888: void rembymulup(UP,UP,UP *);
889: void rembymulup_special(UP,UP,UP,UP *);
890: void tkmulup(UP,UP,int,UP *);
891: void shiftup(UP,int,UP *);
892: void set_degreeup(UP,int);
893: void decompup(UP,int,UP *,UP *);
894: void truncup(UP,int,UP *);
895: void uptofmarray(int,UP,ModNum *);
896: void fmarraytoup(ModNum *,int,UP *);
897: void uiarraytoup(unsigned int **,int,int,UP *);
898: void adj_coefup(UP,N,N,UP *);
899: void uptolmup(UP,UP *);
900: void remcup(UP,N,UP *);
901: void fft_mulup(UP,UP,UP *);
902: void fft_squareup(UP,UP *);
903: void trunc_fft_mulup(UP,UP,int,UP *);
904: void shoup_fft_mulup(UP,UP,UP *);
905: void shoup_fft_squareup(UP,UP *);
906: void shoup_trunc_fft_mulup(UP,UP,int,UP *);
907: void crup(ModNum **,int,int *,int,N,UP *);
908: void shoup_crup(ModNum **,int,int *,int,N,N,UP *);
909: void squareup_gf2n(UP,UP *);
910: void powermodup_gf2n(UP,UP *);
911: void generic_powermodup_gf2n(UP,UP,Q,UP *);
912: void tracemodup_gf2n(UP,UP,Q,UP *);
913: void tracemodup_gf2n_slow(UP,UP,Q,UP *);
914: void tracemodup_gf2n_tab(UP,UP,Q,UP *);
915: void square_rem_tab_up_gf2n(UP,UP *,UP *);
916: void powertabup_gf2n(UP,UP,UP *);
917: void find_root_gf2n(UP,GF2N *);
918:
919: int cmpdl_matrix(int,DL,DL);
920: int cmpdl_order_pair(int,DL,DL);
921: int cmpdl_elim(int,DL,DL);
922: int cmpdl_blexrev(int,DL,DL);
923: int cmpdl_bgradrev(int,DL,DL);
924: int cmpdl_brevrev(int,DL,DL);
925: int cmpdl_brevgradlex(int,DL,DL);
926: int cmpdl_bgradlex(int,DL,DL);
927: int cmpdl_blex(int,DL,DL);
928: int cmpdl_revgradlex(int,DL,DL);
929: int cmpdl_gradlex(int,DL,DL);
930: int cmpdl_revlex(int,DL,DL);
931: int cmpdl_lex(int,DL,DL);
932: int compd(VL,DP,DP);
933: void adddl(int,DL,DL,DL *);
934: void divsdc(VL,DP,P,DP *);
935: void muldc(VL,DP,P,DP *);
936: void muldm(VL,DP,MP,DP *);
937: void muld(VL,DP,DP,DP *);
938: void chsgnd(DP,DP *);
939: void subd(VL,DP,DP,DP *);
940: void addd(VL,DP,DP,DP *);
941: int sugard(MP);
942: void nodetod(NODE,DP *);
943: void dtop(VL,VL,DP,P *);
944: void ptod(VL,VL,P,DP *);
945: void initd(struct order_spec *);
946:
947: void _printdp(DP);
948: void _dp_sp_mod(DP,DP,int,DP *);
949: void _dp_mod(DP,int,NODE,DP *);
950: void _dp_red_mod(DP,DP,int,DP *);
951: void _dtop_mod(VL,VL,DP,P *);
952: void _mulmdm(VL,int,DP,MP,DP *);
953: void _mulmd(VL,int,DP,DP,DP *);
954: void _chsgnmd(int,DP,DP *);
955: void _submd(VL,int,DP,DP,DP *);
956: void _addmd(VL,int,DP,DP,DP *);
957: void _mdtop(VL,int,VL,DP,P *);
958: void divsmdc(VL,int,DP,P,DP *);
959: void mulmdc(VL,int,DP,P,DP *);
960: void mulmdm(VL,int,DP,MP,DP *);
961: void mulmd(VL,int,DP,DP,DP *);
962: void chsgnmd(int,DP,DP *);
963: void submd(VL,int,DP,DP,DP *);
964: void addmd(VL,int,DP,DP,DP *);
965: void mdtop(VL,int,VL,DP,P *);
966: void mptomd(VL,int,VL,P,DP *);
967: void ptomd(VL,int,VL,P,DP *);
968: int p_mag(P);
969: int n_bits(N);
970: void gcdBinary_27n(N,N,N *);
971: void rtime_init(void);
972: void setmod_gf2n(P);
973: void mt_sgenrand(unsigned long);
974: unsigned long mt_genrand(void);
975: #if defined(VISUAL)
976: void srandom(unsigned int);
977: unsigned int random(void);
978: #endif
979: void gcdbmodn(N,N,N *);
980: void gcdbinn(N,N,N *);
981: void gcdmodn(N,N,N *);
982: void gcdaccn(N,N,N *);
983: void gcdEuclidn(N,N,N *);
984: void GC_free(void *);
985: void FFT_primes(int,int *,int *,int *);
986: int FFT_pol_product(unsigned int,unsigned int *, unsigned int,unsigned int *,
987: unsigned int *,int,unsigned int *);
988: int FFT_pol_square(unsigned int,unsigned int *,
989: unsigned int *,int,unsigned int *);
990: void dcptolist(DCP,LIST *);
991: void gcdprsmp(VL,int,P,P,P *);
992: void mult_mod_tab(UM,int,UM *,UM,int);
993: int nfctr_mod(UM,int);
994: int irred_check(UM,int);
995: void modfctrp(P,int,int,DCP *);
996: void pf_init(void);
997: void binaryton(char *,N *);
998: void hexton(char *,N *);
999: void ptolmp(P,P *);
1000: void lmptop(P,P *);
1001: void ulmptoum(int,UP,UM);
1002: void objtobobj(int,Obj,Obj *);
1003: void bobjtoobj(int,Obj,Obj *);
1004: void numtobnum(int,Num,Num *);
1005: void bnumtonum(int,Num,Num *);
1006: void ptobp(int,P,P *);
1007: void bptop(int,P,P *);
1008: void listtoblist(int,LIST,LIST *);
1009: void blisttolist(int,LIST,LIST *);
1010: void vecttobvect(int,VECT,VECT *);
1011: void bvecttovect(int,VECT,VECT *);
1012: void mattobmat(int,MAT,MAT *);
1013: void bmattomat(int,MAT,MAT *);
1014: void n32ton27(N,N *);
1015: void n27ton32(N,N *);
1016: void kmulum(int,UM,UM,UM);
1017: void saveobj(FILE *,Obj);
1018: void endian_init(void);
1019: void write_char(FILE *,unsigned char *);
1020: void write_short(FILE *,unsigned short *);
1021: void write_int(FILE *,unsigned int *);
1022: void write_double(FILE *,double *);
1023: void write_intarray(FILE *,unsigned int *,int);
1024: void write_string(FILE *,unsigned char *,int);
1025: void savestr(FILE *,char *);
1026: void loadstr(FILE *,char **);
1027: void savevl(FILE *,VL);
1028: void loadvl(FILE *);
1029: void skipvl(FILE *);
1030: void savev(FILE *,V);
1031: void loadv(FILE *,V *);
1032: int save_convv(V);
1033: V load_convv(int);
1034: void swap_bytes(char *,int,int);
1035: void read_char(FILE *,unsigned char *);
1036: void read_short(FILE *,unsigned short *);
1037: void read_int(FILE *,unsigned int *);
1038: void read_double(FILE *,double *);
1039: void read_intarray(FILE *,unsigned int *,int);
1040: void read_string(FILE *,unsigned char *,int);
1041: void loadobj(FILE *,Obj *);
1042: void invum(int,UM,UM,UM);
1043: void addarray_to(unsigned int *,int,unsigned int *,int);
1044: void muln_1(unsigned int *,int,unsigned int,unsigned int *);
1045: unsigned int divn_1(unsigned int *,int,unsigned int,unsigned int *);
1046: void ptoup(P,UP *);
1047: void uptop(UP,P *);
1048: void printnum(Num);
1049: void printv(VL,V);
1050: void kmulq(Q,Q,Q *);
1051: void bshiftn(N,int,N *);
1052: void remn(N,N,N*);
1053: void simplm(LM,LM *);
1054: void qtolm(Q,LM *);
1055: int qpcheck(Obj);
1056: int headsgn(P);
1057: void adjsgn(P,DCP);
1058: void setmod_g2n(P);
1059: void simpgf2n(GF2N,GF2N *);
1060: void ptogf2n(Obj,GF2N *);
1061: void gf2ntop(GF2N,P *);
1062: void gf2ntovect(GF2N,VECT *);
1063: void squaregf2n(GF2N,GF2N *);
1064: void randomgf2n(GF2N *);
1065: void invgf2n(GF2N,GF2N *);
1066: void kmuln(N,N,N *);
1067: void extractn(N,int,int,N *);
1068: void copyn(N,int,int *);
1069: void kmulnmain(N,N,N *);
1070: int qcoefp(Obj);
1071: int qcoefr(Obj);
1072: int get_allocwords(void);
1073: double get_clock(void);
1074: void get_eg(struct oEGT *);
1075: void printtime(struct oEGT *,struct oEGT *,double);
1076: void init_eg(struct oEGT *);
1077: void add_eg(struct oEGT *,struct oEGT *,struct oEGT *);
1078: void print_eg(char *,struct oEGT *);
1079: void print_split_eg(struct oEGT *,struct oEGT *);
1080: void print_split_e(struct oEGT *,struct oEGT *);
1081: void suspend_timer(void);
1082: void resume_timer(void);
1083: void reset_engine(void);
1084: void notdef(VL,Obj,Obj,Obj *);
1085: void error(char *);
1086: void ptoup2(P,UP2 *);
1087: void ptoup2_sparse(P,UP2 *);
1088: void up2top(UP2,P *);
1089: void up2tovect(UP2,VECT *);
1090: void up2ton(UP2,Q *);
1091: void ntoup2(Q,UP2 *);
1092: void gen_simpup2(UP2,GEN_UP2,UP2 *);
1093: void gen_simpup2_destructive(UP2,GEN_UP2);
1094: void gen_invup2(UP2,GEN_UP2,UP2 *);
1095: void gen_pwrmodup2(UP2,Q,GEN_UP2,UP2 *);
1096: void simpup2(UP2,UP2,UP2 *);
1097: int degup2(UP2);
1098: int degup2_sparse(UP2);
1099: int degup2_1(unsigned int);
1100: void addup2(UP2,UP2,UP2 *);
1101: void subup2(UP2,UP2,UP2 *);
1102: void mulup2_n1(unsigned int *,int,unsigned int,unsigned int *);
1103: void mulup2_nh(unsigned int *,int,unsigned int,unsigned int *);
1104: void _mulup2_1(UP2,unsigned int,UP2);
1105: void _mulup2_h(UP2,unsigned int,UP2);
1106: void mulup2(UP2,UP2,UP2 *);
1107: void _kmulup2_(unsigned int *,unsigned int *,int,unsigned int *);
1108: void _mulup2_nn(unsigned int *,unsigned int *,int,unsigned int *);
1109: void _mulup2(UP2,UP2,UP2);
1110: void _mulup2_(_UP2,_UP2,_UP2);
1111: void squareup2(UP2,UP2 *);
1112: void _adjup2(UP2);
1113: void _adjup2_(_UP2);
1114: void _addup2(UP2,UP2,UP2);
1115: void _addup2_destructive(UP2,UP2);
1116: void _addup2_(_UP2,_UP2,_UP2);
1117: void _addtoup2_(_UP2,_UP2);
1118: unsigned int mulup2_bb(unsigned int,unsigned int);
1119: void init_up2_tab(void);
1120: unsigned int quoup2_11(unsigned int,unsigned int);
1121: void divup2_1(unsigned int,unsigned int,int,int,unsigned int *,unsigned int *);
1122: void qrup2(UP2,UP2,UP2 *,UP2 *);
1123: void _qrup2(UP2,UP2,UP2,UP2);
1124: void remup2(UP2,UP2,UP2 *);
1125: void _remup2(UP2,UP2,UP2);
1126: void remup2_sparse(UP2,UP2,UP2 *);
1127: void remup2_sparse_destructive(UP2,UP2);
1128: void remup2_type1_destructive(UP2,int);
1129: void remup2_3_destructive(UP2,UP2);
1130: void remup2_5_destructive(UP2,UP2);
1131: void _invup2_1(unsigned int,unsigned int,unsigned int *,unsigned int *);
1132: void _gcdup2_1(unsigned int,unsigned int,unsigned int *);
1133: void up2_init_eg(void);
1134: void up2_show_eg(void);
1135: void invup2(UP2,UP2,UP2 *);
1136: void gcdup2(UP2,UP2,UP2 *);
1137: void chsgnup2(UP2,UP2 *);
1138: void pwrmodup2(UP2,Q,UP2,UP2 *);
1139: void pwrmodup2_sparse(UP2,Q,UP2,UP2 *);
1140: int compup2(UP2,UP2);
1141: void printup2(UP2);
1142: void _copyup2(UP2,UP2);
1143: void _bshiftup2(UP2,int,UP2);
1144: void _bshiftup2_destructive(UP2,int);
1145: void diffup2(UP2,UP2 *);
1146: int sqfrcheckup2(UP2);
1147: int irredcheckup2(UP2);
1148: int irredcheck_dddup2(UP2);
1149: void _copy_up2bits(UP2,unsigned int **,int);
1150: void _print_frobmat(unsigned int **,int,int);
1151: int compute_multiplication_matrix(P,GF2MAT *);
1152: void compute_change_of_basis_matrix(P,P,int,GF2MAT *,GF2MAT *);
1153: int compute_representation_conversion_matrix(P,GF2MAT *,GF2MAT *);
1154: void mul_nb(GF2MAT,unsigned int *,unsigned int *,unsigned int *);
1155: void leftshift(unsigned int *,int);
1156: void mat_to_gf2mat(MAT,unsigned int ***);
1157: void gf2mat_to_mat(unsigned int **,int,MAT *);
1158: void mulgf2mat(int,unsigned int **,unsigned int **,unsigned int **);
1159: void mulgf2vectmat(int,unsigned int *,unsigned int **,unsigned int *);
1160: int mulgf2vectvect(int,unsigned int *,unsigned int *);
1161: int invgf2mat(int,unsigned int **,unsigned int **);
1162: void _mulup2_11(unsigned int,unsigned int,unsigned int *);
1163: void _mulup2_22(unsigned int *,unsigned int *,unsigned int *);
1164: void _mulup2_33(unsigned int *,unsigned int *,unsigned int *);
1165: void _mulup2_44(unsigned int *,unsigned int *,unsigned int *);
1166: void _mulup2_55(unsigned int *,unsigned int *,unsigned int *);
1167: void _mulup2_66(unsigned int *,unsigned int *,unsigned int *);
1168: void printup2_(unsigned int *,int);
1169: void type1_bin_invup2(UP2,int,UP2 *);
1170: int int_bits(int);
1171:
1172:
1173: LUM LUMALLOC(int, int);
1.16 noro 1174: BM BMALLOC(int, int);
1.1 noro 1175: Obj ToAlg(Num);
1176: UM *berlemain(register int, UM, UM *);
1177: void *Risa_GC_malloc(size_t);
1178: void *Risa_GC_malloc_atomic(size_t);
1179: void *Risa_GC_realloc(void *,size_t);
1180: void *GC_malloc(size_t);
1181: void *GC_malloc_atomic(size_t);
1182: void *GC_realloc(void *,size_t);
1183: double NatToReal(N,int *);
1184: double RatnToReal(Q);
1185: double pwrreal0(double,int);
1.3 noro 1186: double rtodbl(); /* XXX */
1.1 noro 1187: int **almat(int,int);
1188: pointer **almat_pointer(int,int);
1189: int berlecnt(register int,UM);
1190: int berlecntmain(register int,int,int,register int **);
1191: int cmpalg(Num,Num);
1192: int cmpbf(Num,Num);
1193: int cmpcplx(Num,Num);
1194: int cmpn(N,N);
1195: int cmpq(Q,Q);
1196: int cmpreal(Real,Real);
1197: int cmpmi(MQ,MQ);
1198: int cmplm(LM,LM);
1199: int compmat(VL,MAT,MAT);
1200: int compnum(VL,Num,Num);
1201: int compp(VL,P,P);
1202: int compr(VL,Obj,Obj);
1203: int compstr(VL,STRING,STRING);
1204: int compvect(VL,VECT,VECT);
1205: int ctest(P,ML,int,int *);
1206: int cycchk(P);
1207: int dbound(V,P);
1208: int dcomp(P,P);
1209: int deg(V,P);
1210: int degtest(int,int *,ML,int);
1211: int divcheck(VL,P *,int,P,P);
1212: unsigned int divin(N,unsigned int,N *);
1213: int divtdcpz(VL,P,P,P *);
1214: int divtpz(VL,P,P,P *);
1215: int divum(register int,UM,UM,UM);
1216: int dm(int,int,int *);
1217: int dmb(int,int,int,int *);
1218: int dma(int,int,int,int *);
1219: int dmab(int,int,int,int,int *);
1220: int dmar(int,int,int,int);
1221: int dtestmain(P,Q,ML,int,int *,P *,P *);
1222: int geldb(VL,P);
1223: int getchomdeg(V,P);
1224: int getdeg(V,P);
1225: int getlchomdeg(V,P,int *);
1226: int homdeg(P);
1227: unsigned int invm(unsigned int,int);
1228: int iscycm(P);
1229: int iscycp(P);
1230: int lengthp(P);
1231: int mig(int,int,P);
1232: int mignotte(int,P);
1233: int minimain(register int,int,int,register int **);
1234: int ncombi(int,int,int,int *);
1235: int nextbin(VN,int);
1236: int nmonop(P);
1237: int pcoef(VL,VL,P,P *);
1238: int pcoef0(VL,VL,P,P *);
1239: unsigned int pwrm(register int,register int,int);
1240: unsigned int rem(N,unsigned int);
1241: int sqfrchk(P);
1242: int subn(N,N,N *);
1243: int ucmpp(P,P);
1244: int valideval(VL,DCP,VN);
1245: int zerovpchk(VL,P,VN);
1246:
1247: void addgf2n(GF2N,GF2N,GF2N *);
1248: void subgf2n(GF2N,GF2N,GF2N *);
1249: void mulgf2n(GF2N,GF2N,GF2N *);
1250: void divgf2n(GF2N,GF2N,GF2N *);
1251: void chsgngf2n(GF2N,GF2N *);
1252: void pwrgf2n(GF2N,Q, GF2N *);
1253: int cmpgf2n(GF2N,GF2N);
1254:
1255: void addgfpn(GFPN,GFPN,GFPN *);
1256: void subgfpn(GFPN,GFPN,GFPN *);
1257: void mulgfpn(GFPN,GFPN,GFPN *);
1258: void divgfpn(GFPN,GFPN,GFPN *);
1259: void chsgngfpn(GFPN,GFPN *);
1260: void pwrgfpn(GFPN,Q, GFPN *);
1261: int cmpgfpn(GFPN,GFPN);
1.12 noro 1262:
1263: void addgfs(GFS,GFS,GFS *);
1264: void subgfs(GFS,GFS,GFS *);
1265: void mulgfs(GFS,GFS,GFS *);
1266: void divgfs(GFS,GFS,GFS *);
1267: void chsgngfs(GFS,GFS *);
1268: void pwrgfs(GFS,Q, GFS *);
1269: int cmpgfs(GFS,GFS);
1.20 noro 1270:
1.21 noro 1271: void addgfsn(GFSN,GFSN,GFSN *);
1272: void subgfsn(GFSN,GFSN,GFSN *);
1273: void mulgfsn(GFSN,GFSN,GFSN *);
1274: void divgfsn(GFSN,GFSN,GFSN *);
1275: void chsgngfsn(GFSN,GFSN *);
1276: void pwrgfsn(GFSN,Q, GFSN *);
1277: int cmpgfsn(GFSN,GFSN);
1.1 noro 1278:
1279: void addalg(Num,Num,Num *);
1280: void addbf(Num,Num,Num *);
1281: void addcplx(Num,Num,Num *);
1282: void addm2p(VL,Q,Q,P,P,P *);
1283: void addm2q(Q,Q,Q,Q,Q *);
1284: void addmat(VL,MAT,MAT,MAT *);
1285: void addmp(VL,int,P,P,P *);
1286: void addmpq(int,P,P,P *);
1287: void addmptoc(VL,int,P,P,P *);
1288: void addmq(int,MQ,MQ,MQ *);
1289: void addn(N,N,N *);
1290: void addnum(VL,Num,Num,Num *);
1291: void addp(VL,P,P,P *);
1292: void addpadic(int,int,unsigned int *,unsigned int *);
1293: void addpq(P,P,P *);
1294: void addptoc(VL,P,P,P *);
1295: void addq(Q,Q,Q *);
1296: void addr(VL,Obj,Obj,Obj *);
1297: void addreal(Num,Num,Real *);
1298: void addmi(MQ,MQ,MQ *);
1299: void addlm(LM,LM,LM *);
1300: void addstr(VL,STRING,STRING,STRING *);
1301: void addum(int,UM,UM,UM);
1302: void addvect(VL,VECT,VECT,VECT *);
1.19 noro 1303: void addquote(VL,QUOTE,QUOTE,QUOTE *);
1.1 noro 1304: void adjc(VL,P,P,P,Q,P *,P *);
1305: void afctr(VL,P,P,DCP *);
1306: void afctrmain(VL,P,P,int,DCP *);
1307: void affine(VL,P,VN,P *);
1308: void affinemain(VL,P,V,int,P *,P *);
1309: void berle(int,int,P,ML *);
1310: void bnton(register int,N,N *);
1311: void cbound(VL,P,Q *);
1312: void chnrem(int,V,P,Q,UM,P *,Q *);
1313: void chnremp(VL,int,P,Q,P,P *);
1314: void chsgnalg(Num,Num *);
1315: void chsgnbf(Num a,Num *);
1316: void chsgncplx(Num,Num *);
1317: void chsgnmat(MAT,MAT *);
1318: void chsgnmp(int,P,P *);
1319: void chsgnnum(Num,Num *);
1320: void chsgnp(P,P *);
1321: void chsgnq(Q,Q *);
1322: void chsgnr(Obj,Obj *);
1323: void chsgnreal(Num,Num *);
1324: void chsgnmi(MQ,MQ *);
1325: void chsgnlm(LM,LM *);
1326: void chsgnvect(VECT,VECT *);
1.19 noro 1327: void chsgnquote(QUOTE,QUOTE *);
1.1 noro 1328: void clctv(VL,P,VL *);
1329: void clctvr(VL,Obj,VL *);
1330: void cm2p(Q,Q,P,P *);
1331: void cmax(P,Q *);
1332: void cmp(Q,P,P *);
1333: void coefp(P,int,P *);
1334: void cpylum(int,LUM,LUM);
1335: void cpyum(UM,UM);
1336: void csump(VL,P,Q *);
1337: void cycm(V,register int,DCP *);
1338: void cycp(V,register int,DCP *);
1339: void degp(V,P,Q *);
1340: void degum(UM,int);
1341: void detmp(VL,int,P **,int,P *);
1342: void detp(VL,P **,int,P *);
1343: void diffp(VL,P,V,P *);
1344: void diffum(register int,UM,UM);
1345: void divalg(Num,Num,Num *);
1346: void divbf(Num,Num,Num *);
1347: void divcp(P,Q,P *);
1348: void divcplx(Num,Num,Num *);
1349: void divmat(VL,Obj,Obj,Obj *);
1350: void divmq(int,MQ,MQ,MQ *);
1351: void divn(N,N,N *,N *);
1352: void divnmain(int,int,unsigned int *,unsigned int *,unsigned int *);
1353: void divnum(VL,Num,Num,Num *);
1354: void divq(Q,Q,Q *);
1355: void divr(VL,Obj,Obj,Obj *);
1356: void divreal(Num,Num,Real *);
1357: void divmi(MQ,MQ,MQ *);
1358: void divlm(LM,LM,LM *);
1359: void divsdcmp(VL,int,P,P,P *);
1360: void divsdcp(VL,P,P,P *);
1361: void divsmp(VL,int,P,P,P *);
1362: void divsn(N,N,N *);
1363: void divsp(VL,P,P,P *);
1364: void divsrdcmp(VL,int,P,P,P *,P *);
1365: void divsrdcp(VL,P,P,P *,P *);
1366: void divsrmp(VL,int,P,P,P *,P *);
1367: void divsrp(VL,P,P,P *,P *);
1368: void divvect(VL,Obj,Obj,Obj *);
1.19 noro 1369: void divquote(VL,QUOTE,QUOTE,QUOTE *);
1.1 noro 1370: void dtest(P,ML,int,DCP *);
1371: void dtestroot(int,int,P,LUM,struct oDUM *,DCP *);
1372: void dtestroot1(int,int,P,LUM,P *);
1373: void dtestsq(int,int,P,LUM,P *);
1374: void dtestsql(P,ML,struct oDUM *,DCP *);
1375: void estimatelc(VL,Q,DCP,VN,P *);
1376: void eucum(register int,UM,UM,UM,UM);
1377: void exthp(VL,P,int,P *);
1378: void exthpc(VL,V,P,int,P *);
1379: void ezgcd1p(VL,P,P,P *);
1380: void ezgcdhensel(P,int,UM,UM,ML *);
1381: void ezgcdnp(VL,P,P *,int,P *);
1382: void ezgcdnpp(VL,DCP,P *,int,P *);
1383: void ezgcdnpz(VL,P *,int,P *);
1384: void ezgcdp(VL,P,P,P *);
1385: void ezgcdpp(VL,DCP,P,P *);
1386: void ezgcdpz(VL,P,P,P *);
1387: void factorial(int,Q *);
1388: void fctrp(VL,P,DCP *);
1389: void fctrwithmvp(VL,P,V,DCP *);
1390: void gcda(VL,P,P,P,P *);
1391: void gcdcp(VL,P,P *);
1392: void gcdgen(P,ML,ML *);
1393: void gcdmonomial(VL,DCP *,int,P *);
1394: void gcdn(N,N,N *);
1395: void gcdprsp(VL,P,P,P *);
1396: void gcdum(register int,UM,UM,UM);
1397: void getmindeg(V,P,Q *);
1398: void henmain(LUM,ML,ML,ML *);
1399: void henmv(VL,VN,P,P,P,P,P,P,P,P,P,Q,int,P *,P *);
1400: void henmvmain(VL,VN,P,P,P,P,P,P,P,Q,Q,int,P *,P *);
1401: void henprep(P,ML,ML,ML *,ML *);
1402: void hensel(int,int,P,ML *);
1403: void henzq(P,P,UM,P,UM,int,int,P *,P *,P *,P *,Q *);
1404: void henzq1(P,P,Q,P *,P *,Q *);
1405: void hsq(int,int,P,int *,DCP *);
1406: void intersectv(VL,VL,VL *);
1407: void invl(Q,Q,Q *);
1408: void invmq(int,MQ,MQ *);
1409: void invq(Q,Q *);
1410: void lgp(P,N *,N *);
1411: void lumtop(V,int,int,LUM,P *);
1412: void markv(VN,int,P);
1413: void maxdegp(VL,P,VL *,P *);
1414: void mergev(VL,VL,VL,VL *);
1415: void mfctr(VL,P,DCP *);
1416: void mfctrhen2(VL,VN,P,P,P,P,P,P,P *);
1417: void mfctrmain(VL,P,DCP *);
1418: void mfctrwithmv(VL,P,V,DCP *);
1419: void min_common_vars_in_coefp(VL,P,VL *,P *);
1420: void minchdegp(VL,P,VL *,P *);
1421: void mindegp(VL,P,VL *,P *);
1422: void mini(register int,UM,UM);
1423: void minlcdegp(VL,P,VL *,P *);
1424: void mkbc(int,Q *);
1425: void mkbcm(int,int,MQ *);
1426: void mkssum(V,int,int,int,P *);
1427: void monomialfctr(VL,P,P *,DCP *);
1428: void mptop(P,P *);
1429: void mptoum(P,UM);
1430: void msqfr(VL,P,DCP *);
1431: void msqfrmain(VL,P,DCP *);
1432: void msqfrmainmain(VL,P,VN,P,DCP,DCP *,P *);
1433: void mulalg(Num,Num,Num *);
1434: void mulbf(Num,Num,Num *);
1435: void mulcplx(Num,Num,Num *);
1436: void mulin(N,unsigned int,unsigned int *);
1437: void mullum(int,int,LUM,LUM,LUM);
1438: void mullumarray(P,ML,int,int *,P *);
1439: void mulm2p(VL,Q,Q,P,P,P *);
1440: void mulm2q(Q,Q,Q,Q,Q *);
1441: void mulmat(VL,Obj,Obj,Obj *);
1442: void mulmatmat(VL,MAT,MAT,MAT *);
1443: void mulmatvect(VL,MAT,VECT,VECT *);
1444: void mulmp(VL,int,P,P,P *);
1445: void mulmpc(VL,int,P,P,P *);
1446: void mulmpq(int,P,P,P *);
1447: void mulmq(int,MQ,MQ,MQ *);
1448: void muln(N,N,N *);
1449: void mulnum(VL,Num,Num,Num *);
1450: void mulp(VL,P,P,P *);
1451: void mulpadic(int,int,unsigned int *,unsigned int *,unsigned int *);
1452: void mulpc(VL,P,P,P *);
1453: void mulpq(P,P,P *);
1454: void mulq(Q,Q,Q *);
1455: void mulr(VL,Obj,Obj,Obj *);
1456: void mulreal(Num,Num,Real *);
1457: void mulmi(MQ,MQ,MQ *);
1458: void mullm(LM,LM,LM *);
1459: void mulrmat(VL,Obj,MAT,MAT *);
1460: void mulrvect(VL,Obj,VECT,VECT *);
1461: void mulsgn(VN,VN,int,VN);
1462: void mulsum(register int,UM,register int,UM);
1463: void mulum(register int,UM,UM,UM);
1464: void mulvect(VL,Obj,Obj,Obj *);
1.19 noro 1465: void mulquote(VL,QUOTE,QUOTE,QUOTE *);
1.1 noro 1466: void mulvectmat(VL,VECT,MAT,VECT *);
1467: void next(VN);
1468: void nezgcdnp_sqfr_primitive(VL,P,P *,int,P *);
1469: void nezgcdnpp(VL,DCP,P *,int,P *);
1470: void nezgcdnpz(VL,P *,int,P *);
1471: void nezgcdnpzmain(VL,P *,int,P *);
1472: void nglob_init(void);
1473: void norm(P,Q *);
1474: void norm1(P,P *);
1475: void norm1c(P,Q *);
1476: void normalizemp(int,P);
1477: void nthrootchk(P,struct oDUM *,ML,DCP *);
1478: void nthrootn(N,int,N *);
1479: void ntobn(register int,N,N *);
1480: void nuezgcdnpzmain(VL,P *,int,P *);
1481: void padictoq(int,int,int *,Q *);
1482: void risa_pari_init(void);
1483: void pcp(VL,P,P *,P *);
1484: void pderivr(VL,Obj,V,Obj *);
1485: void pdiva(VL,P,P,P,P *);
1486: void pinva(P,P,P *);
1487: void plisttop(P *,V,int,P *);
1488: void pmonic(VL,P,P,P *);
1489: void pqra(VL,P,P,P,P *,P *);
1490: void premmp(VL,int,P,P,P *);
1491: void premp(VL,P,P,P *);
1492: void ptolum(int,int,P,LUM);
1493: void ptomp(int,P,P *);
1494: void ptoum(int,P,UM);
1495: void ptozp(P,int,Q *,P *);
1496: void ptozp0(P,P *);
1497: void pwralg(Num,Num,Num *);
1498: void pwrbf(Num,Num,Num *);
1499: void pwrcplx(Num,Num,Num *);
1500: void pwrcplx0(Num,int,Num *);
1501: void pwrlum(int,int,LUM,int,LUM);
1502: void pwrmat(VL,MAT,Obj,MAT *);
1503: void pwrmatmain(VL,MAT,int,MAT *);
1504: void pwrmp(VL,int,P,Q,P *);
1505: void pwrmq(int,MQ,Q,MQ *);
1506: void pwrn(N,int,N *);
1507: void pwrnum(VL,Num,Num,Num *);
1508: void pwrp(VL,P,Q,P *);
1509: void pwrq(Q,Q,Q *);
1510: void pwrr(VL,Obj,Obj,Obj *);
1.19 noro 1511: void pwrquote(VL,QUOTE,QUOTE,QUOTE *);
1.1 noro 1512: void pwrreal(Num,Num,Real *);
1513: void pwrmi(MQ,Q,MQ *);
1514: void pwrlm(LM,Q,LM *);
1515: void pwrum(int,UM,int,UM);
1516: void reallocarray(char **,int *,int *,int);
1517: void reductr(VL,Obj,Obj *);
1518: void reimtocplx(Num,Num,Num *);
1519: void rem2q(Q,Q,Q,Q *);
1520: void rema(VL,P,P,P,P *);
1521: void remq(Q,Q,Q *);
1522: void remsdcp(VL,P,P,P *);
1523: void reordermp(VL,int,VL,P,P *);
1524: void reorderp(VL,VL,P,P *);
1525: void reordvar(VL,V,VL *);
1526: void res_ch_det(VL,V,P,P,P *);
1527: void res_detmp(VL,int,V,P,P,P *);
1528: void restore(VL,P,VN,P *);
1529: void resultmp(VL,int,V,P,P,P *);
1530: void resultp(VL,V,P,P,P *);
1531: void setlum(int,int,LUM);
1532: void sort_by_deg(int,P *,P *);
1533: void sort_by_deg_rev(int,P *,P *);
1534: void sortfs(DCP *);
1535: void sortfsrev(DCP *);
1536: void sortplist(P *,int);
1537: void sortplistbyhomdeg(P *,int);
1538: void sprs(VL,V,P,P,P *);
1539: void sqa(VL,P,P,DCP *);
1540: void sqad(unsigned int,int);
1541: void sqfrp(VL,P,DCP *);
1542: void sqfrum(int,int,P,int *,struct oDUM **,ML *);
1543: void sqfrummain(int,UM,UM,struct oDUM **);
1544: void sqrtn(N,N *);
1545: void srch2(VL,V,P,P,P *);
1546: void srchmp(VL,int,V,P,P,P *);
1547: void srchump(int,P,P,P *);
1548: void srcr(VL,V,P,P,P *);
1549: void strtobf(char *,BF *);
1550: void subalg(Num,Num,Num *);
1551: void subbf(Num,Num,Num *);
1552: void subcplx(Num,Num,Num *);
1553: void subm2p(VL,Q,Q,P,P,P *);
1554: void subm2q(Q,Q,Q,Q,Q *);
1555: void submat(VL,MAT,MAT,MAT *);
1556: void submp(VL,int,P,P,P *);
1557: void submq(int,MQ,MQ,MQ *);
1558: void subnum(VL,Num,Num,Num *);
1559: void subp(VL,P,P,P *);
1560: void subq(Q,Q,Q *);
1561: void subr(VL,Obj,Obj,Obj *);
1562: void subreal(Num,Num,Real *);
1563: void submi(MQ,MQ,MQ *);
1564: void sublm(LM,LM,LM *);
1565: void substmp(VL,int,P,V,P,P *);
1566: void substp(VL,P,V,P,P *);
1567: void substvp(VL,P,VN,P *);
1568: void subum(int,UM,UM,UM);
1569: void subvect(VL,VECT,VECT,VECT *);
1.19 noro 1570: void subquote(VL,QUOTE,QUOTE,QUOTE *);
1.1 noro 1571: void toreim(Num,Num *,Num *);
1572: void ucsump(P,Q *);
1573: void udivpwm(Q,P,P,P *,P *);
1574: void udivpz(P,P,P *,P *);
1575: void udivpzwm(Q,P,P,P *,P *);
1576: void uexgcdnp(VL,P,P *,int,VN,Q,P *,P *,P *,P *,Q *);
1577: void uezgcd1p(P,P,P *);
1578: void uezgcdpp(DCP,P,P *);
1579: void uezgcdpz(VL,P,P,P *);
1580: void ufctr(P,int,DCP *);
1581: void ufctrmain(P,int,DCP *);
1582: void umtomp(V,UM,P *);
1583: void umtop(V,UM,P *);
1584: void usqp(P,DCP *);
1585: void vntovl(VN,int,VL *);
1586:
1587: #if 0 && !defined(VISUAL)
1588: void bzero(const void *,int);
1589: void bcopy(const void *,void *,int);
1590: char *index(char *,int);
1591: #endif
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>