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

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

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