version 1.22, 2001/09/05 01:57:32 |
version 1.23, 2001/09/05 08:09:10 |
|
|
* 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/gr.c,v 1.21 2001/09/04 08:48:19 noro Exp $ |
* $OpenXM: OpenXM_contrib2/asir2000/builtin/gr.c,v 1.22 2001/09/05 01:57:32 noro Exp $ |
*/ |
*/ |
#include "ca.h" |
#include "ca.h" |
#include "parse.h" |
#include "parse.h" |
Line 180 static int PtozpRA = 0; |
|
Line 180 static int PtozpRA = 0; |
|
|
|
int doing_f4; |
int doing_f4; |
NODE TraceList; |
NODE TraceList; |
|
NODE AllTraceList; |
|
|
int eqdl(nv,dl1,dl2) |
int eqdl(nv,dl1,dl2) |
int nv; |
int nv; |
|
|
{ |
{ |
int i,mindex,m,nochk; |
int i,mindex,m,nochk; |
struct order_spec ord1; |
struct order_spec ord1; |
|
Q q; |
VL fv,vv,vc; |
VL fv,vv,vc; |
NODE fd,fd0,fi,fi0,r,r0,t,subst,x,s,xx; |
NODE fd,fd0,fi,fi0,r,r0,t,subst,x,s,xx; |
|
NODE ind,ind0; |
|
LIST trace,gbindex; |
|
|
mindex = 0; nochk = 0; dp_fcoeffs = field; |
mindex = 0; nochk = 0; dp_fcoeffs = field; |
get_vars((Obj)f,&fv); pltovl(v,&vv); vlminus(fv,vv,&vc); |
get_vars((Obj)f,&fv); pltovl(v,&vv); vlminus(fv,vv,&vc); |
|
|
pss[i] = 0; psh[i] = 0; psc[i] = 0; ps[i] = 0; |
pss[i] = 0; psh[i] = 0; psc[i] = 0; ps[i] = 0; |
} |
} |
} |
} |
for ( r0 = 0; x; x = NEXT(x) ) { |
for ( r0 = 0, ind0 = 0; x; x = NEXT(x) ) { |
NEXTNODE(r0,r); dp_load((int)BDY(x),&ps[(int)BDY(x)]); |
NEXTNODE(r0,r); dp_load((int)BDY(x),&ps[(int)BDY(x)]); |
dtop(CO,vv,ps[(int)BDY(x)],(P *)&BDY(r)); |
dtop(CO,vv,ps[(int)BDY(x)],(P *)&BDY(r)); |
|
NEXTNODE(ind0,ind); |
|
STOQ((int)BDY(x),q); BDY(ind) = q; |
} |
} |
if ( r0 ) NEXT(r) = 0; |
if ( r0 ) NEXT(r) = 0; |
|
if ( ind0 ) NEXT(ind) = 0; |
MKLIST(*rp,r0); |
MKLIST(*rp,r0); |
|
MKLIST(gbindex,ind0); |
|
|
|
if ( GenTrace && OXCheck < 0 ) { |
|
|
|
x = AllTraceList; |
|
for ( r = 0; x; x = NEXT(x) ) { |
|
MKNODE(r0,BDY(x),r); r = r0; |
|
} |
|
MKLIST(trace,r); |
|
r0 = mknode(3,*rp,gbindex,trace); |
|
MKLIST(*rp,r0); |
|
} |
print_stat(); |
print_stat(); |
if ( ShowMag ) |
if ( ShowMag ) |
fprintf(asir_out,"\nMax_mag=%d\n",Max_mag); |
fprintf(asir_out,"\nMax_mag=%d\n",Max_mag); |
|
|
pss[i] = ps[i]->sugar; |
pss[i] = ps[i]->sugar; |
psc[i] = BDY(ps[i])->c; |
psc[i] = BDY(ps[i])->c; |
} |
} |
if ( GenTrace && (OXCheck >= 0) ) { |
if ( GenTrace ) { |
Q q; |
Q q; |
STRING fname; |
STRING fname; |
LIST input; |
LIST input; |
NODE arg; |
NODE arg,t,t1; |
Obj dmy; |
Obj dmy; |
|
|
|
t = 0; |
|
for ( i = psn-1; i >= 0; i-- ) { |
|
MKNODE(t1,ps[i],t); |
|
t = t1; |
|
} |
|
MKLIST(input,t); |
|
|
STOQ(OXCheck,q); |
if ( OXCheck >= 0 ) { |
MKSTR(fname,"register_input"); |
STOQ(OXCheck,q); |
MKLIST(input,f0); |
MKSTR(fname,"register_input"); |
arg = mknode(3,q,fname,input); |
arg = mknode(3,q,fname,input); |
Pox_cmo_rpc(arg,&dmy); |
Pox_cmo_rpc(arg,&dmy); |
|
} else if ( OXCheck < 0 ) { |
|
MKNODE(AllTraceList,input,0); |
|
} |
} |
} |
for ( s0 = 0, i = 0; i < psn; i++ ) { |
for ( s0 = 0, i = 0; i < psn; i++ ) { |
NEXTNODE(s0,s); BDY(s) = (pointer)i; |
NEXTNODE(s0,s); BDY(s) = (pointer)i; |
|
|
else |
else |
dp_ptozp(f,r); |
dp_ptozp(f,r); |
if ( GenTrace && TraceList ) { |
if ( GenTrace && TraceList ) { |
|
/* adust the denominator according to the final |
|
content reduction */ |
divsp(CO,BDY(f)->c,BDY(*r)->c,&d); |
divsp(CO,BDY(f)->c,BDY(*r)->c,&d); |
mulp(CO,(P)ARG3(BDY((LIST)BDY(TraceList))),d,&t); |
mulp(CO,(P)ARG3(BDY((LIST)BDY(TraceList))),d,&t); |
ARG3(BDY((LIST)BDY(TraceList))) = t; |
ARG3(BDY((LIST)BDY(TraceList))) = t; |
|
|
_dp_mod(a,m,subst,&psm[psn]); |
_dp_mod(a,m,subst,&psm[psn]); |
if ( GenTrace ) { |
if ( GenTrace ) { |
NODE tn,tr,tr1; |
NODE tn,tr,tr1; |
LIST trace; |
LIST trace,trace1; |
|
NODE arg; |
|
Q q1,q2; |
|
STRING fname; |
|
Obj dmy; |
|
|
/* reverse the TraceList */ |
/* reverse the TraceList */ |
tn = TraceList; |
tn = TraceList; |
|
|
} |
} |
MKLIST(trace,tr); |
MKLIST(trace,tr); |
if ( OXCheck >= 0 ) { |
if ( OXCheck >= 0 ) { |
NODE arg; |
|
Q q1,q2; |
|
STRING fname; |
|
Obj dmy; |
|
|
|
STOQ(OXCheck,q1); |
STOQ(OXCheck,q1); |
MKSTR(fname,"check_trace"); |
MKSTR(fname,"check_trace"); |
STOQ(psn,q2); |
STOQ(psn,q2); |
arg = mknode(5,q1,fname,a,q2,trace); |
arg = mknode(5,q1,fname,a,q2,trace); |
Pox_cmo_rpc(arg,&dmy); |
Pox_cmo_rpc(arg,&dmy); |
|
} else if ( OXCheck < 0 ) { |
|
STOQ(psn,q1); |
|
tn = mknode(2,q1,trace); |
|
MKLIST(trace1,tn); |
|
MKNODE(tr,trace1,AllTraceList); |
|
AllTraceList = tr; |
} else |
} else |
dp_save(psn,(Obj)trace,"t"); |
dp_save(psn,(Obj)trace,"t"); |
TraceList = 0; |
TraceList = 0; |