version 1.58, 2021/12/07 08:58:08 |
version 1.60, 2021/12/17 23:53:13 |
|
|
/* $OpenXM: OpenXM_contrib2/asir2018/engine/nd.c,v 1.57 2021/12/07 08:48:34 noro Exp $ */ |
/* $OpenXM: OpenXM_contrib2/asir2018/engine/nd.c,v 1.59 2021/12/14 01:02:40 noro Exp $ */ |
|
|
#include "nd.h" |
#include "nd.h" |
|
|
Line 2505 void setup_hpdata(HPDATA final,HPDATA current) |
|
Line 2505 void setup_hpdata(HPDATA final,HPDATA current) |
|
|
|
final->n = n = nd_nvar; |
final->n = n = nd_nvar; |
final->hn = (P)BDY(nd_hpdata); |
final->hn = (P)BDY(nd_hpdata); |
|
#if 0 |
if ( NEXT(nd_hpdata) != 0 && (weight=(LIST)BDY(NEXT(nd_hpdata))) != 0 ) { |
if ( NEXT(nd_hpdata) != 0 && (weight=(LIST)BDY(NEXT(nd_hpdata))) != 0 ) { |
wlen = length(BDY(weight)); |
wlen = length(BDY(weight)); |
if ( n != wlen ) |
if ( n != wlen ) |
Line 2514 void setup_hpdata(HPDATA final,HPDATA current) |
|
Line 2515 void setup_hpdata(HPDATA final,HPDATA current) |
|
w[i] = ZTOS((Z)BDY(nd)); |
w[i] = ZTOS((Z)BDY(nd)); |
} else |
} else |
w = 0; |
w = 0; |
|
#else |
|
w = current_dl_weight_vector; |
|
#endif |
MKVECT(x,n); |
MKVECT(x,n); |
for ( i = 0; i < n; i++ ) { |
for ( i = 0; i < n; i++ ) { |
NEWDL(dl,n); dl->d[i] = 1; dl->td = 1; BDY(x)[i] = dl; |
NEWDL(dl,n); dl->d[i] = 1; dl->td = 1; BDY(x)[i] = dl; |
Line 2712 get_eg(&eg2); add_eg(&eg_update,&eg1,&eg2); |
|
Line 2716 get_eg(&eg2); add_eg(&eg_update,&eg1,&eg2); |
|
fprintf(asir_out,"We found a gb\n"); |
fprintf(asir_out,"We found a gb\n"); |
d = 0; |
d = 0; |
} |
} |
if ( dg > sugar ) { |
|
// printexpr(CO,(Obj)current_hpdata.hn); |
|
fprintf(asir_out,"\n"); |
|
} |
|
sugar0 = sugar; |
sugar0 = sugar; |
while ( d && dg > sugar0 ) { |
while ( d && dg > sugar0 ) { |
if ( DP_Print ) fprintf(asir_out,"sugar=%d done.\n",sugar0); |
if ( DP_Print ) { fprintf(asir_out,"[%d]",sugar0); fflush(asir_out); } |
d = nd_remove_same_sugar(d,sugar0); |
d = nd_remove_same_sugar(d,sugar0); |
sugar0++; |
sugar0++; |
} |
} |
Line 2738 get_eg(&eg2); add_eg(&eg_update,&eg1,&eg2); |
|
Line 2738 get_eg(&eg2); add_eg(&eg_update,&eg1,&eg2); |
|
} |
} |
conv_ilist(nd_demand,0,g,indp); |
conv_ilist(nd_demand,0,g,indp); |
if ( !checkonly && DP_Print ) { |
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); |
fprintf(asir_out,"Nremoved=%d\n",NcriB+NcriMF+Ncri2); |
fflush(asir_out); |
fflush(asir_out); |
} |
} |
Line 3193 get_eg(&eg2); add_eg(&eg_remove,&eg1,&eg2); |
|
Line 3193 get_eg(&eg2); add_eg(&eg_remove,&eg1,&eg2); |
|
g = conv_ilist_s(nd_demand,0,indp); |
g = conv_ilist_s(nd_demand,0,indp); |
if ( DP_Print ) { |
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("\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); |
fflush(stdout); |
if ( nd_sba_redundant_check ) |
if ( nd_sba_redundant_check ) |
printf("Nredundant=%d\n",Nredundant); |
printf("Nredundant=%d\n",Nredundant); |
|
|
fprintf(asir_out,"We found a gb\n"); |
fprintf(asir_out,"We found a gb\n"); |
d = 0; |
d = 0; |
} |
} |
if ( dg > sugar ) { |
|
// printexpr(CO,(Obj)current_hpdata.hn); |
|
fprintf(asir_out,"\n"); |
|
} |
|
sugar0 = sugar; |
sugar0 = sugar; |
while ( d && dg > sugar0 ) { |
while ( d && dg > sugar0 ) { |
if ( DP_Print ) fprintf(asir_out,"sugar=%d done.\n",sugar0); |
if ( DP_Print ) { fprintf(asir_out,"[%d]",sugar0); fflush(asir_out); } |
d = nd_remove_same_sugar(d,sugar0); |
d = nd_remove_same_sugar(d,sugar0); |
sugar0++; |
sugar0++; |
} |
} |
|
|
} |
} |
} |
} |
conv_ilist(nd_demand,1,g,indp); |
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; |
return g; |
} |
} |
|
|