version 1.49, 2021/02/28 02:33:16 |
version 1.50, 2021/03/09 05:20:35 |
|
|
/* $OpenXM: OpenXM_contrib2/asir2018/engine/nd.c,v 1.48 2021/02/18 05:35:01 noro Exp $ */ |
/* $OpenXM: OpenXM_contrib2/asir2018/engine/nd.c,v 1.49 2021/02/28 02:33:16 noro Exp $ */ |
|
|
#include "nd.h" |
#include "nd.h" |
|
|
Line 3005 NODE nd_sba_buch(int m,int ishomo,int **indp,NODE *syz |
|
Line 3005 NODE nd_sba_buch(int m,int ishomo,int **indp,NODE *syz |
|
int Nnominimal,Nredundant; |
int Nnominimal,Nredundant; |
DL lcm,quo,mul; |
DL lcm,quo,mul; |
struct oHPDATA final_hpdata,current_hpdata; |
struct oHPDATA final_hpdata,current_hpdata; |
struct oEGT eg1,eg2,eg_update,eg_remove,eg_large,eg_nf,eg_nfzero,eg_minsig,eg_smallest; |
struct oEGT eg1,eg2,eg3,eg4,eg_update,eg_remove,eg_large,eg_nf,eg_nfzero; |
|
struct oEGT eg_minsig,eg_smallest,eg_removecont,eg_hpdata,eg_updatepairs,eg_sbabuch,eg_sp; |
int Nnfs=0,Nnfz=0,Nnfnz=0,dlen,nsyz; |
int Nnfs=0,Nnfz=0,Nnfnz=0,dlen,nsyz; |
|
|
init_eg(&eg_remove); |
init_eg(&eg_remove); |
Line 3034 init_eg(&eg_remove); |
|
Line 3035 init_eg(&eg_remove); |
|
setup_hpdata(&final_hpdata,¤t_hpdata); |
setup_hpdata(&final_hpdata,¤t_hpdata); |
} |
} |
NEWDL(lcm,nd_nvar); NEWDL(quo,nd_nvar); NEWDL(mul,nd_nvar); |
NEWDL(lcm,nd_nvar); NEWDL(quo,nd_nvar); NEWDL(mul,nd_nvar); |
|
init_eg(&eg_sp); |
init_eg(&eg_create); |
init_eg(&eg_create); |
init_eg(&eg_merge); |
init_eg(&eg_merge); |
init_eg(&eg_minsig); |
init_eg(&eg_minsig); |
Line 3041 init_eg(&eg_smallest); |
|
Line 3043 init_eg(&eg_smallest); |
|
init_eg(&eg_large); |
init_eg(&eg_large); |
init_eg(&eg_nf); |
init_eg(&eg_nf); |
init_eg(&eg_nfzero); |
init_eg(&eg_nfzero); |
|
init_eg(&eg_removecont); |
|
init_eg(&eg_updatepairs); |
|
init_eg(&eg_hpdata); |
|
init_eg(&eg_sbabuch); |
|
get_eg(&eg3); |
while ( 1 ) { |
while ( 1 ) { |
if ( DP_Print && dlen%100 == 0 ) fprintf(asir_out,"(%d)",dlen); |
if ( DP_Print && dlen%100 == 0 ) fprintf(asir_out,"(%d)",dlen); |
again : |
again : |
|
|
get_eg(&eg2); add_eg(&eg_smallest,&eg1,&eg2); |
get_eg(&eg2); add_eg(&eg_smallest,&eg1,&eg2); |
if ( l1 == 0 ) { |
if ( l1 == 0 ) { |
d[ind] = d[ind]->next; dlen--; |
d[ind] = d[ind]->next; dlen--; |
if ( DP_Print ) fprintf(asir_out,"M"); |
if ( DP_Print && !nd_hpdata ) fprintf(asir_out,"M"); |
Nnominimal++; |
Nnominimal++; |
continue; |
continue; |
} |
} |
Line 3070 get_eg(&eg2); add_eg(&eg_smallest,&eg1,&eg2); |
|
Line 3077 get_eg(&eg2); add_eg(&eg_smallest,&eg1,&eg2); |
|
pos = sig->pos; |
pos = sig->pos; |
} |
} |
} |
} |
|
get_eg(&eg1); |
stat = nd_sp(m,0,l1,&h); |
stat = nd_sp(m,0,l1,&h); |
|
get_eg(&eg2); add_eg(&eg_sp,&eg1,&eg2); |
if ( !stat ) { |
if ( !stat ) { |
nd_reconstruct_s(0,d); |
nd_reconstruct_s(0,d); |
goto again; |
goto again; |
|
|
} |
} |
add_eg(&eg_nf,&eg1,&eg2); |
add_eg(&eg_nf,&eg1,&eg2); |
hc = HCU(nf); |
hc = HCU(nf); |
|
get_eg(&eg1); |
nd_removecont(m,nf); |
nd_removecont(m,nf); |
|
get_eg(&eg2); add_eg(&eg_removecont,&eg1,&eg2); |
nfv = ndtondv(m,nf); nd_free(nf); |
nfv = ndtondv(m,nf); nd_free(nf); |
nh = ndv_newps(m,nfv,0); |
nh = ndv_newps(m,nfv,0); |
|
|
|
get_eg(&eg1); |
dlen += update_pairs_array_s(d,nh,syzlist); |
dlen += update_pairs_array_s(d,nh,syzlist); |
|
get_eg(&eg2); add_eg(&eg_updatepairs,&eg1,&eg2); |
nd_sba_pos[sig->pos] = append_one(nd_sba_pos[sig->pos],nh); |
nd_sba_pos[sig->pos] = append_one(nd_sba_pos[sig->pos],nh); |
if ( nd_hpdata ) { |
if ( nd_hpdata ) { |
|
get_eg(&eg1); |
update_hpdata(¤t_hpdata,nh,0); |
update_hpdata(¤t_hpdata,nh,0); |
|
get_eg(&eg2); add_eg(&eg_hpdata,&eg1,&eg2); |
if ( !compp(CO,final_hpdata.hn,current_hpdata.hn) ) { |
if ( !compp(CO,final_hpdata.hn,current_hpdata.hn) ) { |
if ( DP_Print ) { printf("\nWe found a gb.\n"); } |
if ( DP_Print ) { printf("\nWe found a gb.\n"); } |
break; |
break; |
Line 3132 get_eg(&eg2); add_eg(&eg_remove,&eg1,&eg2); |
|
Line 3147 get_eg(&eg2); add_eg(&eg_remove,&eg1,&eg2); |
|
if ( DP_Print ) { printf("."); fflush(stdout); } |
if ( DP_Print ) { printf("."); fflush(stdout); } |
} |
} |
} |
} |
|
get_eg(&eg4); add_eg(&eg_sbabuch,&eg3,&eg4); |
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("Nnfnz=%d,Nnfz=%d,Nnfsingular=%d\n",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); |
fflush(stdout); |
fflush(stdout); |
|
print_eg("sp",&eg_sp); |
print_eg("create",&eg_create); |
print_eg("create",&eg_create); |
print_eg("merge",&eg_merge); |
print_eg("merge",&eg_merge); |
print_eg("minsig",&eg_minsig); |
print_eg("minsig",&eg_minsig); |
print_eg("smallest",&eg_smallest); |
print_eg("smallest",&eg_smallest); |
print_eg("remove",&eg_remove); |
print_eg("remove",&eg_remove); |
|
printf("\n"); |
print_eg("nf",&eg_nf); |
print_eg("nf",&eg_nf); |
print_eg("nfzero",&eg_nfzero); |
print_eg("nfzero",&eg_nfzero); |
|
print_eg("removecont",&eg_removecont); |
|
print_eg("updatepairs",&eg_updatepairs); |
|
print_eg("hpdata",&eg_hpdata); |
|
print_eg("total",&eg_sbabuch); |
printf("\n"); |
printf("\n"); |
} |
} |
if ( nd_sba_syz ) { |
if ( nd_sba_syz ) { |
Line 10631 void parse_nd_option(VL vl,NODE opt) |
|
Line 10653 void parse_nd_option(VL vl,NODE opt) |
|
} else if ( !strcmp(key,"check_splist") ) { |
} else if ( !strcmp(key,"check_splist") ) { |
nd_check_splist = BDY((LIST)value); |
nd_check_splist = BDY((LIST)value); |
} else if ( !strcmp(key,"hpdata") ) { |
} else if ( !strcmp(key,"hpdata") ) { |
nd_hpdata = BDY((LIST)value); |
if ( value ) |
|
nd_hpdata = BDY((LIST)value); |
} else if ( !strcmp(key,"sugarweight") ) { |
} else if ( !strcmp(key,"sugarweight") ) { |
u = BDY((LIST)value); |
u = BDY((LIST)value); |
n = length(u); |
n = length(u); |