version 1.10, 2018/10/19 23:27:38 |
version 1.14, 2019/03/03 05:21:17 |
|
|
/* $OpenXM: OpenXM_contrib2/asir2018/engine/nd.c,v 1.9 2018/10/02 09:06:15 noro Exp $ */ |
/* $OpenXM: OpenXM_contrib2/asir2018/engine/nd.c,v 1.13 2019/01/14 09:17:34 noro Exp $ */ |
|
|
#include "nd.h" |
#include "nd.h" |
|
|
struct oEGT eg_search; |
int Nnd_add,Nf4_red; |
|
struct oEGT eg_search,f4_symb,f4_conv,f4_elim1,f4_elim2; |
|
|
int diag_period = 6; |
int diag_period = 6; |
int weight_check = 1; |
int weight_check = 1; |
Line 1125 int ndl_check_bound2(int index,UINT *d2) |
|
Line 1126 int ndl_check_bound2(int index,UINT *d2) |
|
INLINE int ndl_hash_value(UINT *d) |
INLINE int ndl_hash_value(UINT *d) |
{ |
{ |
int i; |
int i; |
int r; |
UINT r; |
|
|
r = 0; |
r = 0; |
for ( i = 0; i < nd_wpd; i++ ) |
for ( i = 0; i < nd_wpd; i++ ) |
r = ((r<<16)+d[i])%REDTAB_LEN; |
r = (r*1511+d[i]); |
|
r %= REDTAB_LEN; |
return r; |
return r; |
} |
} |
|
|
Line 1216 ND nd_add(int mod,ND p1,ND p2) |
|
Line 1218 ND nd_add(int mod,ND p1,ND p2) |
|
ND r; |
ND r; |
NM m1,m2,mr0,mr,s; |
NM m1,m2,mr0,mr,s; |
|
|
|
Nnd_add++; |
if ( !p1 ) return p2; |
if ( !p1 ) return p2; |
else if ( !p2 ) return p1; |
else if ( !p2 ) return p1; |
else if ( mod == -1 ) return nd_add_sf(p1,p2); |
else if ( mod == -1 ) return nd_add_sf(p1,p2); |
Line 2081 NODE nd_gb(int m,int ishomo,int checkonly,int gensyz,i |
|
Line 2084 NODE nd_gb(int m,int ishomo,int checkonly,int gensyz,i |
|
P cont; |
P cont; |
LIST list; |
LIST list; |
|
|
|
Nnd_add = 0; |
g = 0; d = 0; |
g = 0; d = 0; |
for ( i = 0; i < nd_psn; i++ ) { |
for ( i = 0; i < nd_psn; i++ ) { |
d = update_pairs(d,g,i,gensyz); |
d = update_pairs(d,g,i,gensyz); |
|
|
} |
} |
} |
} |
conv_ilist(nd_demand,0,g,indp); |
conv_ilist(nd_demand,0,g,indp); |
if ( !checkonly && DP_Print ) { printf("nd_gb done.\n"); fflush(stdout); } |
if ( !checkonly && DP_Print ) { printf("nd_gb done. Number of nd_add=%d\n",Nnd_add); fflush(stdout); } |
return g; |
return g; |
} |
} |
|
|
Line 4086 void ndv_homogenize(NDV p,int obpe,int oadv,EPOS oepos |
|
Line 4090 void ndv_homogenize(NDV p,int obpe,int oadv,EPOS oepos |
|
NMV m,mr0,mr,t; |
NMV m,mr0,mr,t; |
|
|
len = p->len; |
len = p->len; |
for ( m = BDY(p), i = 0, max = 1; i < len; NMV_OADV(m), i++ ) |
for ( m = BDY(p), i = 0, max = 0; i < len; NMV_OADV(m), i++ ) |
max = MAX(max,TD(DL(m))); |
max = MAX(max,TD(DL(m))); |
mr0 = nmv_adv>oadv?(NMV)REALLOC(BDY(p),len*nmv_adv):BDY(p); |
mr0 = nmv_adv>oadv?(NMV)REALLOC(BDY(p),len*nmv_adv):BDY(p); |
m = (NMV)((char *)mr0+(len-1)*oadv); |
m = (NMV)((char *)mr0+(len-1)*oadv); |
Line 4231 void mpz_removecont_array(mpz_t *c,int n) |
|
Line 4235 void mpz_removecont_array(mpz_t *c,int n) |
|
{ |
{ |
mpz_t d0,a,u,u1,gcd; |
mpz_t d0,a,u,u1,gcd; |
int i,j; |
int i,j; |
mpz_t *q,*r; |
static mpz_t *q,*r; |
|
static int c_len = 0; |
|
|
for ( i = 0; i < n; i++ ) |
for ( i = 0; i < n; i++ ) |
if ( mpz_sgn(c[i]) ) break; |
if ( mpz_sgn(c[i]) ) break; |
if ( i == n ) return; |
if ( i == n ) return; |
gcdv_mpz_estimate(d0,c,n); |
gcdv_mpz_estimate(d0,c,n); |
q = (mpz_t *)MALLOC(n*sizeof(mpz_t)); |
if ( n > c_len ) { |
r = (mpz_t *)MALLOC(n*sizeof(mpz_t)); |
q = (mpz_t *)MALLOC(n*sizeof(mpz_t)); |
|
r = (mpz_t *)MALLOC(n*sizeof(mpz_t)); |
|
c_len = n; |
|
} |
for ( i = 0; i < n; i++ ) { |
for ( i = 0; i < n; i++ ) { |
mpz_init(q[i]); mpz_init(r[i]); |
mpz_init(q[i]); mpz_init(r[i]); |
mpz_fdiv_qr(q[i],r[i],c[i],d0); |
mpz_fdiv_qr(q[i],r[i],c[i],d0); |
Line 5889 Z *nm_ind_pair_to_vect(int mod,UINT *s0,int n,NM_ind_p |
|
Line 5897 Z *nm_ind_pair_to_vect(int mod,UINT *s0,int n,NM_ind_p |
|
return r; |
return r; |
} |
} |
|
|
IndArray nm_ind_pair_to_vect_compress(int trace,UINT *s0,int n,int *s0hash,NM_ind_pair pair) |
IndArray nm_ind_pair_to_vect_compress(int trace,UINT *s0,int n,NM_ind_pair pair,int start) |
{ |
{ |
NM m; |
NM m; |
NMV mr; |
NMV mr; |
UINT *d,*t,*s; |
UINT *d,*t,*s,*u; |
NDV p; |
NDV p; |
unsigned char *ivc; |
unsigned char *ivc; |
unsigned short *ivs; |
unsigned short *ivs; |
UINT *v,*ivi,*s0v; |
UINT *v,*ivi,*s0v; |
int i,j,len,prev,diff,cdiff,h; |
int i,j,len,prev,diff,cdiff,h,st,ed,md,c; |
IndArray r; |
IndArray r; |
struct oEGT eg0,eg1; |
|
|
|
m = pair->mul; |
m = pair->mul; |
d = DL(m); |
d = DL(m); |
Line 5912 struct oEGT eg0,eg1; |
|
Line 5919 struct oEGT eg0,eg1; |
|
len = LEN(p); |
len = LEN(p); |
t = (UINT *)MALLOC(nd_wpd*sizeof(UINT)); |
t = (UINT *)MALLOC(nd_wpd*sizeof(UINT)); |
v = (unsigned int *)MALLOC(len*sizeof(unsigned int)); |
v = (unsigned int *)MALLOC(len*sizeof(unsigned int)); |
get_eg(&eg0); |
for ( prev = start, mr = BDY(p), j = 0; j < len; j++, NMV_ADV(mr) ) { |
for ( i = j = 0, s = s0, mr = BDY(p); j < len; j++, NMV_ADV(mr) ) { |
ndl_add(d,DL(mr),t); |
ndl_add(d,DL(mr),t); |
st = prev; |
h = ndl_hash_value(t); |
ed = n; |
for ( ; h != s0hash[i] || !ndl_equal(t,s); s += nd_wpd, i++ ); |
while ( ed > st ) { |
v[j] = i; |
md = (st+ed)/2; |
|
u = s0+md*nd_wpd; |
|
c = DL_COMPARE(u,t); |
|
if ( c == 0 ) break; |
|
else if ( c > 0 ) st = md; |
|
else ed = md; |
|
} |
|
prev = v[j] = md; |
} |
} |
get_eg(&eg1); add_eg(&eg_search,&eg0,&eg1); |
|
r = (IndArray)MALLOC(sizeof(struct oIndArray)); |
r = (IndArray)MALLOC(sizeof(struct oIndArray)); |
r->head = v[0]; |
r->head = v[0]; |
diff = 0; |
diff = 0; |
Line 6047 int ndv_reduce_vect_q(Z *svect,int trace,int col,IndAr |
|
Line 6060 int ndv_reduce_vect_q(Z *svect,int trace,int col,IndAr |
|
int ndv_reduce_vect_q(Z *svect0,int trace,int col,IndArray *imat,NM_ind_pair *rp0,int nred) |
int ndv_reduce_vect_q(Z *svect0,int trace,int col,IndArray *imat,NM_ind_pair *rp0,int nred) |
{ |
{ |
int i,j,k,len,pos,prev; |
int i,j,k,len,pos,prev; |
mpz_t *svect; |
|
mpz_t cs,cr,gcd; |
mpz_t cs,cr,gcd; |
IndArray ivect; |
IndArray ivect; |
unsigned char *ivc; |
unsigned char *ivc; |
Line 6059 int ndv_reduce_vect_q(Z *svect0,int trace,int col,IndA |
|
Line 6071 int ndv_reduce_vect_q(Z *svect0,int trace,int col,IndA |
|
int maxrs; |
int maxrs; |
double hmag; |
double hmag; |
int l; |
int l; |
|
static mpz_t *svect; |
|
static int svect_len=0; |
|
|
maxrs = 0; |
maxrs = 0; |
for ( i = 0; i < col && !svect0[i]; i++ ); |
for ( i = 0; i < col && !svect0[i]; i++ ); |
if ( i == col ) return maxrs; |
if ( i == col ) return maxrs; |
hmag = p_mag((P)svect0[i])*nd_scale; |
hmag = p_mag((P)svect0[i])*nd_scale; |
svect = (mpz_t *)MALLOC(col*sizeof(mpz_t)); |
if ( col > svect_len ) { |
|
svect = (mpz_t *)MALLOC(col*sizeof(mpz_t)); |
|
svect_len = col; |
|
} |
for ( i = 0; i < col; i++ ) { |
for ( i = 0; i < col; i++ ) { |
mpz_init(svect[i]); |
mpz_init(svect[i]); |
if ( svect0[i] ) |
if ( svect0[i] ) |
Line 6670 NODE nd_f4(int m,int checkonly,int **indp) |
|
Line 6687 NODE nd_f4(int m,int checkonly,int **indp) |
|
PGeoBucket bucket; |
PGeoBucket bucket; |
struct oEGT eg0,eg1,eg_f4; |
struct oEGT eg0,eg1,eg_f4; |
Z i1,i2,sugarq; |
Z i1,i2,sugarq; |
|
|
|
init_eg(&f4_symb); init_eg(&f4_conv); init_eg(&f4_conv); init_eg(&f4_elim1); init_eg(&f4_elim2); |
#if 0 |
#if 0 |
ndv_alloc = 0; |
ndv_alloc = 0; |
#endif |
#endif |
|
Nf4_red=0; |
g = 0; d = 0; |
g = 0; d = 0; |
for ( i = 0; i < nd_psn; i++ ) { |
for ( i = 0; i < nd_psn; i++ ) { |
d = update_pairs(d,g,i,0); |
d = update_pairs(d,g,i,0); |
Line 6714 NODE nd_f4(int m,int checkonly,int **indp) |
|
Line 6734 NODE nd_f4(int m,int checkonly,int **indp) |
|
d = nd_reconstruct(0,d); |
d = nd_reconstruct(0,d); |
continue; |
continue; |
} |
} |
get_eg(&eg1); init_eg(&eg_f4); add_eg(&eg_f4,&eg0,&eg1); |
get_eg(&eg1); init_eg(&eg_f4); add_eg(&eg_f4,&eg0,&eg1); add_eg(&f4_symb,&eg0,&eg1); |
if ( DP_Print ) |
if ( DP_Print ) |
fprintf(asir_out,"sugar=%d,symb=%.3fsec,", |
fprintf(asir_out,"sugar=%d,symb=%.3fsec,", |
sugar,eg_f4.exectime); |
sugar,eg_f4.exectime); |
Line 6763 NODE nd_f4(int m,int checkonly,int **indp) |
|
Line 6783 NODE nd_f4(int m,int checkonly,int **indp) |
|
#if 0 |
#if 0 |
fprintf(asir_out,"ndv_alloc=%d\n",ndv_alloc); |
fprintf(asir_out,"ndv_alloc=%d\n",ndv_alloc); |
#endif |
#endif |
|
if ( DP_Print ) { |
|
fprintf(asir_out,"number of red=%d,",Nf4_red); |
|
fprintf(asir_out,"symb=%.3fsec,conv=%.3fsec,elim1=%.3fsec,elim2=%.3fsec\n", |
|
f4_symb.exectime,f4_conv.exectime,f4_elim1.exectime,f4_elim2.exectime); |
|
} |
conv_ilist(nd_demand,0,g,indp); |
conv_ilist(nd_demand,0,g,indp); |
return g; |
return g; |
} |
} |
Line 6986 NODE nd_f4_red_2(ND_pairs sp0,UINT *s0vect,int col,NOD |
|
Line 7011 NODE nd_f4_red_2(ND_pairs sp0,UINT *s0vect,int col,NOD |
|
unsigned long *v; |
unsigned long *v; |
|
|
get_eg(&eg0); |
get_eg(&eg0); |
init_eg(&eg_search); |
|
for ( sp = sp0, nsp = 0; sp; sp = NEXT(sp), nsp++ ); |
for ( sp = sp0, nsp = 0; sp; sp = NEXT(sp), nsp++ ); |
nred = length(rp0); |
nred = length(rp0); |
mat = alloc_matrix(nsp,col); |
mat = alloc_matrix(nsp,col); |
Line 7041 init_eg(&eg_search); |
|
Line 7065 init_eg(&eg_search); |
|
NODE nd_f4_red(int m,ND_pairs sp0,int trace,UINT *s0vect,int col,NODE rp0,ND_pairs *nz) |
NODE nd_f4_red(int m,ND_pairs sp0,int trace,UINT *s0vect,int col,NODE rp0,ND_pairs *nz) |
{ |
{ |
IndArray *imat; |
IndArray *imat; |
int nsp,nred,i; |
int nsp,nred,i,start; |
int *rhead; |
int *rhead; |
NODE r0,rp; |
NODE r0,rp; |
ND_pairs sp; |
ND_pairs sp; |
NM_ind_pair *rvect; |
NM_ind_pair *rvect; |
UINT *s; |
UINT *s; |
int *s0hash; |
int *s0hash; |
|
struct oEGT eg0,eg1,eg_conv; |
|
|
if ( m == 2 && nd_rref2 ) |
if ( m == 2 && nd_rref2 ) |
return nd_f4_red_2(sp0,s0vect,col,rp0,nz); |
return nd_f4_red_2(sp0,s0vect,col,rp0,nz); |
|
|
init_eg(&eg_search); |
|
for ( sp = sp0, nsp = 0; sp; sp = NEXT(sp), nsp++ ); |
for ( sp = sp0, nsp = 0; sp; sp = NEXT(sp), nsp++ ); |
nred = length(rp0); |
nred = length(rp0); |
imat = (IndArray *)MALLOC(nred*sizeof(IndArray)); |
imat = (IndArray *)MALLOC(nred*sizeof(IndArray)); |
Line 7060 init_eg(&eg_search); |
|
Line 7084 init_eg(&eg_search); |
|
for ( i = 0; i < col; i++ ) rhead[i] = 0; |
for ( i = 0; i < col; i++ ) rhead[i] = 0; |
|
|
/* construction of index arrays */ |
/* construction of index arrays */ |
|
get_eg(&eg0); |
if ( DP_Print ) { |
if ( DP_Print ) { |
fprintf(asir_out,"%dx%d,",nsp+nred,col); |
fprintf(asir_out,"%dx%d,",nsp+nred,col); |
|
fflush(asir_out); |
} |
} |
rvect = (NM_ind_pair *)MALLOC(nred*sizeof(NM_ind_pair)); |
rvect = (NM_ind_pair *)MALLOC(nred*sizeof(NM_ind_pair)); |
s0hash = (int *)MALLOC(col*sizeof(int)); |
for ( start = 0, rp = rp0, i = 0; rp; i++, rp = NEXT(rp) ) { |
for ( i = 0, s = s0vect; i < col; i++, s += nd_wpd ) |
|
s0hash[i] = ndl_hash_value(s); |
|
for ( rp = rp0, i = 0; rp; i++, rp = NEXT(rp) ) { |
|
rvect[i] = (NM_ind_pair)BDY(rp); |
rvect[i] = (NM_ind_pair)BDY(rp); |
imat[i] = nm_ind_pair_to_vect_compress(trace,s0vect,col,s0hash,rvect[i]); |
imat[i] = nm_ind_pair_to_vect_compress(trace,s0vect,col,rvect[i],start); |
rhead[imat[i]->head] = 1; |
rhead[imat[i]->head] = 1; |
|
start = imat[i]->head; |
} |
} |
|
get_eg(&eg1); init_eg(&eg_conv); add_eg(&eg_conv,&eg0,&eg1); add_eg(&f4_conv,&eg0,&eg1); |
|
if ( DP_Print ) { |
|
fprintf(asir_out,"conv=%.3fsec,",eg_conv.exectime); |
|
fflush(asir_out); |
|
} |
if ( m > 0 ) |
if ( m > 0 ) |
#if SIZEOF_LONG==8 |
#if SIZEOF_LONG==8 |
r0 = nd_f4_red_mod64_main(m,sp0,nsp,s0vect,col,rvect,rhead,imat,nred,nz); |
r0 = nd_f4_red_mod64_main(m,sp0,nsp,s0vect,col,rvect,rhead,imat,nred,nz); |
Line 7084 init_eg(&eg_search); |
|
Line 7113 init_eg(&eg_search); |
|
r0 = nd_f4_red_lf_main(m,sp0,nsp,trace,s0vect,col,rvect,rhead,imat,nred); |
r0 = nd_f4_red_lf_main(m,sp0,nsp,trace,s0vect,col,rvect,rhead,imat,nred); |
else |
else |
r0 = nd_f4_red_q_main(sp0,nsp,trace,s0vect,col,rvect,rhead,imat,nred); |
r0 = nd_f4_red_q_main(sp0,nsp,trace,s0vect,col,rvect,rhead,imat,nred); |
#if 0 |
|
if ( DP_Print ) print_eg("search",&eg_search); |
|
#endif |
|
return r0; |
return r0; |
} |
} |
|
|
Line 9017 NDV vect64_to_ndv(mp_limb_t *vect,int spcol,int col,in |
|
Line 9043 NDV vect64_to_ndv(mp_limb_t *vect,int spcol,int col,in |
|
int nd_to_vect64(int mod,UINT *s0,int n,ND d,mp_limb_t *r) |
int nd_to_vect64(int mod,UINT *s0,int n,ND d,mp_limb_t *r) |
{ |
{ |
NM m; |
NM m; |
UINT *t,*s; |
UINT *t,*s,*u; |
int i; |
int i,st,ed,md,prev,c; |
|
|
for ( i = 0; i < n; i++ ) r[i] = 0; |
for ( i = 0; i < n; i++ ) r[i] = 0; |
for ( i = 0, s = s0, m = BDY(d); m; m = NEXT(m) ) { |
prev = 0; |
t = DL(m); |
for ( i = 0, m = BDY(d); m; m = NEXT(m) ) { |
for ( ; !ndl_equal(t,s); s += nd_wpd, i++ ); |
t = DL(m); |
r[i] = (mp_limb_t)CM(m); |
st = prev; |
|
ed = n; |
|
while ( ed > st ) { |
|
md = (st+ed)/2; |
|
u = s0+md*nd_wpd; |
|
c = DL_COMPARE(u,t); |
|
if ( c == 0 ) break; |
|
else if ( c > 0 ) st = md; |
|
else ed = md; |
|
} |
|
r[md] = (mp_limb_t)CM(m); |
|
prev = md; |
} |
} |
for ( i = 0; !r[i]; i++ ); |
for ( i = 0; !r[i]; i++ ); |
return i; |
return i; |
Line 9054 int ndv_reduce_vect64(int m,mp_limb_t *svect,mp_limb_t |
|
Line 9091 int ndv_reduce_vect64(int m,mp_limb_t *svect,mp_limb_t |
|
MOD128(a,c,m); |
MOD128(a,c,m); |
svect[k] = a; cvect[k] = 0; |
svect[k] = a; cvect[k] = 0; |
if ( (c = svect[k]) != 0 ) { |
if ( (c = svect[k]) != 0 ) { |
|
Nf4_red++; |
maxrs = MAX(maxrs,rp0[i]->sugar); |
maxrs = MAX(maxrs,rp0[i]->sugar); |
c = m-c; redv = nd_ps[rp0[i]->index]; |
c = m-c; redv = nd_ps[rp0[i]->index]; |
len = LEN(redv); mr = BDY(redv); |
len = LEN(redv); mr = BDY(redv); |
Line 9063 int ndv_reduce_vect64(int m,mp_limb_t *svect,mp_limb_t |
|
Line 9101 int ndv_reduce_vect64(int m,mp_limb_t *svect,mp_limb_t |
|
ivc = ivect->index.c; |
ivc = ivect->index.c; |
for ( j = 1, NMV_ADV(mr); j < len; j++, NMV_ADV(mr) ) { |
for ( j = 1, NMV_ADV(mr); j < len; j++, NMV_ADV(mr) ) { |
pos = prev+ivc[j]; c1 = CM(mr); prev = pos; |
pos = prev+ivc[j]; c1 = CM(mr); prev = pos; |
if ( c1 ) { |
c2 = svect[pos]+c1*c; |
c2 = svect[pos]+c1*c; |
if ( c2 < svect[pos] ) cvect[pos]++; |
if ( c2 < svect[pos] ) cvect[pos]++; |
svect[pos] = c2; |
svect[pos] = c2; |
|
} |
|
} |
} |
break; |
break; |
case 2: |
case 2: |
ivs = ivect->index.s; |
ivs = ivect->index.s; |
for ( j = 1, NMV_ADV(mr); j < len; j++, NMV_ADV(mr) ) { |
for ( j = 1, NMV_ADV(mr); j < len; j++, NMV_ADV(mr) ) { |
pos = prev+ivs[j]; c1 = CM(mr); prev = pos; |
pos = prev+ivs[j]; c1 = CM(mr); prev = pos; |
if ( c1 ) { |
c2 = svect[pos]+c1*c; |
c2 = svect[pos]+c1*c; |
if ( c2 < svect[pos] ) cvect[pos]++; |
if ( c2 < svect[pos] ) cvect[pos]++; |
svect[pos] = c2; |
svect[pos] = c2; |
|
} |
|
} |
} |
break; |
break; |
case 4: |
case 4: |
ivi = ivect->index.i; |
ivi = ivect->index.i; |
for ( j = 1, NMV_ADV(mr); j < len; j++, NMV_ADV(mr) ) { |
for ( j = 1, NMV_ADV(mr); j < len; j++, NMV_ADV(mr) ) { |
pos = prev+ivi[j]; c1 = CM(mr); prev = pos; |
pos = prev+ivi[j]; c1 = CM(mr); prev = pos; |
if ( c1 ) { |
c2 = svect[pos]+c1*c; |
c2 = svect[pos]+c1*c; |
if ( c2 < svect[pos] ) cvect[pos]++; |
if ( c2 < svect[pos] ) cvect[pos]++; |
svect[pos] = c2; |
svect[pos] = c2; |
|
} |
|
} |
} |
break; |
break; |
} |
} |
Line 9145 NODE nd_f4_red_mod64_main(int m,ND_pairs sp0,int nsp,U |
|
Line 9177 NODE nd_f4_red_mod64_main(int m,ND_pairs sp0,int nsp,U |
|
} |
} |
nd_free(spol); |
nd_free(spol); |
} |
} |
get_eg(&eg1); init_eg(&eg_f4_1); add_eg(&eg_f4_1,&eg0,&eg1); |
get_eg(&eg1); init_eg(&eg_f4_1); add_eg(&eg_f4_1,&eg0,&eg1); add_eg(&f4_elim1,&eg0,&eg1); |
if ( DP_Print ) { |
if ( DP_Print ) { |
fprintf(asir_out,"elim1=%.3fsec,",eg_f4_1.exectime); |
fprintf(asir_out,"elim1=%.3fsec,",eg_f4_1.exectime); |
fflush(asir_out); |
fflush(asir_out); |
Line 9166 NODE nd_f4_red_mod64_main(int m,ND_pairs sp0,int nsp,U |
|
Line 9198 NODE nd_f4_red_mod64_main(int m,ND_pairs sp0,int nsp,U |
|
if ( r0 ) NEXT(r) = 0; |
if ( r0 ) NEXT(r) = 0; |
|
|
for ( ; i < sprow; i++ ) GCFREE(spmat[i]); |
for ( ; i < sprow; i++ ) GCFREE(spmat[i]); |
get_eg(&eg2); init_eg(&eg_f4_2); add_eg(&eg_f4_2,&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 ) { |
fprintf(asir_out,"elim2=%.3fsec,",eg_f4_2.exectime); |
fprintf(asir_out,"elim2=%.3fsec,",eg_f4_2.exectime); |
Line 9237 int nd_gauss_elim_mod64(mp_limb_t **mat,int *sugar,ND_ |
|
Line 9269 int nd_gauss_elim_mod64(mp_limb_t **mat,int *sugar,ND_ |
|
if ( (a = mat[i][j]) != 0 ) { |
if ( (a = mat[i][j]) != 0 ) { |
sugar[i] = MAX(sugar[i],s); |
sugar[i] = MAX(sugar[i],s); |
red_by_vect64(md,mat[i]+j,cmat[i]+j,mat[rank]+j,(int)(md-a),col-j); |
red_by_vect64(md,mat[i]+j,cmat[i]+j,mat[rank]+j,(int)(md-a),col-j); |
|
Nf4_red++; |
} |
} |
} |
} |
rank++; |
rank++; |
Line 9252 int nd_gauss_elim_mod64(mp_limb_t **mat,int *sugar,ND_ |
|
Line 9285 int nd_gauss_elim_mod64(mp_limb_t **mat,int *sugar,ND_ |
|
if ( a ) { |
if ( a ) { |
sugar[i] = MAX(sugar[i],s); |
sugar[i] = MAX(sugar[i],s); |
red_by_vect64(md,mat[i]+j,cmat[i]+j,mat[l]+j,(int)(md-a),col-j); |
red_by_vect64(md,mat[i]+j,cmat[i]+j,mat[l]+j,(int)(md-a),col-j); |
|
Nf4_red++; |
} |
} |
} |
} |
l--; |
l--; |