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

Annotation of OpenXM_contrib2/asir2018/include/ca.h, Revision 1.20

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

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