[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.53

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

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