version 1.30, 2020/07/03 03:37:59 |
version 1.34, 2020/07/10 08:09:05 |
|
|
/* $OpenXM: OpenXM_contrib2/asir2018/engine/nd.c,v 1.29 2020/07/02 09:24:17 noro Exp $ */ |
/* $OpenXM: OpenXM_contrib2/asir2018/engine/nd.c,v 1.33 2020/07/09 02:33:38 noro Exp $ */ |
|
|
#include "nd.h" |
#include "nd.h" |
|
|
Line 786 int ndl_module_compare(UINT *d1,UINT *d2) |
|
Line 786 int ndl_module_compare(UINT *d1,UINT *d2) |
|
|
|
extern DMMstack dmm_stack; |
extern DMMstack dmm_stack; |
void _addtodl(int n,DL d1,DL d2); |
void _addtodl(int n,DL d1,DL d2); |
|
void _adddl(int n,DL d1,DL d2,DL d3); |
int _eqdl(int n,DL d1,DL d2); |
int _eqdl(int n,DL d1,DL d2); |
|
|
int ndl_module_schreyer_compare(UINT *m1,UINT *m2) |
int ndl_module_schreyer_compare(UINT *m1,UINT *m2) |
Line 2624 NODE nd_sba_buch(int m,int ishomo,int **indp) |
|
Line 2625 NODE nd_sba_buch(int m,int ishomo,int **indp) |
|
NODE *syzlist; |
NODE *syzlist; |
int Nredundant; |
int Nredundant; |
DL lcm,quo,mul; |
DL lcm,quo,mul; |
struct oEGT eg1,eg2,eg_update,eg_remove,eg_large; |
struct oEGT eg1,eg2,eg_update,eg_remove,eg_large,eg_nf,eg_nfzero; |
|
|
init_eg(&eg_remove); |
init_eg(&eg_remove); |
syzlist = (NODE *)MALLOC(nd_psn*sizeof(NODE)); |
syzlist = (NODE *)MALLOC(nd_psn*sizeof(NODE)); |
Line 2646 init_eg(&eg_remove); |
|
Line 2647 init_eg(&eg_remove); |
|
init_eg(&eg_create); |
init_eg(&eg_create); |
init_eg(&eg_merge); |
init_eg(&eg_merge); |
init_eg(&eg_large); |
init_eg(&eg_large); |
|
init_eg(&eg_nf); |
|
init_eg(&eg_nfzero); |
while ( d ) { |
while ( d ) { |
again: |
again: |
if ( DP_Print ) { |
if ( DP_Print ) { |
|
|
d = nd_reconstruct(0,d); |
d = nd_reconstruct(0,d); |
goto again; |
goto again; |
} |
} |
|
get_eg(&eg1); |
#if USE_GEOBUCKET |
#if USE_GEOBUCKET |
stat = m?nd_nf_pbucket_s(m,h,nd_ps,!Top,&nf):nd_nf_s(m,0,h,nd_ps,!Top,&nf); |
stat = m?nd_nf_pbucket_s(m,h,nd_ps,!Top,&nf):nd_nf_s(m,0,h,nd_ps,!Top,&nf); |
#else |
#else |
stat = nd_nf_s(m,0,h,nd_ps,!Top,&nf); |
stat = nd_nf_s(m,0,h,nd_ps,!Top,&nf); |
#endif |
#endif |
|
get_eg(&eg2); |
if ( !stat ) { |
if ( !stat ) { |
NEXT(l) = d; d = l; |
NEXT(l) = d; d = l; |
d = nd_reconstruct(0,d); |
d = nd_reconstruct(0,d); |
|
|
FREENDP(l); |
FREENDP(l); |
} else if ( nf ) { |
} else if ( nf ) { |
if ( DP_Print ) { printf("+"); fflush(stdout); } |
if ( DP_Print ) { printf("+"); fflush(stdout); } |
|
add_eg(&eg_nf,&eg1,&eg2); |
hc = HCU(nf); |
hc = HCU(nf); |
nd_removecont(m,nf); |
nd_removecont(m,nf); |
nfv = ndtondv(m,nf); nd_free(nf); |
nfv = ndtondv(m,nf); nd_free(nf); |
|
|
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); |
FREENDP(l); |
FREENDP(l); |
} else { |
} else { |
|
add_eg(&eg_nfzero,&eg1,&eg2); |
// syzygy |
// syzygy |
get_eg(&eg1); |
get_eg(&eg1); |
d = remove_spair_s(d,sig); |
d = remove_spair_s(d,sig); |
Line 2711 get_eg(&eg2); add_eg(&eg_remove,&eg1,&eg2); |
|
Line 2718 get_eg(&eg2); add_eg(&eg_remove,&eg1,&eg2); |
|
print_eg("create",&eg_create); |
print_eg("create",&eg_create); |
print_eg("merge",&eg_merge); |
print_eg("merge",&eg_merge); |
print_eg("remove",&eg_remove); |
print_eg("remove",&eg_remove); |
|
print_eg("nf",&eg_nf); |
|
print_eg("nfzero",&eg_nfzero); |
printf("\n"); |
printf("\n"); |
} |
} |
return g; |
return g; |
Line 3200 int comp_sig(SIG s1,SIG s2) |
|
Line 3209 int comp_sig(SIG s1,SIG s2) |
|
if ( nvar != nd_nvar ) { |
if ( nvar != nd_nvar ) { |
nvar = nd_nvar; NEWDL(m1,nvar); NEWDL(m2,nvar); |
nvar = nd_nvar; NEWDL(m1,nvar); NEWDL(m2,nvar); |
} |
} |
// _ndltodl(DL(nd_psh[s1->pos]),m1); |
#if 0 |
// _ndltodl(DL(nd_psh[s2->pos]),m2); |
|
_copydl(nd_nvar,nd_sba_hm[s1->pos],m1); |
_copydl(nd_nvar,nd_sba_hm[s1->pos],m1); |
_copydl(nd_nvar,nd_sba_hm[s2->pos],m2); |
_copydl(nd_nvar,nd_sba_hm[s2->pos],m2); |
_addtodl(nd_nvar,s1->dl,m1); |
_addtodl(nd_nvar,s1->dl,m1); |
_addtodl(nd_nvar,s2->dl,m2); |
_addtodl(nd_nvar,s2->dl,m2); |
|
#else |
|
_adddl(nd_nvar,s1->dl,nd_sba_hm[s1->pos],m1); |
|
_adddl(nd_nvar,s2->dl,nd_sba_hm[s2->pos],m2); |
|
#endif |
ret = (*cmpdl)(nd_nvar,m1,m2); |
ret = (*cmpdl)(nd_nvar,m1,m2); |
if ( ret != 0 ) return ret; |
if ( ret != 0 ) return ret; |
else if ( s1->pos > s2->pos ) return 1; |
else if ( s1->pos > s2->pos ) return 1; |
Line 3679 ND_pairs nd_minsugarp_s( ND_pairs d, ND_pairs *prest ) |
|
Line 3691 ND_pairs nd_minsugarp_s( ND_pairs d, ND_pairs *prest ) |
|
int msugar; |
int msugar; |
ND_pairs t,last; |
ND_pairs t,last; |
|
|
#if 0 |
|
for ( msugar = SG(d), t = d; t; t = NEXT(t) ) |
for ( msugar = SG(d), t = d; t; t = NEXT(t) ) |
if ( SG(t) == msugar ) last = t; |
if ( SG(t) == msugar ) last = t; |
#else |
|
msugar = (d->sig->dl->td)+nd_sba_hm[d->sig->pos]->td; |
|
for ( t = d; t; t = NEXT(t) ) |
|
if ( ((t->sig->dl->td)+nd_sba_hm[t->sig->pos]->td) == msugar ) last = t; |
|
#endif |
|
*prest = last->next; |
*prest = last->next; |
last->next = 0; |
last->next = 0; |
return d; |
return d; |
Line 4331 void nd_sba(LIST f,LIST v,int m,int homo,int retdp,int |
|
Line 4337 void nd_sba(LIST f,LIST v,int m,int homo,int retdp,int |
|
for ( r0 = 0, t = x; t; t = NEXT(t) ) { |
for ( r0 = 0, t = x; t; t = NEXT(t) ) { |
NEXTNODE(r0,r); |
NEXTNODE(r0,r); |
if ( retdp ) BDY(r) = ndvtodp(m,BDY(t)); |
if ( retdp ) BDY(r) = ndvtodp(m,BDY(t)); |
BDY(r) = ndvtop(m,CO,vv,BDY(t)); |
else BDY(r) = ndvtop(m,CO,vv,BDY(t)); |
} |
} |
if ( r0 ) NEXT(r) = 0; |
if ( r0 ) NEXT(r) = 0; |
MKLIST(*rp,r0); |
MKLIST(*rp,r0); |
Line 4852 DL ndltodl(int n,UINT *ndl) |
|
Line 4858 DL ndltodl(int n,UINT *ndl) |
|
int i,j,l,s,ord_l; |
int i,j,l,s,ord_l; |
struct order_pair *op; |
struct order_pair *op; |
|
|
NEWDL(dl,n); |
NEWDL_NOINIT(dl,n); |
dl->td = TD(ndl); |
dl->td = TD(ndl); |
d = dl->d; |
d = dl->d; |
if ( nd_blockmask ) { |
if ( nd_blockmask ) { |
Line 10596 int nd_gauss_elim_mod64_s(mp_limb_t **mat,int *sugar,N |
|
Line 10602 int nd_gauss_elim_mod64_s(mp_limb_t **mat,int *sugar,N |
|
UINT *ct; |
UINT *ct; |
ND_pairs pair; |
ND_pairs pair; |
SIG sg; |
SIG sg; |
|
int *used; |
|
|
|
used = (int *)MALLOC(row*sizeof(int)); |
cmat = (UINT **)MALLOC(row*sizeof(UINT *)); |
cmat = (UINT **)MALLOC(row*sizeof(UINT *)); |
for ( i = 0; i < row; i++ ) { |
for ( i = 0; i < row; i++ ) { |
cmat[i] = MALLOC_ATOMIC(col*sizeof(UINT)); |
cmat[i] = MALLOC_ATOMIC(col*sizeof(UINT)); |
bzero(cmat[i],col*sizeof(UINT)); |
bzero(cmat[i],col*sizeof(UINT)); |
} |
} |
|
|
for ( rank = 0, j = 0; j < col; j++ ) { |
for ( j = 0; j < col; j++ ) { |
for ( i = rank; i < row; i++ ) { |
for ( i = 0; i < row; i++ ) { |
a = mat[i][j]; c = cmat[i][j]; |
a = mat[i][j]; c = cmat[i][j]; |
MOD128(a,c,md); |
MOD128(a,c,md); |
mat[i][j] = a; cmat[i][j] = 0; |
mat[i][j] = a; cmat[i][j] = 0; |
} |
} |
imin = -1; |
for ( i = 0; i < row; i++ ) |
for ( i = rank; i < row; i++ ) |
if ( !used[i] && mat[i][j] ) break; |
if ( mat[i][j] && (imin < 0 || comp_sig(sig[imin],sig[i]) > 0) ) imin = i; |
if ( i == row ) { |
if ( imin == -1 ) { |
|
colstat[j] = 0; |
colstat[j] = 0; |
continue; |
continue; |
} else |
} else { |
colstat[j] = 1; |
colstat[j] = 1; |
if ( imin != rank ) { |
used[i] = 1; |
t = mat[imin]; mat[imin] = mat[rank]; mat[rank] = t; |
|
ct = cmat[imin]; cmat[imin] = cmat[rank]; cmat[rank] = ct; |
|
s = sugar[imin]; sugar[imin] = sugar[rank]; sugar[rank] = s; |
|
sg = sig[imin]; sig[imin] = sig[rank]; sig[rank] = sg; |
|
if ( spactive ) { |
|
pair = spactive[imin]; spactive[imin] = spactive[rank]; |
|
spactive[rank] = pair; |
|
} |
|
} |
} |
/* column j is normalized */ |
/* column j is normalized */ |
s = sugar[rank]; |
s = sugar[i]; |
inv = invm((UINT)mat[rank][j],md); |
inv = invm((UINT)mat[i][j],md); |
/* normalize pivot row */ |
/* normalize pivot row */ |
for ( k = j, pk = mat[rank]+j, ck = cmat[rank]+j; k < col; k++, pk++, ck++ ) { |
for ( k = j, pk = mat[i]+j, ck = cmat[i]+j; k < col; k++, pk++, ck++ ) { |
a = *pk; c = *ck; MOD128(a,c,md); *pk = (a*inv)%md; *ck = 0; |
a = *pk; c = *ck; MOD128(a,c,md); *pk = (a*inv)%md; *ck = 0; |
} |
} |
for ( i = rank+1; i < row; i++ ) { |
for ( k = i+1; k < row; k++ ) { |
if ( (a = mat[i][j]) != 0 ) { |
if ( (a = mat[k][j]) != 0 ) { |
sugar[i] = MAX(sugar[i],s); |
sugar[k] = MAX(sugar[k],s); |
red_by_vect64(md,mat[i]+j,cmat[i]+j,mat[rank]+j,(int)(md-a),col-j); |
red_by_vect64(md,mat[k]+j,cmat[k]+j,mat[i]+j,(int)(md-a),col-j); |
Nf4_red++; |
Nf4_red++; |
} |
} |
} |
} |
rank++; |
|
} |
} |
#if 1 |
rank = 0; |
for ( j = col-1, l = rank-1; j >= 0; j-- ) |
for ( i = 0; i < row; i++ ) { |
if ( colstat[j] ) { |
for ( j = 0; j < col; j++ ) |
for ( k = j, pk = mat[l]+j, ck = cmat[l]+j; k < col; k++, pk++, ck++ ) { |
if ( mat[i][j] ) break; |
a = *pk; c = *ck; MOD128(a,c,md); *pk = a; *ck = 0; |
if ( j == col ) sugar[i] = -1; |
} |
else rank++; |
s = sugar[l]; |
} |
for ( i = 0; i < l; i++ ) { |
|
a = mat[i][j]; c = cmat[i][j]; MOD128(a,c,md); mat[i][j] = a; cmat[i][j] = 0; |
|
if ( a && comp_sig(sig[i],sig[l]) > 0 ) { |
|
sugar[i] = MAX(sugar[i],s); |
|
red_by_vect64(md,mat[i]+j,cmat[i]+j,mat[l]+j,(int)(md-a),col-j); |
|
Nf4_red++; |
|
} |
|
} |
|
l--; |
|
} |
|
#endif |
|
for ( i = 0; i < row; i++ ) GCFREE(cmat[i]); |
for ( i = 0; i < row; i++ ) GCFREE(cmat[i]); |
GCFREE(cmat); |
GCFREE(cmat); |
return rank; |
return rank; |
Line 10722 NODE nd_f4_red_mod64_main_s(int m,ND_pairs sp0,int nsp |
|
Line 10709 NODE nd_f4_red_mod64_main_s(int m,ND_pairs sp0,int nsp |
|
colstat = (int *)MALLOC(col*sizeof(int)); |
colstat = (int *)MALLOC(col*sizeof(int)); |
rank = nd_gauss_elim_mod64_s(spmat,spsugar,0,sprow,col,m,colstat,spsig); |
rank = nd_gauss_elim_mod64_s(spmat,spsugar,0,sprow,col,m,colstat,spsig); |
r0 = 0; |
r0 = 0; |
for ( i = 0; i < rank; i++ ) { |
for ( i = 0; i < sprow; i++ ) { |
NEXTNODE(r0,r); |
if ( spsugar[i] >= 0 ) { |
BDY(r) = vect64_to_ndv_s(spmat[i],col,s0vect); |
NEXTNODE(r0,r); |
SG((NDV)BDY(r)) = spsugar[i]; |
BDY(r) = vect64_to_ndv_s(spmat[i],col,s0vect); |
((NDV)BDY(r))->sig = spsig[i]; |
SG((NDV)BDY(r)) = spsugar[i]; |
|
((NDV)BDY(r))->sig = spsig[i]; |
|
} else |
|
syzlistp[spsig[i]->pos] = insert_sig(syzlistp[spsig[i]->pos],spsig[i]); |
GCFREE(spmat[i]); |
GCFREE(spmat[i]); |
} |
} |
if ( r0 ) NEXT(r) = 0; |
if ( r0 ) NEXT(r) = 0; |
|
|
for ( ; i < sprow; i++ ) { |
|
GCFREE(spmat[i]); |
|
syzlistp[spsig[i]->pos] = insert_sig(syzlistp[spsig[i]->pos],spsig[i]); |
|
} |
|
get_eg(&eg2); init_eg(&eg_f4_2); add_eg(&eg_f4_2,&eg1,&eg2); add_eg(&f4_elim2,&eg1,&eg2); |
get_eg(&eg2); init_eg(&eg_f4_2); add_eg(&eg_f4_2,&eg1,&eg2); add_eg(&f4_elim2,&eg1,&eg2); |
init_eg(&eg_f4); add_eg(&eg_f4,&eg0,&eg2); |
init_eg(&eg_f4); add_eg(&eg_f4,&eg0,&eg2); |
if ( DP_Print ) { |
if ( DP_Print ) { |
Line 10890 int nd_symbolic_preproc_s(PGeoBucket bucket,int trace, |
|
Line 10875 int nd_symbolic_preproc_s(PGeoBucket bucket,int trace, |
|
|
|
NODE nd_sba_f4(int m,int **indp) |
NODE nd_sba_f4(int m,int **indp) |
{ |
{ |
int i,nh,stat,index,f4red; |
int i,nh,stat,index,f4red,f4step; |
NODE r,g,tn0,tn,node; |
int col,rank,len,k,j,a,sugar,nbase,psugar,ms; |
ND_pairs d,l,t,ll0,ll,lh; |
NODE r,g,rp0,nflist; |
LIST l0,l1; |
ND_pairs d,l,t; |
ND spol,red; |
ND h,nf; |
NDV nf,redv; |
NDV nfv; |
NM s0,s; |
union oNDC hc; |
NODE rp0,srp0,nflist; |
UINT *s0vect; |
int nsp,nred,col,rank,len,k,j,a,i1s,i2s; |
|
UINT c; |
UINT c; |
UINT **spmat; |
|
UINT *s0vect,*svect,*p,*v; |
|
int *colstat; |
|
IndArray *imat; |
|
int *rhead; |
|
int spcol,sprow; |
|
int sugar,sugarh; |
|
int nbase; |
|
PGeoBucket bucket; |
PGeoBucket bucket; |
struct oEGT eg0,eg1,eg_f4; |
|
Z i1,i2,sugarq; |
|
NODE *syzlist; |
NODE *syzlist; |
|
SIG sig; |
|
struct oEGT eg0,eg1,eg_f4; |
|
struct oEGT eg2,eg_update,eg_remove,eg_large,eg_nf,eg_nfzero; |
|
|
Nf4_red=0; |
Nf4_red=0; |
d = 0; |
d = 0; |
Line 10921 NODE nd_sba_f4(int m,int **indp) |
|
Line 10898 NODE nd_sba_f4(int m,int **indp) |
|
} |
} |
nd_nbase = nd_psn; |
nd_nbase = nd_psn; |
f4red = 1; |
f4red = 1; |
|
psugar = 0; |
|
f4step = 0; |
while ( d ) { |
while ( d ) { |
l = nd_minsugarp_s(d,&d); |
for ( t = d, ms = SG(d); t; t = NEXT(t) ) |
if ( !l ) continue; |
if ( SG(t) < ms ) ms = SG(t); |
sugar = nd_sugarweight?l->sugar2:SG(l); |
if ( ms == psugar && f4step >= 2 ) { |
if ( MaxDeg > 0 && sugar > MaxDeg ) break; |
again: |
bucket = create_pbucket(); |
l = d; d = d->next; |
stat = nd_sp_f4(m,0,l,bucket); |
if ( small_lcm(l) ) { |
if ( !stat ) { |
if ( DP_Print ) fprintf(asir_out,"M"); |
for ( t = l; NEXT(t); t = NEXT(t) ); |
continue; |
NEXT(t) = d; d = l; |
} |
d = nd_reconstruct(0,d); |
sig = l->sig; |
continue; |
stat = nd_sp(m,0,l,&h); |
} |
if ( !stat ) { |
if ( bucket->m < 0 ) continue; |
NEXT(l) = d; d = l; |
col = nd_symbolic_preproc_s(bucket,0,&s0vect,&rp0); |
d = nd_reconstruct(0,d); |
if ( !col ) { |
goto again; |
for ( t = l; NEXT(t); t = NEXT(t) ); |
} |
NEXT(t) = d; d = l; |
get_eg(&eg1); |
d = nd_reconstruct(0,d); |
#if USE_GEOBUCKET |
continue; |
stat = m?nd_nf_pbucket_s(m,h,nd_ps,!Top,&nf):nd_nf_s(m,0,h,nd_ps,!Top,&nf); |
} |
#else |
if ( DP_Print ) fprintf(asir_out,"sugar=%d,",sugar); |
stat = nd_nf_s(m,0,h,nd_ps,!Top,&nf); |
l = remove_large_lcm(l); |
#endif |
nflist = nd_f4_red_s(m,l,0,s0vect,col,rp0,syzlist); |
get_eg(&eg2); |
/* adding new bases */ |
if ( !stat ) { |
for ( r = nflist; r; r = NEXT(r) ) { |
NEXT(l) = d; d = l; |
ND tmp,tmpred; |
d = nd_reconstruct(0,d); |
SIG sig; |
goto again; |
|
} else if ( stat == -1 ) { |
nf = (NDV)BDY(r); |
if ( DP_Print ) { printf("S"); fflush(stdout); } |
sig = nf->sig; |
FREENDP(l); |
tmp = ndvtond(m,nf); |
} else if ( nf ) { |
stat = nd_nf_s(m,0,tmp,nd_ps,!Top,&tmpred); |
if ( DP_Print ) { printf("+"); fflush(stdout); } |
if ( stat < 0 ) { |
add_eg(&eg_nf,&eg1,&eg2); |
// top reducible |
hc = HCU(nf); |
if ( DP_Print ) { fprintf(asir_out,"S"); fflush(asir_out); } |
nd_removecont(m,nf); |
} else if ( tmpred ) { |
nfv = ndtondv(m,nf); nd_free(nf); |
nf = ndtondv(m,tmpred); |
nh = ndv_newps(m,nfv,0); |
ndv_removecont(m,nf); |
|
nh = ndv_newps(m,nf,0); |
|
d = update_pairs_s(d,nh,syzlist); |
d = update_pairs_s(d,nh,syzlist); |
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); |
|
FREENDP(l); |
} else { |
} else { |
|
add_eg(&eg_nfzero,&eg1,&eg2); |
|
// syzygy |
|
get_eg(&eg1); |
|
d = remove_spair_s(d,sig); |
|
get_eg(&eg2); add_eg(&eg_remove,&eg1,&eg2); |
syzlist[sig->pos] = insert_sig(syzlist[sig->pos],sig); |
syzlist[sig->pos] = insert_sig(syzlist[sig->pos],sig); |
} |
if ( DP_Print ) { printf("."); fflush(stdout); } |
|
FREENDP(l); |
|
} |
|
} else { |
|
if ( ms != psugar ) f4step = 1; |
|
else f4step++; |
|
again2: |
|
psugar = ms; |
|
l = nd_minsugarp_s(d,&d); |
|
sugar = nd_sugarweight?d->sugar2:SG(d); |
|
bucket = create_pbucket(); |
|
stat = nd_sp_f4(m,0,l,bucket); |
|
if ( !stat ) { |
|
for ( t = l; NEXT(t); t = NEXT(t) ); |
|
NEXT(t) = d; d = l; |
|
d = nd_reconstruct(0,d); |
|
goto again2; |
|
} |
|
if ( bucket->m < 0 ) continue; |
|
col = nd_symbolic_preproc_s(bucket,0,&s0vect,&rp0); |
|
if ( !col ) { |
|
for ( t = l; NEXT(t); t = NEXT(t) ); |
|
NEXT(t) = d; d = l; |
|
d = nd_reconstruct(0,d); |
|
goto again2; |
|
} |
|
if ( DP_Print ) fprintf(asir_out,"\nsugar=%d,",psugar); |
|
nflist = nd_f4_red_s(m,l,0,s0vect,col,rp0,syzlist); |
|
/* adding new bases */ |
|
for ( r = nflist; r; r = NEXT(r) ) { |
|
nfv = (NDV)BDY(r); |
|
ndv_removecont(m,nfv); |
|
nh = ndv_newps(m,nfv,0); |
|
d = update_pairs_s(d,nh,syzlist); |
|
nd_sba_pos[nfv->sig->pos] = append_one(nd_sba_pos[nfv->sig->pos],nh); |
|
} |
|
for ( i = 0; i < nd_nbase; i++ ) |
|
for ( r = syzlist[i]; r; r = NEXT(r) ) |
|
d = remove_spair_s(d,(SIG)BDY(r)); |
|
d = remove_large_lcm(d); |
|
if ( DP_Print ) { |
|
fprintf(asir_out,"f4red=%d,gblen=%d",f4red,nd_psn); fflush(asir_out); |
|
} |
|
f4red++; |
} |
} |
for ( i = 0; i < nd_nbase; i++ ) |
|
for ( r = syzlist[i]; r; r = NEXT(r) ) |
|
d = remove_spair_s(d,(SIG)BDY(r)); |
|
if ( DP_Print ) { |
|
fprintf(asir_out,"f4red=%d,gblen=%d\n",f4red,length(g)); fflush(asir_out); |
|
} |
|
f4red++; |
|
if ( nd_f4red && f4red > nd_f4red ) break; |
|
if ( nd_rank0 && !nflist ) break; |
|
} |
} |
if ( DP_Print ) { |
if ( DP_Print ) { |
fprintf(asir_out,"number of red=%d,",Nf4_red); |
fprintf(asir_out,"\nnumber of red=%d,",Nf4_red); |
} |
} |
g = conv_ilist_s(nd_demand,0,indp); |
g = conv_ilist_s(nd_demand,0,indp); |
return g; |
return g; |