version 1.12, 2001/06/29 09:08:52 |
version 1.14, 2001/09/03 01:04:25 |
|
|
* DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, |
* DEVELOPER SHALL HAVE NO LIABILITY IN CONNECTION WITH THE USE, |
* PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. |
* PERFORMANCE OR NON-PERFORMANCE OF THE SOFTWARE. |
* |
* |
* $OpenXM: OpenXM_contrib2/asir2000/builtin/poly.c,v 1.11 2001/05/28 08:22:00 noro Exp $ |
* $OpenXM: OpenXM_contrib2/asir2000/builtin/poly.c,v 1.13 2001/07/13 08:25:21 noro Exp $ |
*/ |
*/ |
#include "ca.h" |
#include "ca.h" |
#include "parse.h" |
#include "parse.h" |
Line 64 void Pmergelist(), Pch_mv(), Pre_mv(), Pdeglist(); |
|
Line 64 void Pmergelist(), Pch_mv(), Pre_mv(), Pdeglist(); |
|
void Pptomp(),Pmptop(); |
void Pptomp(),Pmptop(); |
void Pptolmp(),Plmptop(); |
void Pptolmp(),Plmptop(); |
void Pptosfp(),Psfptop(),Psf_galois_action(),Psf_embed(),Psf_find_root(); |
void Pptosfp(),Psfptop(),Psf_galois_action(),Psf_embed(),Psf_find_root(); |
void Psf_minipoly(); |
void Psf_minipoly(),Psf_log(); |
void Pptogf2n(),Pgf2ntop(),Pgf2ntovect(); |
void Pptogf2n(),Pgf2ntop(),Pgf2ntovect(); |
void Pptogfpn(),Pgfpntop(); |
void Pptogfpn(),Pgfpntop(); |
void Pfind_root_gf2n(); |
void Pfind_root_gf2n(); |
Line 155 struct ftab poly_tab[] = { |
|
Line 155 struct ftab poly_tab[] = { |
|
{"sf_find_root",Psf_find_root,1}, |
{"sf_find_root",Psf_find_root,1}, |
{"sf_minipoly",Psf_minipoly,2}, |
{"sf_minipoly",Psf_minipoly,2}, |
{"sf_embed",Psf_embed,3}, |
{"sf_embed",Psf_embed,3}, |
|
{"sf_log",Psf_log,1}, |
|
|
{"ptosfp",Pptosfp,1}, |
{"ptosfp",Pptosfp,1}, |
{"sfptop",Psfptop,1}, |
{"sfptop",Psfptop,1}, |
{"ptogf2n",Pptogf2n,1}, |
{"ptogf2n",Pptogf2n,1}, |
|
|
N n; |
N n; |
UP up; |
UP up; |
UP2 up2; |
UP2 up2; |
|
UM dp; |
Q q,r; |
Q q,r; |
P p; |
P p; |
NODE n0,n1; |
NODE n0,n1; |
|
|
setmod_lm(NM((Q)mod)); |
setmod_lm(NM((Q)mod)); |
setmod_gfpn((P)defpoly); |
setmod_gfpn((P)defpoly); |
} |
} |
|
} else if ( ac == 3 ) { |
|
/* finite extension of a small finite field */ |
|
current_ff = FF_GFS; |
|
setmod_sf(QTOS((Q)ARG0(arg)),QTOS((Q)ARG1(arg))); |
|
d = QTOS((Q)ARG2(arg)); |
|
generate_defpoly_sfum(d,&dp); |
|
setmod_gfspn(dp); |
|
current_ff = FF_GFSPN; |
} |
} |
switch ( current_ff ) { |
switch ( current_ff ) { |
case FF_GFP: |
case FF_GFP: |
|
|
GF2N rg,sg; |
GF2N rg,sg; |
GFPN rpn,spn; |
GFPN rpn,spn; |
GFS rs; |
GFS rs; |
|
GFSPN rspn,sspn; |
P t; |
P t; |
Obj obj; |
Obj obj; |
|
|
|
|
*rp = (Obj)rs; |
*rp = (Obj)rs; |
} |
} |
break; |
break; |
|
case FF_GFSPN: |
|
ntogfspn((Obj)p,&rspn); simpgfspn((GFSPN)rspn,&sspn); |
|
*rp = (Obj)sspn; |
|
break; |
default: |
default: |
*rp = (Obj)p; |
*rp = (Obj)p; |
break; |
break; |
|
|
k = CONT((GFS)ARG1(arg)); |
k = CONT((GFS)ARG1(arg)); |
pm = QTOS((Q)ARG2(arg)); |
pm = QTOS((Q)ARG2(arg)); |
sf_embed((P)ARG0(arg),k,pm,rp); |
sf_embed((P)ARG0(arg),k,pm,rp); |
|
} |
|
|
|
void Psf_log(arg,rp) |
|
NODE arg; |
|
Q *rp; |
|
{ |
|
int k; |
|
|
|
if ( !ARG0(arg) ) |
|
error("sf_log : invalid armument"); |
|
k = CONT((GFS)ARG0(arg)); |
|
STOQ(k,*rp); |
} |
} |
|
|
void Psf_find_root(arg,rp) |
void Psf_find_root(arg,rp) |