version 1.60, 2021/12/17 23:53:13 |
version 1.62, 2021/12/19 08:23:28 |
|
|
/* $OpenXM: OpenXM_contrib2/asir2018/engine/nd.c,v 1.59 2021/12/14 01:02:40 noro Exp $ */ |
/* $OpenXM: OpenXM_contrib2/asir2018/engine/nd.c,v 1.61 2021/12/18 04:43:59 noro Exp $ */ |
|
|
#include "nd.h" |
#include "nd.h" |
|
|
Line 2588 ND_pairs nd_remove_same_sugar( ND_pairs d, int sugar) |
|
Line 2588 ND_pairs nd_remove_same_sugar( ND_pairs d, int sugar) |
|
{ |
{ |
struct oND_pairs root; |
struct oND_pairs root; |
ND_pairs prev,cur; |
ND_pairs prev,cur; |
|
int i; |
|
|
root.next = d; |
root.next = d; |
prev = &root; cur = d; |
prev = &root; cur = d; |
|
i = 0; |
while ( cur ) { |
while ( cur ) { |
if ( SG(cur) == sugar ) |
if ( SG(cur) == sugar ) { |
prev->next = cur->next; |
prev->next = cur->next; |
else |
i++; |
|
} else |
prev = cur; |
prev = cur; |
cur = cur->next; |
cur = cur->next; |
} |
} |
|
if ( DP_Print ) fprintf(asir_out,"[%d]",i); |
return root.next; |
return root.next; |
} |
} |
|
|
Line 2713 get_eg(&eg2); add_eg(&eg_update,&eg1,&eg2); |
|
Line 2717 get_eg(&eg2); add_eg(&eg_update,&eg1,&eg2); |
|
update_hpdata(¤t_hpdata,nh); |
update_hpdata(¤t_hpdata,nh); |
dg = comp_hn(final_hpdata.hn,current_hpdata.hn); |
dg = comp_hn(final_hpdata.hn,current_hpdata.hn); |
if ( dg < 0 ) { |
if ( dg < 0 ) { |
fprintf(asir_out,"We found a gb\n"); |
int d_len; |
d = 0; |
for ( d_len = 0; d; d = d->next, d_len++); |
|
fprintf(asir_out,"[%d] We found a gb\n",d_len); |
} |
} |
sugar0 = sugar; |
sugar0 = sugar; |
while ( d && dg > sugar0 ) { |
while ( d && dg > 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 3193 get_eg(&eg2); add_eg(&eg_remove,&eg1,&eg2); |
|
Line 3197 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("Nbase=%d,Nnfnz=%d,Nnfz=%d,Nnfsingular=%d\n",Nnfnz,Nnfz,Nnfs,nd_psn); |
printf("Nbase=%d,Nnfnz=%d,Nnfz=%d,Nnfsingular=%d\n",nd_psn,Nnfnz,Nnfz,Nnfs); |
fflush(stdout); |
fflush(stdout); |
if ( nd_sba_redundant_check ) |
if ( nd_sba_redundant_check ) |
printf("Nredundant=%d\n",Nredundant); |
printf("Nredundant=%d\n",Nredundant); |
|
|
update_hpdata(¤t_hpdata,nh); |
update_hpdata(¤t_hpdata,nh); |
dg = comp_hn(final_hpdata.hn,current_hpdata.hn); |
dg = comp_hn(final_hpdata.hn,current_hpdata.hn); |
if ( dg < 0 ) { |
if ( dg < 0 ) { |
fprintf(asir_out,"We found a gb\n"); |
int d_len; |
d = 0; |
for ( d_len = 0; d; d = d->next, d_len++); |
|
fprintf(asir_out,"[%d] We found a gb\n",d_len); |
} |
} |
sugar0 = sugar; |
sugar0 = sugar; |
while ( d && dg > sugar0 ) { |
while ( d && dg > 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++; |
} |
} |