[BACK]Return to ca.h CVS log [TXT][DIR] Up to [local] / OpenXM_contrib2 / asir2000 / include

Annotation of OpenXM_contrib2/asir2000/include/ca.h, Revision 1.37

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

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>