=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/engine/nd.c,v retrieving revision 1.142 retrieving revision 1.145 diff -u -p -r1.142 -r1.145 --- OpenXM_contrib2/asir2000/engine/nd.c 2006/08/09 02:43:38 1.142 +++ OpenXM_contrib2/asir2000/engine/nd.c 2006/08/26 05:38:06 1.145 @@ -1,4 +1,4 @@ -/* $OpenXM: OpenXM_contrib2/asir2000/engine/nd.c,v 1.141 2006/06/17 10:12:06 noro Exp $ */ +/* $OpenXM: OpenXM_contrib2/asir2000/engine/nd.c,v 1.144 2006/08/26 03:09:55 noro Exp $ */ #include "nd.h" @@ -1548,8 +1548,7 @@ int do_diagonalize(int sugar,int m) Q q,num,den; union oNDC dn; - for ( i = nd_psn-1; i >= 0; i-- ) { - if ( SG(nd_psh[i]) != sugar ) continue; + for ( i = nd_psn-1; i >= 0 && SG(nd_psh[i]) == sugar; i-- ) { if ( nd_demand ) nfv = ndv_load(i); else @@ -1677,8 +1676,7 @@ int do_diagonalize_trace(int sugar,int m) Q q,den,num; union oNDC dn; - for ( i = nd_psn-1; i >= 0; i-- ) { - if ( SG(nd_psh[i]) != sugar ) continue; + for ( i = nd_psn-1; i >= 0 && SG(nd_psh[i]) == sugar; i-- ) { /* for nd_ps */ s = ndvtond(m,nd_ps[i]); s = nd_separate_head(s,&head); @@ -2378,7 +2376,8 @@ void nd_gr(LIST f,LIST v,int m,int f4,struct order_spe NDV b; int ishomo,nalg; Alg alpha,dp; - P p; + P p,zp; + Q dmy; LIST f1,f2; Obj obj; NumberField nf; @@ -2424,7 +2423,8 @@ void nd_gr(LIST f,LIST v,int m,int f4,struct order_spe nd_setup_parameters(nvar,max); ishomo = 1; for ( fd0 = 0, t = BDY(f); t; t = NEXT(t) ) { - b = (pointer)ptondv(CO,vv,(P)BDY(t)); + ptozp((P)BDY(t),1,&dmy,&zp); + b = (pointer)ptondv(CO,vv,zp); if ( ishomo ) ishomo = ishomo && ndv_ishomo(b); if ( m ) ndv_mod(m,b); @@ -2457,7 +2457,8 @@ void nd_gr_postproc(LIST f,LIST v,int m,struct order_s NDV b; int ishomo,nalg; Alg alpha,dp; - P p; + P p,zp; + Q dmy; LIST f1,f2; Obj obj; NumberField nf; @@ -2497,7 +2498,8 @@ void nd_gr_postproc(LIST f,LIST v,int m,struct order_s nd_setup_parameters(nvar,max); ishomo = 1; for ( fd0 = 0, t = BDY(f); t; t = NEXT(t) ) { - b = (pointer)ptondv(CO,vv,(P)BDY(t)); + ptozp((P)BDY(t),1,&dmy,&zp); + b = (pointer)ptondv(CO,vv,zp); if ( ishomo ) ishomo = ishomo && ndv_ishomo(b); if ( m ) ndv_mod(m,b); @@ -2536,7 +2538,8 @@ void nd_gr_trace(LIST f,LIST v,int trace,int homo,int int m,nocheck,nvar,mindex,e,max; NDV c; NMV a; - P p; + P p,zp; + Q dmy; EPOS oepos; int obpe,oadv,wmax,i,len,cbpe,ishomo,nalg; Alg alpha,dp; @@ -2545,6 +2548,7 @@ void nd_gr_trace(LIST f,LIST v,int trace,int homo,int Obj obj; NumberField nf; struct order_spec *ord1; + struct oEGT eg_check,eg0,eg1; get_vars((Obj)f,&fv); pltovl(v,&vv); for ( nvar = 0, tv = vv; tv; tv = NEXT(tv), nvar++ ); @@ -2591,7 +2595,8 @@ void nd_gr_trace(LIST f,LIST v,int trace,int homo,int obpe = nd_bpe; oadv = nmv_adv; oepos = nd_epos; ishomo = 1; for ( in0 = 0, fd0 = 0, t = BDY(f); t; t = NEXT(t) ) { - c = ptondv(CO,vv,(P)BDY(t)); + ptozp((P)BDY(t),1,&dmy,&zp); + c = (pointer)ptondv(CO,vv,zp); if ( ishomo ) ishomo = ishomo && ndv_ishomo(c); if ( c ) { @@ -2636,6 +2641,7 @@ void nd_gr_trace(LIST f,LIST v,int trace,int homo,int cbpe = nd_bpe; if ( nocheck ) break; + get_eg(&eg0); if ( ndv_check_candidate(in0,obpe,oadv,oepos,cand) ) /* success */ break; @@ -2655,6 +2661,9 @@ void nd_gr_trace(LIST f,LIST v,int trace,int homo,int } } } + get_eg(&eg1); init_eg(&eg_check); add_eg(&eg_check,&eg0,&eg1); + if ( DP_Print ) + fprintf(asir_out,"check=%fsec\n",eg_check.exectime+eg_check.gctime); /* dp->p */ nd_bpe = cbpe; nd_setup_parameters(nd_nvar,0);