=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/engine/nd.c,v retrieving revision 1.224 retrieving revision 1.227 diff -u -p -r1.224 -r1.227 --- OpenXM_contrib2/asir2000/engine/nd.c 2016/03/31 01:40:10 1.224 +++ OpenXM_contrib2/asir2000/engine/nd.c 2016/07/11 08:00:30 1.227 @@ -1,4 +1,4 @@ -/* $OpenXM: OpenXM_contrib2/asir2000/engine/nd.c,v 1.223 2015/08/14 13:51:54 fujimoto Exp $ */ +/* $OpenXM: OpenXM_contrib2/asir2000/engine/nd.c,v 1.226 2016/04/05 04:21:18 noro Exp $ */ #include "nd.h" @@ -658,7 +658,9 @@ int ndl_module_weight_compare(UINT *d1,UINT *d2) s = 0; for ( j = 0; j < nd_nvar; j++ ) s += (GET_EXP(d1,j)-GET_EXP(d2,j))*nd_poly_weight[j]; - s += nd_module_weight[MPOS(d1)-1]-nd_module_weight[MPOS(d2)-1]; + if ( MPOS(d1) >= 1 && MPOS(d2) >= 1 ) { + s += nd_module_weight[MPOS(d1)-1]-nd_module_weight[MPOS(d2)-1]; + } if ( s > 0 ) return 1; else if ( s < 0 ) return -1; else return 0; @@ -668,10 +670,6 @@ int ndl_module_grlex_compare(UINT *d1,UINT *d2) { int i,c; - if ( !MPOS(d1) || !MPOS(d2) ) { - printf("afo\n"); - } - if ( nd_module_rank && (c = ndl_module_weight_compare(d1,d2)) ) return c; if ( nd_ispot ) { if ( nd_pot_nelim && MPOS(d1)>=nd_pot_nelim+1 && MPOS(d2) >= nd_pot_nelim+1 ) { @@ -2362,9 +2360,11 @@ again: FREENDP(l); } if ( nd_nalg ) { - print_eg("monic",&eg_monic); - print_eg("invdalg",&eg_invdalg); - print_eg("le",&eg_le); + if ( DP_Print ) { + print_eg("monic",&eg_monic); + print_eg("invdalg",&eg_invdalg); + print_eg("le",&eg_le); + } } conv_ilist(nd_demand,1,g,indp); if ( DP_Print ) { printf("nd_gb_trace done.\n"); fflush(stdout); } @@ -6624,7 +6624,9 @@ init_eg(&eg_search); } } mat->row = i; - fprintf(asir_out,"%dx%d,",mat->row,mat->col); fflush(asir_out); + if ( DP_Print ) { + fprintf(asir_out,"%dx%d,",mat->row,mat->col); fflush(asir_out); + } size = ((col+BLEN-1)/BLEN)*sizeof(unsigned long); v = CALLOC((col+BLEN-1)/BLEN,sizeof(unsigned long)); for ( rp = rp0, i = 0; rp; rp = NEXT(rp), i++ ) { @@ -6678,7 +6680,9 @@ init_eg(&eg_search); for ( i = 0; i < col; i++ ) rhead[i] = 0; /* construction of index arrays */ - fprintf(stderr,"%dx%d,",nsp+nred,col); + if ( DP_Print ) { + fprintf(stderr,"%dx%d,",nsp+nred,col); + } rvect = (NM_ind_pair *)ALLOCA(nred*sizeof(NM_ind_pair)); s0hash = (int *)ALLOCA(col*sizeof(int)); for ( i = 0, s = s0vect; i < col; i++, s += nd_wpd ) @@ -6692,7 +6696,7 @@ init_eg(&eg_search); r0 = nd_f4_red_main(m,sp0,nsp,s0vect,col,rvect,rhead,imat,nred,nz); else r0 = nd_f4_red_gz_main(sp0,nsp,trace,s0vect,col,rvect,rhead,imat,nred); -print_eg("search",&eg_search); + if ( DP_Print ) print_eg("search",&eg_search); return r0; }