=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2018/engine/nd.c,v retrieving revision 1.57 retrieving revision 1.61 diff -u -p -r1.57 -r1.61 --- OpenXM_contrib2/asir2018/engine/nd.c 2021/12/07 08:48:34 1.57 +++ OpenXM_contrib2/asir2018/engine/nd.c 2021/12/18 04:43:59 1.61 @@ -1,4 +1,4 @@ -/* $OpenXM: OpenXM_contrib2/asir2018/engine/nd.c,v 1.56 2021/12/05 22:41:04 noro Exp $ */ +/* $OpenXM: OpenXM_contrib2/asir2018/engine/nd.c,v 1.60 2021/12/17 23:53:13 noro Exp $ */ #include "nd.h" @@ -2505,6 +2505,7 @@ void setup_hpdata(HPDATA final,HPDATA current) final->n = n = nd_nvar; final->hn = (P)BDY(nd_hpdata); +#if 0 if ( NEXT(nd_hpdata) != 0 && (weight=(LIST)BDY(NEXT(nd_hpdata))) != 0 ) { wlen = length(BDY(weight)); if ( n != wlen ) @@ -2514,6 +2515,9 @@ void setup_hpdata(HPDATA final,HPDATA current) w[i] = ZTOS((Z)BDY(nd)); } else w = 0; +#else + w = current_dl_weight_vector; +#endif MKVECT(x,n); for ( i = 0; i < n; i++ ) { NEWDL(dl,n); dl->d[i] = 1; dl->td = 1; BDY(x)[i] = dl; @@ -2584,16 +2588,20 @@ ND_pairs nd_remove_same_sugar( ND_pairs d, int sugar) { struct oND_pairs root; ND_pairs prev,cur; + int i; root.next = d; prev = &root; cur = d; + i = 0; while ( cur ) { - if ( SG(cur) == sugar ) + if ( SG(cur) == sugar ) { prev->next = cur->next; - else + i++; + } else prev = cur; cur = cur->next; } + if ( DP_Print ) fprintf(asir_out,"[%d]",i); return root.next; } @@ -2709,17 +2717,13 @@ get_eg(&eg2); add_eg(&eg_update,&eg1,&eg2); update_hpdata(¤t_hpdata,nh); dg = comp_hn(final_hpdata.hn,current_hpdata.hn); if ( dg < 0 ) { - fprintf(asir_out,"We found a gb\n"); - d = 0; + int d_len; + for ( d_len = 0; d; d = d->next, d_len++); + fprintf(asir_out,"[%d] We found a gb\n",d_len); } - if ( dg > sugar ) { - // printexpr(CO,(Obj)current_hpdata.hn); - fprintf(asir_out,"\n"); - } sugar0 = sugar; while ( d && dg > sugar0 ) { - if ( DP_Print ) fprintf(asir_out,"sugar=%d done.\n",sugar); - d = nd_remove_same_sugar(d,sugar); + d = nd_remove_same_sugar(d,sugar0); sugar0++; } } @@ -2738,7 +2742,7 @@ get_eg(&eg2); add_eg(&eg_update,&eg1,&eg2); } conv_ilist(nd_demand,0,g,indp); if ( !checkonly && DP_Print ) { - fprintf(asir_out,"\nnd_gb done. Nnd_add=%d,Npairs=%d, Nnfnz=%d,Nnfz=%d,",Nnd_add,Npairs,Nnfnz,Nnfz); + fprintf(asir_out,"\nnd_gb done. Nbase=%d,Nnd_add=%d,Npairs=%d, Nnfnz=%d,Nnfz=%d,",nd_psn,Nnd_add,Npairs,Nnfnz,Nnfz); fprintf(asir_out,"Nremoved=%d\n",NcriB+NcriMF+Ncri2); fflush(asir_out); } @@ -3193,7 +3197,7 @@ get_eg(&eg2); add_eg(&eg_remove,&eg1,&eg2); g = conv_ilist_s(nd_demand,0,indp); if ( DP_Print ) { printf("\ndlen=%d,nd_sba done. nd_add=%d,Nsyz=%d,Nsamesig=%d,Nnominimal=%d\n",dlen,Nnd_add,Nsyz,Nsamesig,Nnominimal); - printf("Nnfnz=%d,Nnfz=%d,Nnfsingular=%d\n",Nnfnz,Nnfz,Nnfs); + printf("Nbase=%d,Nnfnz=%d,Nnfz=%d,Nnfsingular=%d\n",Nnfnz,Nnfz,Nnfs,nd_psn); fflush(stdout); if ( nd_sba_redundant_check ) printf("Nredundant=%d\n",Nredundant); @@ -3516,17 +3520,13 @@ again: update_hpdata(¤t_hpdata,nh); dg = comp_hn(final_hpdata.hn,current_hpdata.hn); if ( dg < 0 ) { - fprintf(asir_out,"We found a gb\n"); - d = 0; + int d_len; + for ( d_len = 0; d; d = d->next, d_len++); + fprintf(asir_out,"[%d] We found a gb\n",d_len); } - if ( dg > sugar ) { - // printexpr(CO,(Obj)current_hpdata.hn); - fprintf(asir_out,"\n"); - } sugar0 = sugar; while ( d && dg > sugar0 ) { - if ( DP_Print ) fprintf(asir_out,"sugar=%d done.\n",sugar); - d = nd_remove_same_sugar(d,sugar); + d = nd_remove_same_sugar(d,sugar0); sugar0++; } } @@ -3546,7 +3546,7 @@ again: } } conv_ilist(nd_demand,1,g,indp); - if ( DP_Print ) { fprintf(asir_out,"\nnd_gb_trace done.\n"); fflush(asir_out); } + if ( DP_Print ) { fprintf(asir_out,"\nnd_gb_trace done. Nbase=%d\n",nd_psn); fflush(asir_out); } return g; }