=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/builtin/poly.c,v retrieving revision 1.9 retrieving revision 1.11 diff -u -p -r1.9 -r1.11 --- OpenXM_contrib2/asir2000/builtin/poly.c 2001/05/02 09:03:52 1.9 +++ OpenXM_contrib2/asir2000/builtin/poly.c 2001/05/28 08:22:00 1.11 @@ -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.8 2001/03/29 09:49:56 noro Exp $ + * $OpenXM: OpenXM_contrib2/asir2000/builtin/poly.c,v 1.10 2001/05/09 01:41:41 noro Exp $ */ #include "ca.h" #include "parse.h" @@ -63,7 +63,7 @@ void Pp_mag(),Pmaxblen(); void Pmergelist(), Pch_mv(), Pre_mv(), Pdeglist(); void Pptomp(),Pmptop(); void Pptolmp(),Plmptop(); -void Psfptop(); +void Pptosfp(),Psfptop(),Psf_galois_action(); void Pptogf2n(),Pgf2ntop(),Pgf2ntovect(); void Pptogfpn(),Pgfpntop(); void Pfind_root_gf2n(); @@ -150,6 +150,8 @@ struct ftab poly_tab[] = { {"ptolmp",Pptolmp,1}, {"lmptop",Plmptop,1}, + {"sf_galois_action",Psf_galois_action,2}, + {"ptosfp",Pptosfp,1}, {"sfptop",Psfptop,1}, {"ptogf2n",Pptogf2n,1}, @@ -798,7 +800,10 @@ Obj *rp; VR(current_gfs_ext),&p); n0 = mknode(3,q,current_gfs_ext,p); } else { - STOQ(current_gfs_iton[1],r); + if ( current_gfs_p == 2 ) + r = ONE; + else + STOQ(current_gfs_iton[1],r); n0 = mknode(3,q,current_gfs_ext,r); } MKLIST(list,n0); @@ -822,6 +827,12 @@ Q *rp; getmod_gf2n(&up2); d = degup2(up2); STOQ(d,*rp); break; case FF_GFPN: getmod_gfpn(&up); STOQ(up->d,*rp); break; + case FF_GFS: + if ( !current_gfs_ext ) + *rp = ONE; + else + *rp = DEG(DC(current_gfs_ext)); + break; default: error("extdeg_ff : current_ff is not set"); } @@ -838,6 +849,8 @@ Q *rp; getmod_lm(&lm); NTOQ(lm,1,*rp); break; case FF_GF2N: STOQ(2,*rp); break; + case FF_GFS: + STOQ(current_gfs_p,*rp); break; default: error("characteristic_ff : current_ff is not set"); } @@ -880,6 +893,8 @@ N *order; case FF_GFPN: getmod_lm(&m); getmod_gfpn(&up); pwrn(m,up->d,order); break; + case FF_GFS: + STON(current_gfs_q,*order); break; default: error("field_order_ff : current_ff is not set"); } @@ -1166,6 +1181,20 @@ P *rp; lmptop((P)ARG0(arg),rp); } +void Psf_galois_action(arg,rp) +NODE arg; +P *rp; +{ + sf_galois_action(ARG0(arg),ARG1(arg),rp); +} + +void Pptosfp(arg,rp) +NODE arg; +P *rp; +{ + ptosfp(ARG0(arg),rp); +} + void Psfptop(arg,rp) NODE arg; P *rp; @@ -1337,6 +1366,7 @@ P *rp; case FF_GF2N: powermodup_gf2n(p1,&p2); break; case FF_GFPN: + case FF_GFS: powermodup(p1,&p2); break; default: error("pwrmod_ff : current_ff is not set"); @@ -1358,6 +1388,7 @@ P *rp; case FF_GF2N: generic_powermodup_gf2n(g,f,(Q)ARG2(arg),&r); break; case FF_GFPN: + case FF_GFS: generic_powermodup(g,f,(Q)ARG2(arg),&r); break; default: error("generic_pwrmod_ff : current_ff is not set"); @@ -1385,6 +1416,7 @@ VECT *rp; case FF_GF2N: powertabup_gf2n(f,xp,tab); break; case FF_GFPN: + case FF_GFS: powertabup(f,xp,tab); break; default: error("pwrtab_ff : current_ff is not set");