version 1.62, 2021/12/19 08:23:28 |
version 1.64, 2022/03/09 07:50:51 |
|
|
/* $OpenXM: OpenXM_contrib2/asir2018/engine/nd.c,v 1.61 2021/12/18 04:43:59 noro Exp $ */ |
/* $OpenXM: OpenXM_contrib2/asir2018/engine/nd.c,v 1.63 2022/01/13 08:15:02 noro Exp $ */ |
|
|
#include "nd.h" |
#include "nd.h" |
|
|
Line 70 static NODE nd_tracelist; |
|
Line 70 static NODE nd_tracelist; |
|
static NODE nd_alltracelist; |
static NODE nd_alltracelist; |
static int nd_gentrace,nd_gensyz,nd_nora,nd_newelim,nd_intersect,nd_lf,nd_norb; |
static int nd_gentrace,nd_gensyz,nd_nora,nd_newelim,nd_intersect,nd_lf,nd_norb; |
static int nd_f4_td,nd_sba_f4step,nd_sba_pot,nd_sba_largelcm,nd_sba_dontsort,nd_sba_redundant_check; |
static int nd_f4_td,nd_sba_f4step,nd_sba_pot,nd_sba_largelcm,nd_sba_dontsort,nd_sba_redundant_check; |
static int nd_top,nd_sba_syz,nd_sba_inputisgb; |
static int nd_top,nd_sba_syz,nd_sba_inputisgb,nd_sba_heu; |
static int *nd_gbblock; |
static int *nd_gbblock; |
static NODE nd_nzlist,nd_check_splist; |
static NODE nd_nzlist,nd_check_splist; |
static int nd_splist; |
static int nd_splist; |
Line 1303 INLINE int ndl_find_reducer_s(UINT *dg,SIG sig) |
|
Line 1303 INLINE int ndl_find_reducer_s(UINT *dg,SIG sig) |
|
quo->pos = nd_psh[i]->sig->pos; |
quo->pos = nd_psh[i]->sig->pos; |
_adddl(nd_nvar,DL(quo),nd_sba_hm[quo->pos],DL2(quo)); |
_adddl(nd_nvar,DL(quo),nd_sba_hm[quo->pos],DL2(quo)); |
ret = comp_sig(sig,quo); |
ret = comp_sig(sig,quo); |
|
// if ( ret >= 0 ) { singular = 0; break; } |
if ( ret > 0 ) { singular = 0; break; } |
if ( ret > 0 ) { singular = 0; break; } |
if ( ret == 0 ) { /* fprintf(asir_out,"s"); fflush(asir_out); */ singular = 1; } |
if ( ret == 0 ) { /* fprintf(asir_out,"s"); fflush(asir_out); */ singular = 1; } |
} |
} |
Line 2423 int do_diagonalize(int sugar,int m) |
|
Line 2424 int do_diagonalize(int sugar,int m) |
|
LIST l; |
LIST l; |
Z iq; |
Z iq; |
|
|
|
if ( diag_period == 0 ) return 1; |
for ( i = nd_psn-1; i >= 0 && SG(nd_psh[i]) == sugar; i-- ) { |
for ( i = nd_psn-1; i >= 0 && SG(nd_psh[i]) == sugar; i-- ) { |
if ( nd_gentrace ) { |
if ( nd_gentrace ) { |
/* Trace = [1,index,1,1] */ |
/* Trace = [1,index,1,1] */ |
Line 2601 ND_pairs nd_remove_same_sugar( ND_pairs d, int sugar) |
|
Line 2603 ND_pairs nd_remove_same_sugar( ND_pairs d, int sugar) |
|
prev = cur; |
prev = cur; |
cur = cur->next; |
cur = cur->next; |
} |
} |
if ( DP_Print ) fprintf(asir_out,"[%d]",i); |
if ( DP_Print && i ) fprintf(asir_out,"[%d]",i); |
return root.next; |
return root.next; |
} |
} |
|
|
|
|
get_eg(&eg2); add_eg(&eg_updatepairs,&eg1,&eg2); |
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 ) { |
|
int dg,sugar0; |
|
|
get_eg(&eg1); |
get_eg(&eg1); |
update_hpdata(¤t_hpdata,nh); |
update_hpdata(¤t_hpdata,nh); |
get_eg(&eg2); add_eg(&eg_hpdata,&eg1,&eg2); |
get_eg(&eg2); add_eg(&eg_hpdata,&eg1,&eg2); |
if ( !compp(CO,final_hpdata.hn,current_hpdata.hn) ) { |
dg = comp_hn(final_hpdata.hn,current_hpdata.hn); |
|
// if ( !compp(CO,final_hpdata.hn,current_hpdata.hn) ) |
|
if ( dg < 0 ) { |
if ( DP_Print ) { printf("\nWe found a gb.\n"); } |
if ( DP_Print ) { printf("\nWe found a gb.\n"); } |
break; |
break; |
} |
} else if ( nd_sba_heu == 1 ) { |
|
for ( i = 0; i < ngen; i++ ) { |
|
sugar0 = sugar; |
|
while ( d[i] && dg > sugar0 ) { |
|
d[i] = nd_remove_same_sugar(d[i],sugar0); |
|
sugar0++; |
|
} |
|
} |
|
} |
} |
} |
} else { |
} else { |
d[ind] = d[ind]->next; dlen--; |
d[ind] = d[ind]->next; dlen--; |
Line 3332 int do_diagonalize_trace(int sugar,int m) |
|
Line 3346 int do_diagonalize_trace(int sugar,int m) |
|
Z iq; |
Z iq; |
P cont,cont1; |
P cont,cont1; |
|
|
|
if ( diag_period == 0 ) return 1; |
for ( i = nd_psn-1; i >= 0 && SG(nd_psh[i]) == sugar; i-- ) { |
for ( i = nd_psn-1; i >= 0 && SG(nd_psh[i]) == sugar; i-- ) { |
if ( nd_gentrace ) { |
if ( nd_gentrace ) { |
/* Trace = [1,index,1,1] */ |
/* Trace = [1,index,1,1] */ |
Line 5483 void nd_gr_trace(LIST f,LIST v,int trace,int homo,int |
|
Line 5498 void nd_gr_trace(LIST f,LIST v,int trace,int homo,int |
|
Obj obj; |
Obj obj; |
NumberField nf; |
NumberField nf; |
struct order_spec *ord1; |
struct order_spec *ord1; |
struct oEGT eg_check,eg0,eg1; |
struct oEGT eg_check,eg_gb,eg_intred,eg0,eg1; |
NODE tr,tl1,tl2,tl3,tl4; |
NODE tr,tl1,tl2,tl3,tl4; |
LIST l1,l2,l3,l4,l5; |
LIST l1,l2,l3,l4,l5; |
int *perm; |
int *perm; |
Line 5621 void nd_gr_trace(LIST f,LIST v,int trace,int homo,int |
|
Line 5636 void nd_gr_trace(LIST f,LIST v,int trace,int homo,int |
|
} |
} |
if ( MaxDeg > 0 ) nocheck = 1; |
if ( MaxDeg > 0 ) nocheck = 1; |
while ( 1 ) { |
while ( 1 ) { |
tl1 = tl2 = tl3 = tl4 = 0; |
get_eg(&eg0); |
|
tl1 = tl2 = tl3 = tl4 = 0; |
if ( Demand ) |
if ( Demand ) |
nd_demand = 1; |
nd_demand = 1; |
ret = ndv_setup(m,1,fd0,nd_gbblock?1:0,0,0); |
ret = ndv_setup(m,1,fd0,nd_gbblock?1:0,0,0); |
Line 5647 void nd_gr_trace(LIST f,LIST v,int trace,int homo,int |
|
Line 5663 void nd_gr_trace(LIST f,LIST v,int trace,int homo,int |
|
nd_init_ord(ord); |
nd_init_ord(ord); |
nd_setup_parameters(nvar,0); |
nd_setup_parameters(nvar,0); |
} |
} |
|
get_eg(&eg1); init_eg(&eg_gb); add_eg(&eg_gb,&eg0,&eg1); |
nd_demand = 0; |
nd_demand = 0; |
cand = ndv_reducebase(cand,perm); |
cand = ndv_reducebase(cand,perm); |
if ( nd_gentrace ) { tl1 = nd_alltracelist; nd_alltracelist = 0; } |
if ( nd_gentrace ) { tl1 = nd_alltracelist; nd_alltracelist = 0; } |
|
get_eg(&eg0); |
cand = ndv_reduceall(0,cand); |
cand = ndv_reduceall(0,cand); |
|
get_eg(&eg1); init_eg(&eg_intred); add_eg(&eg_intred,&eg0,&eg1); |
cbpe = nd_bpe; |
cbpe = nd_bpe; |
if ( nd_gentrace ) { tl2 = nd_alltracelist; nd_alltracelist = 0; } |
if ( nd_gentrace ) { tl2 = nd_alltracelist; nd_alltracelist = 0; } |
get_eg(&eg0); |
get_eg(&eg0); |
Line 5688 void nd_gr_trace(LIST f,LIST v,int trace,int homo,int |
|
Line 5707 void nd_gr_trace(LIST f,LIST v,int trace,int homo,int |
|
} |
} |
get_eg(&eg1); init_eg(&eg_check); add_eg(&eg_check,&eg0,&eg1); |
get_eg(&eg1); init_eg(&eg_check); add_eg(&eg_check,&eg0,&eg1); |
if ( DP_Print ) |
if ( DP_Print ) |
fprintf(asir_out,"check=%.3fsec\n",eg_check.exectime); |
fprintf(asir_out,"gb=%.3fsec,check=%.3fsec,intred=%.3fsec\n", |
|
eg_gb.exectime,eg_check.exectime,eg_intred.exectime); |
/* dp->p */ |
/* dp->p */ |
nd_bpe = cbpe; |
nd_bpe = cbpe; |
nd_setup_parameters(nd_nvar,0); |
nd_setup_parameters(nd_nvar,0); |
Line 10670 void parse_nd_option(VL vl,NODE opt) |
|
Line 10690 void parse_nd_option(VL vl,NODE opt) |
|
nd_f4_td = 0; nd_sba_f4step = 2; nd_sba_pot = 0; nd_sba_largelcm = 0; |
nd_f4_td = 0; nd_sba_f4step = 2; nd_sba_pot = 0; nd_sba_largelcm = 0; |
nd_sba_dontsort = 0; nd_top = 0; nd_sba_redundant_check = 0; |
nd_sba_dontsort = 0; nd_top = 0; nd_sba_redundant_check = 0; |
nd_sba_syz = 0; nd_sba_modord = 0; nd_sba_inputisgb = 0; |
nd_sba_syz = 0; nd_sba_modord = 0; nd_sba_inputisgb = 0; |
nd_hpdata = 0; |
nd_hpdata = 0; nd_sba_heu = 0; |
|
|
for ( t = opt; t; t = NEXT(t) ) { |
for ( t = opt; t; t = NEXT(t) ) { |
p = BDY((LIST)BDY(t)); |
p = BDY((LIST)BDY(t)); |
Line 10739 void parse_nd_option(VL vl,NODE opt) |
|
Line 10759 void parse_nd_option(VL vl,NODE opt) |
|
nd_sba_dontsort = value?1:0; |
nd_sba_dontsort = value?1:0; |
} else if ( !strcmp(key,"sba_syz") ) { |
} else if ( !strcmp(key,"sba_syz") ) { |
nd_sba_syz = value?1:0; |
nd_sba_syz = value?1:0; |
|
} else if ( !strcmp(key,"sba_heu") ) { |
|
nd_sba_heu = value?1:0; |
} else if ( !strcmp(key,"sba_modord") ) { |
} else if ( !strcmp(key,"sba_modord") ) { |
// value=[vlist,ordspec,weight] |
// value=[vlist,ordspec,weight] |
u = BDY((LIST)value); |
u = BDY((LIST)value); |