=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/io/pexpr_body.c,v retrieving revision 1.10 retrieving revision 1.20 diff -u -p -r1.10 -r1.20 --- OpenXM_contrib2/asir2000/io/pexpr_body.c 2005/11/16 23:42:54 1.10 +++ OpenXM_contrib2/asir2000/io/pexpr_body.c 2017/08/31 02:36:21 1.20 @@ -1,4 +1,4 @@ -/* $OpenXM: OpenXM_contrib2/asir2000/io/pexpr_body.c,v 1.9 2005/09/28 08:08:34 noro Exp $ */ +/* $OpenXM: OpenXM_contrib2/asir2000/io/pexpr_body.c,v 1.19 2016/06/29 08:16:11 ohara Exp $ */ #define PRINTHAT (fortran_output?PUTS("**"):PUTS("^")) @@ -15,6 +15,7 @@ void PRINTIMAT(); /* IMAT */ void PRINTSTR(); void PRINTCOMP(); void PRINTDP(); +void PRINTDPM(); void PRINTUI(); void PRINTGF2MAT(); void PRINTGFMMAT(); @@ -72,6 +73,8 @@ Obj p; PRINTCOMP(vl,(COMP)p); break; case O_DP: PRINTDP(vl,(DP)p); break; + case O_DPM: + PRINTDPM(vl,(DPM)p); break; case O_USINT: PRINTUI(vl,(USINT)p); break; case O_GF2MAT: @@ -616,7 +619,7 @@ void PRINTFNODE(FNODE f,int paren) /* lists */ case I_LIST: PUTS("["); PRINTFNODENODE((NODE)FA0(f)); PUTS("]"); break; /* function */ - case I_FUNC: + case I_FUNC: case I_FUNC_QARG: if ( !strcmp(((FUNC)FA0(f))->name,"@pi") ) PUTS("@pi"); else if ( !strcmp(((FUNC)FA0(f))->name,"@e") ) PUTS("@e"); else { @@ -689,7 +692,7 @@ Num q; int i,expo; m = (unsigned int *)&BDY((Real)q); -#if defined(__i386__) || defined(MIPSEL) || defined(VISUAL) || defined(__alpha) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__x86_64) +#if defined(__i386__) || defined(MIPSEL) || defined(VISUAL) || defined(__MINGW32__) || defined(__alpha) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__x86_64) || defined(__ARM_ARCH) || defined(ANDROID) u = m[1]; l = m[0]; #else u = m[0]; l = m[1]; @@ -765,10 +768,8 @@ Num q; case N_A: PUTS("("); PRINTR(ALG,(R)BDY((Alg)q)); PUTS(")"); break; -#if defined(PARI) case N_B: PRINTBF((BF)q); break; -#endif #if defined(INTERVAL) case N_IP: case N_IntervalBigFloat: @@ -890,6 +891,12 @@ Num q; PRINTN(NM(dn)); } break; + case N_GZ: + mpz_out_str(OUT,10,BDY((GZ)q)); + break; + case N_GQ: + mpq_out_str(OUT,10,BDY((GQ)q)); + break; } } @@ -1011,6 +1018,26 @@ DP d; } } +void PRINTDPM(vl,d) +VL vl; +DPM d; +{ + int n,i; + DMM m; + DL dl; + + for ( n = d->nv, m = BDY(d); m; m = NEXT(m) ) { + PUTS("("); PRINTEXPR(vl,(pointer)m->c); PUTS(")*<<"); + for ( i = 0, dl = m->dl; i < n-1; i++ ) { + TAIL PRINTF(OUT,"%d,",dl->d[i]); + } + TAIL PRINTF(OUT,"%d:%d",dl->d[i],m->pos); + PUTS(">>"); + if ( NEXT(m) ) + PUTS("+"); + } +} + void PRINTUI(vl,u) VL vl; USINT u; @@ -1087,13 +1114,17 @@ void PRINTNBP(VL vl,NBP p) else { for ( t = BDY(p); t; t = NEXT(t) ) { m = (NBM)BDY(t); + PUTS("("); PRINTEXPR(vl,(Obj)m->c); + PUTS(")*"); d = m->d; b = m->b; - for ( i = 0; i < d; i++ ) { - if ( NBM_GET(b,i) ) PUTS("x"); - else PUTS("y"); - } + if ( d ) + for ( i = 0; i < d; i++ ) { + if ( NBM_GET(b,i) ) PUTS("x"); + else PUTS("y"); + } + else PUTS("1"); if ( NEXT(t) ) PUTS("+"); } }