=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/engine/nd.c,v retrieving revision 1.216 retrieving revision 1.218 diff -u -p -r1.216 -r1.218 --- OpenXM_contrib2/asir2000/engine/nd.c 2013/12/20 04:35:34 1.216 +++ OpenXM_contrib2/asir2000/engine/nd.c 2014/02/24 01:45:28 1.218 @@ -1,4 +1,4 @@ -/* $OpenXM: OpenXM_contrib2/asir2000/engine/nd.c,v 1.215 2013/12/20 02:02:24 noro Exp $ */ +/* $OpenXM: OpenXM_contrib2/asir2000/engine/nd.c,v 1.217 2014/02/03 02:43:05 noro Exp $ */ #include "nd.h" @@ -2703,7 +2703,7 @@ int ndv_newps(int m,NDV a,NDV aq,int f4) nd_ps[nd_psn] = a; if ( aq ) { nd_ps_trace[nd_psn] = aq; - nd_ps_gz[nd_psn] = ndvtondvgz(aq); + if ( !nd_vc ) nd_ps_gz[nd_psn] = ndvtondvgz(aq); register_hcf(aq); nd_bound[nd_psn] = ndv_compute_bound(aq); SG(r) = SG(aq); ndl_copy(HDL(aq),DL(r)); @@ -2711,7 +2711,7 @@ int ndv_newps(int m,NDV a,NDV aq,int f4) if ( !m ) register_hcf(a); nd_bound[nd_psn] = ndv_compute_bound(a); SG(r) = SG(a); ndl_copy(HDL(a),DL(r)); - if ( !m ) nd_ps_gz[nd_psn] = ndvtondvgz(a); + if ( !m && !nd_vc ) nd_ps_gz[nd_psn] = ndvtondvgz(a); } if ( nd_demand ) { if ( aq ) { @@ -2789,7 +2789,7 @@ int ndv_setup(int mod,int trace,NODE f,int dont_sort,i hc = HCU(w[i].p); if ( trace ) { a = nd_ps_trace[i] = ndv_dup(0,w[i].p); - nd_ps_gz[i] = ndvtondvgz(a); + if ( !nd_vc ) nd_ps_gz[i] = ndvtondvgz(a); if ( !dont_removecont) ndv_removecont(0,a); register_hcf(a); am = nd_ps[i] = ndv_dup(mod,a); @@ -2799,7 +2799,7 @@ int ndv_setup(int mod,int trace,NODE f,int dont_sort,i ndv_removecont(mod,am); } else { a = nd_ps[i] = ndv_dup(mod,w[i].p); - if ( !mod ) nd_ps_gz[i] = ndvtondvgz(a); + if ( !mod && !nd_vc ) nd_ps_gz[i] = ndvtondvgz(a); if ( mod || !dont_removecont ) ndv_removecont(mod,a); if ( !mod ) register_hcf(a); } @@ -6068,21 +6068,22 @@ NODE nd_f4(int m,int **indp) node = BDY((LIST)BDY(tn)); if ( QTOS((Q)ARG0(node)) == sugar ) break; } - if ( !tn ) error("nd_f4 : inconsistent non-zero list"); - for ( t = l, ll0 = 0; t; t = NEXT(t) ) { - for ( tn = BDY((LIST)ARG1(node)); tn; tn = NEXT(tn) ) { - i1s = QTOS((Q)ARG0(BDY((LIST)BDY(tn)))); - i2s = QTOS((Q)ARG1(BDY((LIST)BDY(tn)))); - if ( t->i1 == i1s && t->i2 == i2s ) break; - } - if ( tn ) { - if ( !ll0 ) ll0 = t; - else NEXT(ll) = t; - ll = t; - } - } - if ( ll0 ) NEXT(ll) = 0; - l = ll0; + if ( tn ) { + for ( t = l, ll0 = 0; t; t = NEXT(t) ) { + for ( tn = BDY((LIST)ARG1(node)); tn; tn = NEXT(tn) ) { + i1s = QTOS((Q)ARG0(BDY((LIST)BDY(tn)))); + i2s = QTOS((Q)ARG1(BDY((LIST)BDY(tn)))); + if ( t->i1 == i1s && t->i2 == i2s ) break; + } + if ( tn ) { + if ( !ll0 ) ll0 = t; + else NEXT(ll) = t; + ll = t; + } + } + if ( ll0 ) NEXT(ll) = 0; + l = ll0; + } else l = 0; } bucket = create_pbucket(); stat = nd_sp_f4(m,0,l,bucket); @@ -7947,6 +7948,7 @@ MAT nd_btog(LIST f,LIST v,int mod,struct order_spec *o pi0 = QTOS((Q)ARG0(pi)); pi1 = QTOS((Q)ARG1(pi)); p[pi0] = c = (ND *)MALLOC(nb*sizeof(ND)); ptomp(mod,(P)ARG2(pi),&inv); + ((MQ)inv)->cont = invm(((MQ)inv)->cont,mod); u = ptond(CO,vv,(P)ONE); HCM(u) = ((MQ)inv)->cont; c[pi1] = u; @@ -8018,7 +8020,8 @@ VECT nd_btog_one(LIST f,LIST v,int mod,struct order_sp pi = BDY((LIST)BDY(t)); pi0 = QTOS((Q)ARG0(pi)); pi1 = QTOS((Q)ARG1(pi)); if ( pi1 == pos ) { - ptomp(mod,(P)ARG2(pi),&inv); + ptomp(mod,(P)ARG2(pi),&inv); + ((MQ)inv)->cont = invm(((MQ)inv)->cont,mod); u = ptond(CO,vv,(P)ONE); HCM(u) = ((MQ)inv)->cont; p[pi0] = u;