version 1.22, 2002/09/27 04:24:04 |
version 1.25, 2002/10/23 07:54:58 |
|
|
/* $OpenXM: OpenXM_contrib2/asir2000/engine/Hgfs.c,v 1.21 2001/11/19 00:57:11 noro Exp $ */ |
/* $OpenXM: OpenXM_contrib2/asir2000/engine/Hgfs.c,v 1.24 2002/09/30 06:13:07 noro Exp $ */ |
|
|
#include "ca.h" |
#include "ca.h" |
#include "inline.h" |
#include "inline.h" |
Line 16 int comp_dum(DUM a,DUM b) |
|
Line 16 int comp_dum(DUM a,DUM b) |
|
return 0; |
return 0; |
} |
} |
|
|
void fctrsf(P p,DCP *dcp) |
void ufctrsf(P p,DCP *dcp) |
{ |
{ |
int n,i,j,k; |
int n,i,j,k; |
DCP dc,dc0; |
DCP dc,dc0; |
Line 650 int sfberle(VL vl,P f,int count,GFS *ev,DCP *dcp) |
|
Line 650 int sfberle(VL vl,P f,int count,GFS *ev,DCP *dcp) |
|
V x,y; |
V x,y; |
P lc,lc0,f0; |
P lc,lc0,f0; |
Obj obj; |
Obj obj; |
int j,q1,index,i; |
int j,q,index,i; |
|
|
clctv(vl,f,&nvl); vl = nvl; |
clctv(vl,f,&nvl); vl = nvl; |
x = vl->v; y = vl->next->v; |
x = vl->v; y = vl->next->v; |
Line 658 int sfberle(VL vl,P f,int count,GFS *ev,DCP *dcp) |
|
Line 658 int sfberle(VL vl,P f,int count,GFS *ev,DCP *dcp) |
|
n = QTOS(DEG(DC(f))); |
n = QTOS(DEG(DC(f))); |
wf = W_UMALLOC(n); wf1 = W_UMALLOC(n); wf2 = W_UMALLOC(n); |
wf = W_UMALLOC(n); wf1 = W_UMALLOC(n); wf2 = W_UMALLOC(n); |
wfs = W_UMALLOC(n); gcd = W_UMALLOC(n); |
wfs = W_UMALLOC(n); gcd = W_UMALLOC(n); |
q1 = field_order_sf()-1; |
q = field_order_sf(); |
lc = DC(f)->c; |
lc = DC(f)->c; |
for ( j = 0, fn = n + 1, index = 0; |
for ( j = 0, fn = n + 1, index = 0; |
index < q1 && j < count && fn > 1; index++ ) { |
index < q && j < count && fn > 1; index++ ) { |
MKGFS(index,m); |
indextogfs(index,&m); |
substp(vl,lc,y,(P)m,&lc0); |
substp(vl,lc,y,(P)m,&lc0); |
if ( lc0 ) { |
if ( lc0 ) { |
substp(vl,f,y,(P)m,&f0); |
substp(vl,f,y,(P)m,&f0); |
ptosfum(f0,wf); cpyum(wf,wf1); |
ptosfum(f0,wf); cpyum(wf,wf1); |
diffsfum(wf1,wf2); gcdsfum(wf1,wf2,gcd); |
diffsfum(wf1,wf2); gcdsfum(wf1,wf2,gcd); |
if ( DEG(gcd) == 0 ) { |
if ( DEG(gcd) == 0 ) { |
fctrsf(f0,&dc); |
ufctrsf(f0,&dc); |
for ( dct = NEXT(dc), i = 0; dct; dct = NEXT(dct), i++ ); |
for ( dct = NEXT(dc), i = 0; dct; dct = NEXT(dct), i++ ); |
if ( i < fn ) { |
if ( i < fn ) { |
dc0 = dc; fn = i; fm = m; |
dc0 = dc; fn = i; fm = m; |
Line 678 int sfberle(VL vl,P f,int count,GFS *ev,DCP *dcp) |
|
Line 678 int sfberle(VL vl,P f,int count,GFS *ev,DCP *dcp) |
|
} |
} |
} |
} |
} |
} |
if ( index == q1 ) |
if ( index == q ) |
return 0; |
return 0; |
else if ( fn == 1 ) |
else if ( fn == 1 ) |
return 1; |
return 1; |
Line 865 void sfbmtop(BM f,V x,V y,P *fp) |
|
Line 865 void sfbmtop(BM f,V x,V y,P *fp) |
|
if ( DEG(c[j]) >= i && (a = COEF(c[j])[i]) ) { |
if ( DEG(c[j]) >= i && (a = COEF(c[j])[i]) ) { |
NEWDC(dct); |
NEWDC(dct); |
STOQ(j,DEG(dct)); |
STOQ(j,DEG(dct)); |
MKGFS(IFTOF(a),b); |
iftogfs(a,&b); |
COEF(dct) = (P)b; |
COEF(dct) = (P)b; |
NEXT(dct) = dc; |
NEXT(dct) = dc; |
dc = dct; |
dc = dct; |
Line 898 void sfsqfr(P f,DCP *dcp) |
|
Line 898 void sfsqfr(P f,DCP *dcp) |
|
NEWDC(dc); DEG(dc) = ONE; COEF(dc) = f; NEXT(dc) = 0; *dcp = dc; |
NEWDC(dc); DEG(dc) = ONE; COEF(dc) = f; NEXT(dc) = 0; *dcp = dc; |
} else if ( !NEXT(vl) ) |
} else if ( !NEXT(vl) ) |
sfusqfr(f,dcp); |
sfusqfr(f,dcp); |
#if 0 |
|
else if ( !NEXT(NEXT(vl)) ) |
|
sfbsqfr(f,vl->v,NEXT(vl)->v,dcp); |
|
#endif |
|
else |
else |
error("sfsqfr : not implemented yet"); |
sqfrsf(f,dcp); |
} |
} |
|
|
void sfusqfr(P f,DCP *dcp) |
void sfusqfr(P f,DCP *dcp) |
Line 934 void sfusqfr(P f,DCP *dcp) |
|
Line 930 void sfusqfr(P f,DCP *dcp) |
|
*dcp = dct; |
*dcp = dct; |
} |
} |
|
|
|
#if 0 |
void sfbsqfrmain(P f,V x,V y,DCP *dcp) |
void sfbsqfrmain(P f,V x,V y,DCP *dcp) |
{ |
{ |
/* XXX*/ |
/* XXX*/ |
Line 977 void sfbsqfr(P f,V x,V y,DCP *dcp) |
|
Line 974 void sfbsqfr(P f,V x,V y,DCP *dcp) |
|
*dcp = dcx; |
*dcp = dcx; |
} |
} |
} |
} |
|
#endif |
|
|
void sfdtest(P,ML,V,V,DCP *); |
void sfdtest(P,ML,V,V,DCP *); |
|
|
Line 1322 void cont_pp_sfp(VL vl,P f,P *cp,P *fp) |
|
Line 1320 void cont_pp_sfp(VL vl,P f,P *cp,P *fp) |
|
y = vl->next->v; |
y = vl->next->v; |
d = getdeg(y,f); |
d = getdeg(y,f); |
if ( d == 0 ) { |
if ( d == 0 ) { |
MKGFS(0,g); |
itogfs(1,&g); |
*cp = (P)g; |
*cp = (P)g; |
*fp = f; /* XXX */ |
*fp = f; /* XXX */ |
} else { |
} else { |