version 1.13, 2019/12/27 08:13:59 |
version 1.19, 2022/09/10 05:41:43 |
|
|
* 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/builtin/dp-supp.c,v 1.12 2019/12/12 04:44:59 noro Exp $ |
* $OpenXM: OpenXM_contrib2/asir2018/builtin/dp-supp.c,v 1.18 2022/09/10 04:04:50 noro Exp $ |
*/ |
*/ |
#include "ca.h" |
#include "ca.h" |
#include "base.h" |
#include "base.h" |
Line 96 LIST get_denomlist() |
|
Line 96 LIST get_denomlist() |
|
return l; |
return l; |
} |
} |
|
|
|
int dp_iszp(DP p) |
|
{ |
|
MP m; |
|
|
|
if ( !p ) return 1; |
|
for ( m = BDY(p); m; m = NEXT(m)) |
|
if ( !INT(m->c) ) return 0; |
|
return 1; |
|
} |
|
|
void dp_ptozp(DP p,DP *rp) |
void dp_ptozp(DP p,DP *rp) |
{ |
{ |
MP m,mr,mr0; |
MP m,mr,mr0; |
Line 147 void dp_ptozp2(DP p0,DP p1,DP *hp,DP *rp) |
|
Line 157 void dp_ptozp2(DP p0,DP p1,DP *hp,DP *rp) |
|
*hp = h; *rp = r; |
*hp = h; *rp = r; |
} |
} |
|
|
|
int dpm_iszp(DPM p) |
|
{ |
|
DMM m; |
|
|
|
if ( !p ) return 1; |
|
for ( m = BDY(p); m; m = NEXT(m)) |
|
if ( !INT(m->c) ) return 0; |
|
return 1; |
|
} |
|
|
void dpm_ptozp(DPM p,Z *cont,DPM *rp) |
void dpm_ptozp(DPM p,Z *cont,DPM *rp) |
{ |
{ |
DMM m,mr,mr0; |
DMM m,mr,mr0; |
Line 315 int _dl_redble(DL d1,DL d2,int nvar) |
|
Line 335 int _dl_redble(DL d1,DL d2,int nvar) |
|
return 1; |
return 1; |
} |
} |
|
|
|
int _dl_redble_ext(DL d1,DL d2,DL quo,int nvar) |
|
{ |
|
int i; |
|
|
|
if ( (quo->td = d2->td-d1->td) < 0 ) |
|
return 0; |
|
for ( i = 0; i < nvar; i++ ) |
|
if ( (quo->d[i] = d2->d[i]-d1->d[i]) < 0 ) |
|
break; |
|
if ( i < nvar ) |
|
return 0; |
|
else |
|
return 1; |
|
} |
|
|
void insert_to_node(DL d,NODE *n,int nvar) |
void insert_to_node(DL d,NODE *n,int nvar) |
{ |
{ |
DL d1; |
DL d1; |
Line 850 void dp_red(DP p0,DP p1,DP p2,DP *head,DP *rest,P *dnp |
|
Line 885 void dp_red(DP p0,DP p1,DP p2,DP *head,DP *rest,P *dnp |
|
divsz(c2,gn,&c); c2 = c; |
divsz(c2,gn,&c); c2 = c; |
} |
} |
} else { |
} else { |
ezgcdpz(CO,(P)c1,(P)c2,&g); |
ezgcdp(CO,(P)c1,(P)c2,&g); |
divsp(CO,(P)c1,g,&a); c1 = (Z)a; divsp(CO,(P)c2,g,&a); c2 = (Z)a; |
divsp(CO,(P)c1,g,&a); c1 = (Z)a; divsp(CO,(P)c2,g,&a); c2 = (Z)a; |
add_denomlist(g); |
add_denomlist(g); |
} |
} |
Line 893 void dpm_red(DPM p0,DPM p1,DPM p2,DPM *head,DPM *rest, |
|
Line 928 void dpm_red(DPM p0,DPM p1,DPM p2,DPM *head,DPM *rest, |
|
divsz(c2,gn,&c); c2 = c; |
divsz(c2,gn,&c); c2 = c; |
} |
} |
} else { |
} else { |
ezgcdpz(CO,(P)c1,(P)c2,&g); |
ezgcdp(CO,(P)c1,(P)c2,&g); |
divsp(CO,(P)c1,g,&a); c1 = (Z)a; divsp(CO,(P)c2,g,&a); c2 = (Z)a; |
divsp(CO,(P)c1,g,&a); c1 = (Z)a; divsp(CO,(P)c2,g,&a); c2 = (Z)a; |
add_denomlist(g); |
add_denomlist(g); |
} |
} |
Line 935 void dpm_red2(DPM p1,DPM p2,DPM *rest,P *dnp,DP *multp |
|
Line 970 void dpm_red2(DPM p1,DPM p2,DPM *rest,P *dnp,DP *multp |
|
divsz(c2,gn,&c); c2 = c; |
divsz(c2,gn,&c); c2 = c; |
} |
} |
} else { |
} else { |
ezgcdpz(CO,(P)c1,(P)c2,&g); |
ezgcdp(CO,(P)c1,(P)c2,&g); |
divsp(CO,(P)c1,g,&a); c1 = (Z)a; divsp(CO,(P)c2,g,&a); c2 = (Z)a; |
divsp(CO,(P)c1,g,&a); c1 = (Z)a; divsp(CO,(P)c2,g,&a); c2 = (Z)a; |
add_denomlist(g); |
add_denomlist(g); |
} |
} |
Line 981 void dp_red_marked(DP p0,DP p1,DP p2,DP hp2,DP *head,D |
|
Line 1016 void dp_red_marked(DP p0,DP p1,DP p2,DP hp2,DP *head,D |
|
divsz(c2,gn,&c); c2 = c; |
divsz(c2,gn,&c); c2 = c; |
} |
} |
} else { |
} else { |
ezgcdpz(CO,(P)c1,(P)c2,&g); |
ezgcdp(CO,(P)c1,(P)c2,&g); |
divsp(CO,(P)c1,g,&a); c1 = (Z)a; divsp(CO,(P)c2,g,&a); c2 = (Z)a; |
divsp(CO,(P)c1,g,&a); c1 = (Z)a; divsp(CO,(P)c2,g,&a); c2 = (Z)a; |
} |
} |
NEWMP(m); m->dl = d; m->c = (Obj)c1; NEXT(m) = 0; MKDP(n,m,s); s->sugar = d->td; |
NEWMP(m); m->dl = d; m->c = (Obj)c1; NEXT(m) = 0; MKDP(n,m,s); s->sugar = d->td; |
Line 2747 int create_order_spec(VL vl,Obj obj,struct order_spec |
|
Line 2782 int create_order_spec(VL vl,Obj obj,struct order_spec |
|
spec->pot_nelim = 0; |
spec->pot_nelim = 0; |
break; |
break; |
|
|
case 3: /* [n,[wv,wm],ord] */ |
case 3: /* [n,[mlist1,mlist2,...],ord] or [n,[wv,wm],ord] */ |
spec->module_ordtype = ZTOS((Z)BDY(node)); |
spec->module_ordtype = ZTOS((Z)BDY(node)); |
if ( spec->module_ordtype < 0 ) { |
if ( spec->module_ordtype < 0 ) { |
spec->pot_nelim = -spec->module_ordtype; |
spec->pot_nelim = -spec->module_ordtype; |
Line 3323 void dp_mod(DP p,int mod,NODE subst,DP *rp) |
|
Line 3358 void dp_mod(DP p,int mod,NODE subst,DP *rp) |
|
} |
} |
} |
} |
|
|
|
void dpm_mod(DPM p,int mod,DPM *rp) |
|
{ |
|
DMM m,mr,mr0; |
|
P t; |
|
V v; |
|
NODE tn; |
|
|
|
if ( !p ) |
|
*rp = 0; |
|
else { |
|
for ( mr0 = 0, m = BDY(p); m; m = NEXT(m) ) { |
|
ptomp(mod,(P)m->c,&t); |
|
if ( t ) { |
|
NEXTDMM(mr0,mr); mr->c = (Obj)t; mr->dl = m->dl; |
|
} |
|
} |
|
if ( mr0 ) { |
|
NEXT(mr) = 0; MKDPM(p->nv,mr0,*rp); (*rp)->sugar = p->sugar; |
|
} else |
|
*rp = 0; |
|
} |
|
} |
|
|
void dp_rat(DP p,DP *rp) |
void dp_rat(DP p,DP *rp) |
{ |
{ |
MP m,mr,mr0; |
MP m,mr,mr0; |
Line 3622 void dpm_rest(DPM p,DPM *rp) |
|
Line 3680 void dpm_rest(DPM p,DPM *rp) |
|
if ( *rp ) |
if ( *rp ) |
(*rp)->sugar = p->sugar; |
(*rp)->sugar = p->sugar; |
} |
} |
|
} |
|
|
|
int dp_getdeg(DP p) |
|
{ |
|
int max,n,i; |
|
MP m; |
|
int *d; |
|
|
|
if ( !p ) return 0; |
|
n = p->nv; |
|
max = 0; |
|
for ( m = BDY(p); m; m = NEXT(m) ) { |
|
d = m->dl->d; |
|
for ( i = 0; i < n; i++ ) |
|
if ( d[i] > max ) max = d[i]; |
|
} |
|
return max; |
} |
} |
|
|
int dpm_getdeg(DPM p,int *r) |
int dpm_getdeg(DPM p,int *r) |