=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/builtin/poly.c,v retrieving revision 1.24 retrieving revision 1.27 diff -u -p -r1.24 -r1.27 --- OpenXM_contrib2/asir2000/builtin/poly.c 2011/07/21 04:43:26 1.24 +++ OpenXM_contrib2/asir2000/builtin/poly.c 2017/09/06 06:25:26 1.27 @@ -45,7 +45,7 @@ * DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, * PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. * - * $OpenXM: OpenXM_contrib2/asir2000/builtin/poly.c,v 1.23 2011/07/20 03:19:11 noro Exp $ + * $OpenXM: OpenXM_contrib2/asir2000/builtin/poly.c,v 1.26 2017/02/28 07:06:28 noro Exp $ */ #include "ca.h" #include "parse.h" @@ -125,6 +125,7 @@ struct ftab poly_tab[] = { {"maxblen",Pmaxblen,1}, {"ord",Pord,-1}, {"remove_vars",Premove_vars,1}, + {"delete_vars",Premove_vars,1}, {"coef0",Pcoef0,-3}, {"coef",Pcoef,-3}, {"coef_gf2n",Pcoef_gf2n,2}, @@ -147,7 +148,7 @@ struct ftab poly_tab[] = { {"ch_mv",Pch_mv,2}, {"re_mv",Pre_mv,2}, - {"ptomp",Pptomp,2}, + {"ptomp",Pptomp,-2}, {"mptop",Pmptop,1}, {"ptolmp",Pptolmp,1}, @@ -825,8 +826,9 @@ void Psetmod_ff(NODE arg,Obj *rp) if ( ac == 1 ) { mod = (Obj)ARG0(arg); if ( !mod ) - error("setmod_ff : invalid argument"); - switch ( OID(mod) ) { + current_ff = FF_NOT_SET; + else { + switch ( OID(mod) ) { case O_N: current_ff = FF_GFP; setmod_lm(NM((Q)mod)); @@ -836,7 +838,8 @@ void Psetmod_ff(NODE arg,Obj *rp) setmod_gf2n((P)mod); break; default: error("setmod_ff : invalid argument"); - } + } + } } else if ( ac == 2 ) { if ( OID(ARG0(arg)) == O_N ) { /* small finite field; primitive root representation */ @@ -1136,7 +1139,16 @@ void mergedeglist(NODE d0,NODE d1,NODE *dr) void Pptomp(NODE arg,P *rp) { - ptomp(QTOS((Q)ARG1(arg)),(P)ARG0(arg),rp); + int mod; + + if ( argc(arg) == 1 ) { + if ( !current_mod ) + error("ptomp : current_mod is not set"); + else + mod = current_mod; + } else + mod = QTOS((Q)ARG1(arg)); + ptomp(mod,(P)ARG0(arg),rp); } void Pmptop(NODE arg,P *rp)