=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/engine/nd.c,v retrieving revision 1.191 retrieving revision 1.194 diff -u -p -r1.191 -r1.194 --- OpenXM_contrib2/asir2000/engine/nd.c 2010/09/27 05:05:58 1.191 +++ OpenXM_contrib2/asir2000/engine/nd.c 2011/01/06 04:41:47 1.194 @@ -1,4 +1,4 @@ -/* $OpenXM: OpenXM_contrib2/asir2000/engine/nd.c,v 1.190 2010/07/14 04:36:59 noro Exp $ */ +/* $OpenXM: OpenXM_contrib2/asir2000/engine/nd.c,v 1.193 2010/12/22 09:33:57 noro Exp $ */ #include "nd.h" @@ -49,7 +49,7 @@ static int nd_demand; static int nd_module,nd_ispot,nd_mpos,nd_pot_nelim; static NODE nd_tracelist; static NODE nd_alltracelist; -static int nd_gentrace,nd_gensyz,nd_nora; +static int nd_gentrace,nd_gensyz,nd_nora,nd_newelim; static int *nd_gbblock; NumberField get_numberfield(); @@ -1343,7 +1343,7 @@ int nd_nf(int mod,ND d,ND g,NDV *ps,int full,NDC dn,ND node = mknode(4,div,iq,dmul,ONE); } sugar = MAX(sugar,SG(p)+TD(DL(mul))); - if ( !mod && g && ((double)(p_mag(HCP(g))) > hmag) ) { + if ( !mod && g && !nd_vc && ((double)(p_mag(HCP(g))) > hmag) ) { hg = HCU(g); nd_removecont2(d,g); if ( dn || nd_gentrace ) { @@ -1918,6 +1918,11 @@ again: goto again; } else if ( nf ) { if ( checkonly || gensyz ) return 0; + if ( nd_newelim ) { + if ( nd_module ) { + if ( MPOS(HDL(nf)) > 1 ) return 0; + } else if ( !(HDL(nf)[nd_exporigin] & nd_mask[0]) ) return 0; + } if ( DP_Print ) { printf("+"); fflush(stdout); } hc = HCU(nf); nd_removecont(m,nf); @@ -2818,7 +2823,7 @@ void nd_gr(LIST f,LIST v,int m,int homo,int f4,struct Q jq; int *perm; EPOS oepos; - int obpe,oadv,ompos; + int obpe,oadv,ompos,cbpe; nd_module = 0; if ( !m && Demand ) nd_demand = 1; @@ -2910,6 +2915,9 @@ void nd_gr(LIST f,LIST v,int m,int homo,int f4,struct MKLIST(l1,nd_tracelist); MKNODE(nd_alltracelist,l1,0); } x = f4?nd_f4(m,&perm):nd_gb(m,ishomo || homo,0,0,&perm); + if ( !x ) { + *rp = 0; return; + } if ( !ishomo && homo ) { /* dehomogenization */ for ( t = x; t; t = NEXT(t) ) ndv_dehomogenize((NDV)BDY(t),ord); @@ -2920,20 +2928,23 @@ void nd_gr(LIST f,LIST v,int m,int homo,int f4,struct x = ndv_reducebase(x,perm); if ( nd_gentrace ) { tl1 = nd_alltracelist; nd_alltracelist = 0; } x = ndv_reduceall(m,x); + cbpe = nd_bpe; if ( nd_gentrace ) { tl2 = nd_alltracelist; nd_alltracelist = 0; ndv_check_membership(m,fd0,obpe,oadv,oepos,x); if ( nd_gentrace ) { tl3 = nd_alltracelist; nd_alltracelist = 0; } else tl3 = 0; - nd_gb(m,0,1,nd_gensyz?1:0,0)!=0; + nd_gb(m,0,1,nd_gensyz?1:0,0); if ( nd_gentrace && nd_gensyz ) { tl4 = nd_alltracelist; nd_alltracelist = 0; } else tl4 = 0; } + nd_bpe = cbpe; + nd_setup_parameters(nd_nvar,0); for ( r0 = 0, t = x; t; t = NEXT(t) ) { NEXTNODE(r0,r); - if ( nd_module ) BDY(r) = ndvtopl(m,CO,vv,BDY(t),mrank); + if ( nd_module ) BDY(r) = ndvtopl(m,CO,vv,BDY(t),mrank); else BDY(r) = ndvtop(m,CO,vv,BDY(t)); } if ( r0 ) NEXT(r) = 0; @@ -6947,6 +6958,7 @@ void parse_nd_option(NODE opt) Obj value; nd_gentrace = 0; nd_gensyz = 0; nd_nora = 0; nd_gbblock = 0; + nd_newelim = 0; for ( t = opt; t; t = NEXT(t) ) { p = BDY((LIST)BDY(t)); key = BDY((STRING)BDY(p)); @@ -6968,6 +6980,7 @@ void parse_nd_option(NODE opt) nd_gbblock[i++] = s+QTOS((Q)BDY(NEXT(p)))-1; } nd_gbblock[i] = -1; - } + } else if ( !strcmp(key,"newelim") ) + nd_newelim = value?1:0; } }