version 1.23, 2020/06/19 10:18:13 |
version 1.26, 2021/12/23 08:55:33 |
|
|
* 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/asir2018/engine/dist.c,v 1.22 2020/02/11 01:43:57 noro Exp $ |
* $OpenXM: OpenXM_contrib2/asir2018/engine/dist.c,v 1.25 2021/01/11 08:37:44 noro Exp $ |
*/ |
*/ |
#include "ca.h" |
#include "ca.h" |
|
|
Line 210 void initd(struct order_spec *spec) |
|
Line 210 void initd(struct order_spec *spec) |
|
|
|
int dpm_ordtype; |
int dpm_ordtype; |
|
|
|
#if 0 |
void ptod(VL vl,VL dvl,P p,DP *pr) |
void ptod(VL vl,VL dvl,P p,DP *pr) |
{ |
{ |
int n,i,j,k; |
int n,i,j,k; |
Line 267 void ptod(VL vl,VL dvl,P p,DP *pr) |
|
Line 268 void ptod(VL vl,VL dvl,P p,DP *pr) |
|
dp_fcoeffs = N_GFS; |
dp_fcoeffs = N_GFS; |
#endif |
#endif |
} |
} |
|
#else |
|
void ptod(VL vl,VL dvl,P p,DP *pr) |
|
{ |
|
int n,i,j,k; |
|
VL tvl; |
|
V v; |
|
DL d; |
|
MP m; |
|
DCP dc; |
|
DP *y; |
|
DP r,s,t,u; |
|
P x,c; |
|
|
|
if ( !p ) |
|
*pr = 0; |
|
else if ( OID(p) > O_P ) |
|
error("ptod : only polynomials can be converted."); |
|
else { |
|
for ( n = 0, tvl = dvl; tvl; tvl = NEXT(tvl), n++ ); |
|
if ( NUM(p) ) { |
|
NEWDL(d,n); |
|
NEWMP(m); m->dl = d; C(m) = (Obj)p; NEXT(m) = 0; MKDP(n,m,*pr); (*pr)->sugar = 0; |
|
} else { |
|
for ( i = 0, tvl = dvl, v = VR(p); tvl && tvl->v != v; tvl = NEXT(tvl), i++ ); |
|
for ( dc = DC(p), k = 0; dc; dc = NEXT(dc), k++ ); |
|
y = (DP *)ALLOCA(k*sizeof(DP)); |
|
if ( !tvl ) { |
|
MKV(v,x); |
|
for ( dc = DC(p), j = 0; dc; dc = NEXT(dc), j++ ) { |
|
ptod(vl,dvl,COEF(dc),&t); pwrp(vl,x,DEG(dc),&c); |
|
muldc(vl,t,(Obj)c,&y[j]); |
|
} |
|
} else { |
|
for ( dc = DC(p), j = 0; dc; dc = NEXT(dc), j++ ) { |
|
ptod(vl,dvl,COEF(dc),&t); |
|
NEWDL(d,n); |
|
d->d[i] = ZTOS(DEG(dc)); |
|
d->td = MUL_WEIGHT(d->d[i],i); |
|
NEWMP(m); m->dl = d; C(m) = (Obj)ONE; NEXT(m) = 0; MKDP(n,m,u); u->sugar = d->td; |
|
comm_muld(vl,t,u,&y[j]); |
|
} |
|
} |
|
for ( j = k-1, s = 0; j >= 0; j-- ) { |
|
addd(vl,y[j],s,&t); s = t; |
|
} |
|
*pr = s; |
|
} |
|
} |
|
#if 0 |
|
if ( !dp_fcoeffs && has_sfcoef(*pr) ) |
|
dp_fcoeffs = N_GFS; |
|
#endif |
|
} |
|
#endif |
|
|
void dtop(VL vl,VL dvl,DP p,Obj *pr) |
void dtop(VL vl,VL dvl,DP p,Obj *pr) |
{ |
{ |
int n,i,j,k; |
int n,i,j,k; |
Line 582 void _adddl(int n,DL d1,DL d2,DL d3) |
|
Line 637 void _adddl(int n,DL d1,DL d2,DL d3) |
|
d3->d[i] = d1->d[i]+d2->d[i]; |
d3->d[i] = d1->d[i]+d2->d[i]; |
} |
} |
|
|
|
void _subdl(int n,DL d1,DL d2,DL d3) |
|
{ |
|
int i; |
|
|
|
d3->td = d1->td-d2->td; |
|
for ( i = 0; i < n; i++ ) |
|
d3->d[i] = d1->d[i]-d2->d[i]; |
|
} |
|
|
|
|
void _addtodl(int n,DL d1,DL d2) |
void _addtodl(int n,DL d1,DL d2) |
{ |
{ |
int i; |
int i; |
Line 3220 int compdmm_schreyer(int n,DMM m1,DMM m2) |
|
Line 3285 int compdmm_schreyer(int n,DMM m1,DMM m2) |
|
else return 0; |
else return 0; |
} |
} |
} |
} |
|
/* XXX */ |
|
return 0; |
} |
} |
|
|
int compdmm_schreyer_old(int n,DMM m1,DMM m2) |
int compdmm_schreyer_old(int n,DMM m1,DMM m2) |
Line 3302 int compdmm(int n,DMM m1,DMM m2) |
|
Line 3369 int compdmm(int n,DMM m1,DMM m2) |
|
else return (*cmpdl)(n,m1->dl,m2->dl); |
else return (*cmpdl)(n,m1->dl,m2->dl); |
default: |
default: |
error("compdmm : invalid dpm_ordtype"); |
error("compdmm : invalid dpm_ordtype"); |
|
return 0; |
} |
} |
} |
} |
|
|