| version 1.50, 2021/03/09 05:20:35 |
version 1.52, 2021/03/09 08:48:50 |
|
|
| /* $OpenXM: OpenXM_contrib2/asir2018/engine/nd.c,v 1.49 2021/02/28 02:33:16 noro Exp $ */ |
/* $OpenXM: OpenXM_contrib2/asir2018/engine/nd.c,v 1.51 2021/03/09 07:07:02 noro Exp $ */ |
| |
|
| #include "nd.h" |
#include "nd.h" |
| |
|
| Line 2623 init_eg(&eg_update); |
|
| Line 2623 init_eg(&eg_update); |
|
| } |
} |
| sugar = 0; |
sugar = 0; |
| if ( nd_hpdata ) { |
if ( nd_hpdata ) { |
| |
if ( DP_Print ) fprintf(asir_out,"Hilbert driven algorithm.\n"); |
| setup_hpdata(&final_hpdata,¤t_hpdata); |
setup_hpdata(&final_hpdata,¤t_hpdata); |
| } |
} |
| while ( d ) { |
while ( d ) { |
|
|
| else { |
else { |
| final_hpvalue = hpvalue(&final_hpdata,sugar); |
final_hpvalue = hpvalue(&final_hpdata,sugar); |
| if ( final_hpvalue == hpvalue(¤t_hpdata,sugar) ) { |
if ( final_hpvalue == hpvalue(¤t_hpdata,sugar) ) { |
| if ( DP_Print ) fprintf(asir_out,"sugar=%d done.\n",sugar); |
// if ( DP_Print ) fprintf(asir_out,"done.\n",sugar); |
| d = nd_remove_same_sugar(d,sugar); |
d = nd_remove_same_sugar(d,sugar); |
| continue; |
continue; |
| } |
} |
| Line 2713 get_eg(&eg2); add_eg(&eg_update,&eg1,&eg2); |
|
| Line 2714 get_eg(&eg2); add_eg(&eg_update,&eg1,&eg2); |
|
| if ( nd_hpdata ) { |
if ( nd_hpdata ) { |
| update_hpdata(¤t_hpdata,nh,1); |
update_hpdata(¤t_hpdata,nh,1); |
| if ( final_hpvalue == hpvalue(¤t_hpdata,sugar) ) { |
if ( final_hpvalue == hpvalue(¤t_hpdata,sugar) ) { |
| if ( DP_Print ) fprintf(asir_out,"sugar=%d done.\n",sugar); |
// if ( DP_Print ) fprintf(asir_out,"sugar=%d done.\n",sugar); |
| d = nd_remove_same_sugar(d,sugar); |
d = nd_remove_same_sugar(d,sugar); |
| } |
} |
| } |
} |
| Line 3049 init_eg(&eg_hpdata); |
|
| Line 3050 init_eg(&eg_hpdata); |
|
| init_eg(&eg_sbabuch); |
init_eg(&eg_sbabuch); |
| get_eg(&eg3); |
get_eg(&eg3); |
| while ( 1 ) { |
while ( 1 ) { |
| if ( DP_Print && dlen%100 == 0 ) fprintf(asir_out,"(%d)",dlen); |
if ( DP_Print && !nd_hpdata && dlen%100 == 0 ) fprintf(asir_out,"(%d)",dlen); |
| again : |
again : |
| get_eg(&eg1); |
get_eg(&eg1); |
| ind = nd_minsig(d); |
ind = nd_minsig(d); |
| Line 3371 NODE nd_gb_trace(int m,int ishomo,int **indp) |
|
| Line 3372 NODE nd_gb_trace(int m,int ishomo,int **indp) |
|
| } |
} |
| sugar = 0; |
sugar = 0; |
| if ( nd_hpdata ) { |
if ( nd_hpdata ) { |
| |
if ( DP_Print ) fprintf(asir_out,"Hilbert driven algorithm.\n"); |
| setup_hpdata(&final_hpdata,¤t_hpdata); |
setup_hpdata(&final_hpdata,¤t_hpdata); |
| } |
} |
| |
|
|
|
| else { |
else { |
| final_hpvalue = hpvalue(&final_hpdata,sugar); |
final_hpvalue = hpvalue(&final_hpdata,sugar); |
| if ( final_hpvalue == hpvalue(¤t_hpdata,sugar) ) { |
if ( final_hpvalue == hpvalue(¤t_hpdata,sugar) ) { |
| if ( DP_Print ) fprintf(asir_out,"sugar=%d done.\n",sugar); |
// if ( DP_Print ) fprintf(asir_out,"sugar=%d done.\n",sugar); |
| d = nd_remove_same_sugar(d,sugar); |
d = nd_remove_same_sugar(d,sugar); |
| continue; |
continue; |
| } |
} |
|
|
| if ( nd_hpdata ) { |
if ( nd_hpdata ) { |
| update_hpdata(¤t_hpdata,nh,1); |
update_hpdata(¤t_hpdata,nh,1); |
| if ( final_hpvalue == hpvalue(¤t_hpdata,sugar) ) { |
if ( final_hpvalue == hpvalue(¤t_hpdata,sugar) ) { |
| if ( DP_Print ) fprintf(asir_out,"sugar=%d done.\n",sugar); |
// if ( DP_Print ) fprintf(asir_out,"sugar=%d done.\n",sugar); |
| d = nd_remove_same_sugar(d,sugar); |
d = nd_remove_same_sugar(d,sugar); |
| } |
} |
| } |
} |
| Line 5054 void nd_sba(LIST f,LIST v,int m,int homo,int retdp,int |
|
| Line 5056 void nd_sba(LIST f,LIST v,int m,int homo,int retdp,int |
|
| int *perm; |
int *perm; |
| EPOS oepos; |
EPOS oepos; |
| int obpe,oadv,ompos,cbpe; |
int obpe,oadv,ompos,cbpe; |
| struct oEGT eg0,eg1,egconv; |
struct oEGT eg0,eg1,egconv,egintred; |
| |
|
| nd_module = 0; |
nd_module = 0; |
| nd_demand = 0; |
nd_demand = 0; |
| Line 5140 void nd_sba(LIST f,LIST v,int m,int homo,int retdp,int |
|
| Line 5142 void nd_sba(LIST f,LIST v,int m,int homo,int retdp,int |
|
| nd_setup_parameters(nvar,0); |
nd_setup_parameters(nvar,0); |
| } |
} |
| nd_demand = 0; |
nd_demand = 0; |
| |
get_eg(&eg0); |
| x = ndv_reducebase(x,perm); |
x = ndv_reducebase(x,perm); |
| x = ndv_reduceall(m,x); |
x = ndv_reduceall(m,x); |
| |
get_eg(&eg1); init_eg(&egintred); add_eg(&egintred,&eg0,&eg1); |
| nd_setup_parameters(nd_nvar,0); |
nd_setup_parameters(nd_nvar,0); |
| get_eg(&eg0); |
get_eg(&eg0); |
| for ( r0 = 0, t = x; t; t = NEXT(t) ) { |
for ( r0 = 0, t = x; t; t = NEXT(t) ) { |
| Line 5161 void nd_sba(LIST f,LIST v,int m,int homo,int retdp,int |
|
| Line 5165 void nd_sba(LIST f,LIST v,int m,int homo,int retdp,int |
|
| } else |
} else |
| MKLIST(*rp,r0); |
MKLIST(*rp,r0); |
| get_eg(&eg1); init_eg(&egconv); add_eg(&egconv,&eg0,&eg1); |
get_eg(&eg1); init_eg(&egconv); add_eg(&egconv,&eg0,&eg1); |
| |
print_eg("intred",&egintred); fprintf(asir_out,"\n"); |
| print_eg("conv",&egconv); fprintf(asir_out,"\n"); |
print_eg("conv",&egconv); fprintf(asir_out,"\n"); |
| } |
} |
| |
|