version 1.149, 2006/12/04 01:40:51 |
version 1.153, 2007/04/30 02:11:12 |
|
|
/* $OpenXM: OpenXM_contrib2/asir2000/engine/nd.c,v 1.148 2006/11/28 02:17:54 noro Exp $ */ |
/* $OpenXM: OpenXM_contrib2/asir2000/engine/nd.c,v 1.152 2006/12/21 07:45:02 ohara Exp $ */ |
|
|
#include "nd.h" |
#include "nd.h" |
|
|
|
|
NM _nm_free_list; |
NM _nm_free_list; |
ND _nd_free_list; |
ND _nd_free_list; |
ND_pairs _ndp_free_list; |
ND_pairs _ndp_free_list; |
|
NODE nd_hcf; |
|
|
static NODE nd_subst; |
static NODE nd_subst; |
static VL nd_vc; |
static VL nd_vc; |
Line 49 static int nd_demand; |
|
Line 50 static int nd_demand; |
|
NumberField get_numberfield(); |
NumberField get_numberfield(); |
UINT *nd_det_compute_bound(NDV **dm,int n,int j); |
UINT *nd_det_compute_bound(NDV **dm,int n,int j); |
void nd_det_reconstruct(NDV **dm,int n,int j,NDV d); |
void nd_det_reconstruct(NDV **dm,int n,int j,NDV d); |
|
void nd_heu_nezgcdnpz(VL vl,P *pl,int m,int full,P *pr); |
int nd_monic(int m,ND *p); |
int nd_monic(int m,ND *p); |
NDV plain_vect_to_ndv_q(Q *mat,int col,UINT *s0vect); |
NDV plain_vect_to_ndv_q(Q *mat,int col,UINT *s0vect); |
|
|
Line 1318 int ndv_check_candidate(NODE input,int obpe,int oadv,E |
|
Line 1320 int ndv_check_candidate(NODE input,int obpe,int oadv,E |
|
NODE t,s; |
NODE t,s; |
union oNDC dn; |
union oNDC dn; |
|
|
ndv_setup(0,0,cand,0); |
ndv_setup(0,0,cand,0,1); |
n = length(cand); |
n = length(cand); |
|
|
/* membercheck : list is a subset of Id(cand) ? */ |
/* membercheck : list is a subset of Id(cand) ? */ |
Line 1571 ND normalize_pbucket(int mod,PGeoBucket g) |
|
Line 1573 ND normalize_pbucket(int mod,PGeoBucket g) |
|
return r; |
return r; |
} |
} |
|
|
|
#if 0 |
|
void register_hcf(NDV p) |
|
{ |
|
DCP dc,t; |
|
P hc,h; |
|
int c; |
|
NODE l,l1,prev; |
|
|
|
hc = p->body->c.p; |
|
if ( !nd_vc || NUM(hc) ) return; |
|
fctrp(nd_vc,hc,&dc); |
|
for ( t = dc; t; t = NEXT(t) ) { |
|
h = t->c; |
|
if ( NUM(h) ) continue; |
|
for ( prev = 0, l = nd_hcf; l; prev = l, l = NEXT(l) ) { |
|
c = compp(nd_vc,h,(P)BDY(l)); |
|
if ( c >= 0 ) break; |
|
} |
|
if ( !l || c > 0 ) { |
|
MKNODE(l1,h,l); |
|
if ( !prev ) |
|
nd_hcf = l1; |
|
else |
|
NEXT(prev) = l1; |
|
} |
|
} |
|
} |
|
#else |
|
void register_hcf(NDV p) |
|
{ |
|
DCP dc,t; |
|
P hc,h,q; |
|
Q dmy; |
|
int c; |
|
NODE l,l1,prev; |
|
|
|
hc = p->body->c.p; |
|
if ( NUM(hc) ) return; |
|
ptozp(hc,1,&dmy,&h); |
|
#if 1 |
|
for ( l = nd_hcf; l; l = NEXT(l) ) { |
|
while ( 1 ) { |
|
if ( divtpz(nd_vc,h,(P)BDY(l),&q) ) h = q; |
|
else break; |
|
} |
|
} |
|
if ( NUM(h) ) return; |
|
#endif |
|
for ( prev = 0, l = nd_hcf; l; prev = l, l = NEXT(l) ) { |
|
c = compp(nd_vc,h,(P)BDY(l)); |
|
if ( c >= 0 ) break; |
|
} |
|
if ( !l || c > 0 ) { |
|
MKNODE(l1,h,l); |
|
if ( !prev ) |
|
nd_hcf = l1; |
|
else |
|
NEXT(prev) = l1; |
|
} |
|
} |
|
#endif |
|
|
int do_diagonalize(int sugar,int m) |
int do_diagonalize(int sugar,int m) |
{ |
{ |
int i,nh,stat; |
int i,nh,stat; |
Line 1594 int do_diagonalize(int sugar,int m) |
|
Line 1658 int do_diagonalize(int sugar,int m) |
|
nfv = ndtondv(m,nf); |
nfv = ndtondv(m,nf); |
nd_free(nf); |
nd_free(nf); |
nd_bound[i] = ndv_compute_bound(nfv); |
nd_bound[i] = ndv_compute_bound(nfv); |
|
if ( !m ) register_hcf(nfv); |
if ( nd_demand ) { |
if ( nd_demand ) { |
ndv_save(nfv,i); |
ndv_save(nfv,i); |
ndv_free(nfv); |
ndv_free(nfv); |
Line 1724 int do_diagonalize_trace(int sugar,int m) |
|
Line 1789 int do_diagonalize_trace(int sugar,int m) |
|
nfv = ndtondv(0,nf); |
nfv = ndtondv(0,nf); |
nd_free(nf); |
nd_free(nf); |
nd_bound[i] = ndv_compute_bound(nfv); |
nd_bound[i] = ndv_compute_bound(nfv); |
|
register_hcf(nfv); |
if ( nd_demand ) { |
if ( nd_demand ) { |
ndv_save(nfv,i); |
ndv_save(nfv,i); |
ndv_free(nfv); |
ndv_free(nfv); |
|
|
if ( SG(l) != sugar ) { |
if ( SG(l) != sugar ) { |
#if 1 |
#if 1 |
if ( ishomo ) { |
if ( ishomo ) { |
|
if ( DP_Print > 2 ) fprintf(asir_out,"|"); |
stat = do_diagonalize_trace(sugar,m); |
stat = do_diagonalize_trace(sugar,m); |
|
if ( DP_Print > 2 ) fprintf(asir_out,"|"); |
diag_count = 0; |
diag_count = 0; |
if ( !stat ) { |
if ( !stat ) { |
NEXT(l) = d; d = l; |
NEXT(l) = d; d = l; |
|
|
nh = ndv_newps(0,nfv,nfqv); |
nh = ndv_newps(0,nfv,nfqv); |
if ( ishomo && ++diag_count == diag_period ) { |
if ( ishomo && ++diag_count == diag_period ) { |
diag_count = 0; |
diag_count = 0; |
|
if ( DP_Print > 2 ) fprintf(asir_out,"|"); |
stat = do_diagonalize_trace(sugar,m); |
stat = do_diagonalize_trace(sugar,m); |
|
if ( DP_Print > 2 ) fprintf(asir_out,"|"); |
if ( !stat ) { |
if ( !stat ) { |
NEXT(l) = d; d = l; |
NEXT(l) = d; d = l; |
d = nd_reconstruct(1,d); |
d = nd_reconstruct(1,d); |
Line 1898 NODE ndv_reduceall(int m,NODE f) |
|
Line 1968 NODE ndv_reduceall(int m,NODE f) |
|
(int (*)(const void *,const void *))ndv_compare); |
(int (*)(const void *,const void *))ndv_compare); |
for ( t = f, i = 0; t; i++, t = NEXT(t) ) BDY(t) = (pointer)w[i]; |
for ( t = f, i = 0; t; i++, t = NEXT(t) ) BDY(t) = (pointer)w[i]; |
#endif |
#endif |
ndv_setup(m,0,f,0); |
ndv_setup(m,0,f,0,1); |
for ( i = 0; i < n; ) { |
for ( i = 0; i < n; ) { |
g = ndvtond(m,nd_ps[i]); |
g = ndvtond(m,nd_ps[i]); |
g = nd_separate_head(g,&head); |
g = nd_separate_head(g,&head); |
Line 2211 int ndv_newps(int m,NDV a,NDV aq) |
|
Line 2281 int ndv_newps(int m,NDV a,NDV aq) |
|
nd_ps[nd_psn] = a; |
nd_ps[nd_psn] = a; |
if ( aq ) { |
if ( aq ) { |
nd_ps_trace[nd_psn] = aq; |
nd_ps_trace[nd_psn] = aq; |
|
register_hcf(aq); |
nd_bound[nd_psn] = ndv_compute_bound(aq); |
nd_bound[nd_psn] = ndv_compute_bound(aq); |
SG(r) = SG(aq); ndl_copy(HDL(aq),DL(r)); |
SG(r) = SG(aq); ndl_copy(HDL(aq),DL(r)); |
} else { |
} else { |
|
if ( !m ) register_hcf(a); |
nd_bound[nd_psn] = ndv_compute_bound(a); |
nd_bound[nd_psn] = ndv_compute_bound(a); |
SG(r) = SG(a); ndl_copy(HDL(a),DL(r)); |
SG(r) = SG(a); ndl_copy(HDL(a),DL(r)); |
} |
} |
Line 2229 int ndv_newps(int m,NDV a,NDV aq) |
|
Line 2301 int ndv_newps(int m,NDV a,NDV aq) |
|
return nd_psn++; |
return nd_psn++; |
} |
} |
|
|
void ndv_setup(int mod,int trace,NODE f,int dont_sort) |
void ndv_setup(int mod,int trace,NODE f,int dont_sort,int dont_removecont) |
{ |
{ |
int i,j,td,len,max; |
int i,j,td,len,max; |
NODE s,s0,f0; |
NODE s,s0,f0; |
Line 2257 void ndv_setup(int mod,int trace,NODE f,int dont_sort) |
|
Line 2329 void ndv_setup(int mod,int trace,NODE f,int dont_sort) |
|
nd_ps_trace = (NDV *)MALLOC(nd_pslen*sizeof(NDV)); |
nd_ps_trace = (NDV *)MALLOC(nd_pslen*sizeof(NDV)); |
nd_psh = (RHist *)MALLOC(nd_pslen*sizeof(RHist)); |
nd_psh = (RHist *)MALLOC(nd_pslen*sizeof(RHist)); |
nd_bound = (UINT **)MALLOC(nd_pslen*sizeof(UINT *)); |
nd_bound = (UINT **)MALLOC(nd_pslen*sizeof(UINT *)); |
|
nd_hcf = 0; |
|
|
if ( trace && nd_vc ) |
if ( trace && nd_vc ) |
makesubst(nd_vc,&nd_subst); |
makesubst(nd_vc,&nd_subst); |
Line 2269 void ndv_setup(int mod,int trace,NODE f,int dont_sort) |
|
Line 2342 void ndv_setup(int mod,int trace,NODE f,int dont_sort) |
|
for ( i = 0; i < nd_psn; i++ ) { |
for ( i = 0; i < nd_psn; i++ ) { |
if ( trace ) { |
if ( trace ) { |
a = nd_ps_trace[i] = ndv_dup(0,w[i]); |
a = nd_ps_trace[i] = ndv_dup(0,w[i]); |
ndv_removecont(0,a); |
if ( !dont_removecont) ndv_removecont(0,a); |
|
register_hcf(a); |
am = nd_ps[i] = ndv_dup(mod,a); |
am = nd_ps[i] = ndv_dup(mod,a); |
ndv_mod(mod,am); |
ndv_mod(mod,am); |
ndv_removecont(mod,am); |
ndv_removecont(mod,am); |
} else { |
} else { |
a = nd_ps[i] = ndv_dup(mod,w[i]); |
a = nd_ps[i] = ndv_dup(mod,w[i]); |
ndv_removecont(mod,a); |
if ( mod || !dont_removecont ) ndv_removecont(mod,a); |
|
if ( !mod ) register_hcf(a); |
} |
} |
NEWRHist(r); SG(r) = HTD(a); ndl_copy(HDL(a),DL(r)); |
NEWRHist(r); SG(r) = HTD(a); ndl_copy(HDL(a),DL(r)); |
nd_bound[i] = ndv_compute_bound(a); |
nd_bound[i] = ndv_compute_bound(a); |
Line 2462 void nd_gr(LIST f,LIST v,int m,int f4,struct order_spe |
|
Line 2537 void nd_gr(LIST f,LIST v,int m,int f4,struct order_spe |
|
if ( b ) { NEXTNODE(fd0,fd); BDY(fd) = (pointer)b; } |
if ( b ) { NEXTNODE(fd0,fd); BDY(fd) = (pointer)b; } |
} |
} |
if ( fd0 ) NEXT(fd) = 0; |
if ( fd0 ) NEXT(fd) = 0; |
ndv_setup(m,0,fd0,0); |
ndv_setup(m,0,fd0,0,0); |
x = f4?nd_f4(m):nd_gb(m,ishomo,0); |
x = f4?nd_f4(m):nd_gb(m,ishomo,0); |
nd_demand = 0; |
nd_demand = 0; |
x = ndv_reducebase(x); |
x = ndv_reducebase(x); |
Line 2537 void nd_gr_postproc(LIST f,LIST v,int m,struct order_s |
|
Line 2612 void nd_gr_postproc(LIST f,LIST v,int m,struct order_s |
|
if ( b ) { NEXTNODE(fd0,fd); BDY(fd) = (pointer)b; } |
if ( b ) { NEXTNODE(fd0,fd); BDY(fd) = (pointer)b; } |
} |
} |
if ( fd0 ) NEXT(fd) = 0; |
if ( fd0 ) NEXT(fd) = 0; |
ndv_setup(m,0,fd0,0); |
ndv_setup(m,0,fd0,0,1); |
for ( x = 0, i = 0; i < nd_psn; i++ ) |
for ( x = 0, i = 0; i < nd_psn; i++ ) |
x = update_base(x,i); |
x = update_base(x,i); |
if ( do_check ) { |
if ( do_check ) { |
Line 2655 void nd_gr_trace(LIST f,LIST v,int trace,int homo,int |
|
Line 2730 void nd_gr_trace(LIST f,LIST v,int trace,int homo,int |
|
while ( 1 ) { |
while ( 1 ) { |
if ( Demand ) |
if ( Demand ) |
nd_demand = 1; |
nd_demand = 1; |
ndv_setup(m,1,fd0,0); |
ndv_setup(m,1,fd0,0,0); |
cand = f4?nd_f4_trace(m):nd_gb_trace(m,ishomo || homo); |
cand = f4?nd_f4_trace(m):nd_gb_trace(m,ishomo || homo); |
if ( !cand ) { |
if ( !cand ) { |
/* failure */ |
/* failure */ |
Line 2834 void nd_removecont(int mod,ND p) |
|
Line 2909 void nd_removecont(int mod,ND p) |
|
v.len = n; |
v.len = n; |
v.body = (pointer *)w; |
v.body = (pointer *)w; |
for ( m = BDY(p), i = 0; i < n; m = NEXT(m), i++ ) w[i] = CQ(m); |
for ( m = BDY(p), i = 0; i < n; m = NEXT(m), i++ ) w[i] = CQ(m); |
removecont_array((P *)w,n); |
removecont_array((P *)w,n,1); |
for ( m = BDY(p), i = 0; i < n; m = NEXT(m), i++ ) CQ(m) = w[i]; |
for ( m = BDY(p), i = 0; i < n; m = NEXT(m), i++ ) CQ(m) = w[i]; |
} |
} |
} |
} |
Line 2848 void nd_removecont2(ND p1,ND p2) |
|
Line 2923 void nd_removecont2(ND p1,ND p2) |
|
struct oVECT v; |
struct oVECT v; |
N q,r; |
N q,r; |
|
|
if ( !p1 ) { |
|
nd_removecont(0,p2); return; |
|
} else if ( !p2 ) { |
|
nd_removecont(0,p1); return; |
|
} |
|
n1 = nd_length(p1); |
n1 = nd_length(p1); |
n2 = nd_length(p2); |
n2 = nd_length(p2); |
n = n1+n2; |
n = n1+n2; |
w = (Q *)ALLOCA(n*sizeof(Q)); |
w = (Q *)ALLOCA(n*sizeof(Q)); |
v.len = n; |
v.len = n; |
v.body = (pointer *)w; |
v.body = (pointer *)w; |
for ( m = BDY(p1), i = 0; i < n1; m = NEXT(m), i++ ) w[i] = CQ(m); |
i = 0; |
for ( m = BDY(p2); i < n; m = NEXT(m), i++ ) w[i] = CQ(m); |
if ( p1 ) |
removecont_array((P *)w,n); |
for ( m = BDY(p1); i < n1; m = NEXT(m), i++ ) w[i] = CQ(m); |
for ( m = BDY(p1), i = 0; i < n1; m = NEXT(m), i++ ) CQ(m) = w[i]; |
if ( p2 ) |
for ( m = BDY(p2); i < n; m = NEXT(m), i++ ) CQ(m) = w[i]; |
for ( m = BDY(p2); i < n; m = NEXT(m), i++ ) w[i] = CQ(m); |
|
removecont_array((P *)w,n,1); |
|
i = 0; |
|
if ( p1 ) |
|
for ( m = BDY(p1); i < n1; m = NEXT(m), i++ ) CQ(m) = w[i]; |
|
if ( p2 ) |
|
for ( m = BDY(p2); i < n; m = NEXT(m), i++ ) CQ(m) = w[i]; |
} |
} |
|
|
void ndv_removecont(int mod,NDV p) |
void ndv_removecont(int mod,NDV p) |
Line 2888 void ndv_removecont(int mod,NDV p) |
|
Line 2964 void ndv_removecont(int mod,NDV p) |
|
all_p = all_p && !NUM(w[i]); |
all_p = all_p && !NUM(w[i]); |
} |
} |
if ( all_p ) { |
if ( all_p ) { |
qltozl(c,len,&dvr); heu_nezgcdnpz(nd_vc,w,len,&g); |
qltozl(c,len,&dvr); nd_heu_nezgcdnpz(nd_vc,w,len,1,&g); |
mulp(nd_vc,(P)dvr,g,&cont); |
mulp(nd_vc,(P)dvr,g,&cont); |
for ( m = BDY(p), i = 0; i < len; NMV_ADV(m), i++ ) { |
for ( m = BDY(p), i = 0; i < len; NMV_ADV(m), i++ ) { |
divsp(nd_vc,CP(m),cont,&tp); CP(m) = tp; |
divsp(nd_vc,CP(m),cont,&tp); CP(m) = tp; |
Line 2949 void ndv_dehomogenize(NDV p,struct order_spec *ord) |
|
Line 3025 void ndv_dehomogenize(NDV p,struct order_spec *ord) |
|
NV(p)--; |
NV(p)--; |
} |
} |
|
|
void removecont_array(P *p,int n) |
void nd_heu_nezgcdnpz(VL vl,P *pl,int m,int full,P *pr) |
{ |
{ |
|
int i; |
|
P *tpl,*tpl1; |
|
NODE l; |
|
P h,gcd,t; |
|
|
|
tpl = (P *)ALLOCA(m*sizeof(P)); |
|
tpl1 = (P *)ALLOCA(m*sizeof(P)); |
|
bcopy(pl,tpl,m*sizeof(P)); |
|
gcd = (P)ONE; |
|
for ( l = nd_hcf; l; l = NEXT(l) ) { |
|
h = (P)BDY(l); |
|
while ( 1 ) { |
|
for ( i = 0; i < m; i++ ) |
|
if ( !divtpz(vl,tpl[i],h,&tpl1[i]) ) |
|
break; |
|
if ( i == m ) { |
|
bcopy(tpl1,tpl,m*sizeof(P)); |
|
mulp(vl,gcd,h,&t); gcd = t; |
|
} else |
|
break; |
|
} |
|
} |
|
if ( DP_Print > 2 ){fprintf(asir_out,"[%d]",nmonop(gcd)); fflush(asir_out);} |
|
if ( full ) { |
|
heu_nezgcdnpz(vl,tpl,m,&t); |
|
mulp(vl,gcd,t,pr); |
|
} else |
|
*pr = gcd; |
|
} |
|
|
|
void removecont_array(P *p,int n,int full) |
|
{ |
int all_p,all_q,i; |
int all_p,all_q,i; |
Q *c; |
Q *c; |
P *w; |
P *w; |
Line 2967 void removecont_array(P *p,int n) |
|
Line 3075 void removecont_array(P *p,int n) |
|
ptozp(p[i],1,&c[i],&w[i]); |
ptozp(p[i],1,&c[i],&w[i]); |
} |
} |
removecont_array_q(c,n); |
removecont_array_q(c,n); |
heu_nezgcdnpz(nd_vc,w,n,&t); |
nd_heu_nezgcdnpz(nd_vc,w,n,full,&t); |
for ( i = 0; i < n; i++ ) { |
for ( i = 0; i < n; i++ ) { |
divsp(nd_vc,w[i],t,&s); mulp(nd_vc,s,(P)c[i],&p[i]); |
divsp(nd_vc,w[i],t,&s); mulp(nd_vc,s,(P)c[i],&p[i]); |
} |
} |
Line 4167 void nd_nf_p(P f,LIST g,LIST v,int m,struct order_spec |
|
Line 4275 void nd_nf_p(P f,LIST g,LIST v,int m,struct order_spec |
|
if ( m ) ndv_mod(m,(NDV)BDY(in)); |
if ( m ) ndv_mod(m,(NDV)BDY(in)); |
NEXT(in) = 0; |
NEXT(in) = 0; |
|
|
/* dont sort */ |
/* dont sort, dont removecont */ |
ndv_setup(m,0,in0,1); |
ndv_setup(m,0,in0,1,1); |
nd_psn--; |
nd_psn--; |
nd_scale=2; |
nd_scale=2; |
while ( 1 ) { |
while ( 1 ) { |
Line 4366 int ndv_reduce_vect_q(Q *svect,int trace,int col,IndAr |
|
Line 4474 int ndv_reduce_vect_q(Q *svect,int trace,int col,IndAr |
|
if ( j == col ) break; |
if ( j == col ) break; |
if ( hmag && ((double)p_mag((P)svect[j]) > hmag) ) { |
if ( hmag && ((double)p_mag((P)svect[j]) > hmag) ) { |
nz = compress_array(svect,cvect,col); |
nz = compress_array(svect,cvect,col); |
removecont_array((P *)cvect,nz); |
removecont_array((P *)cvect,nz,1); |
expand_array(svect,cvect,nz); |
expand_array(svect,cvect,nz); |
hmag = ((double)p_mag((P)svect[j]))*nd_scale; |
hmag = ((double)p_mag((P)svect[j]))*nd_scale; |
} |
} |
} |
} |
} |
} |
nz = compress_array(svect,cvect,col); |
nz = compress_array(svect,cvect,col); |
removecont_array((P *)cvect,nz); |
removecont_array((P *)cvect,nz,1); |
expand_array(svect,cvect,nz); |
expand_array(svect,cvect,nz); |
if ( DP_Print ) { |
if ( DP_Print ) { |
fprintf(asir_out,"-"); fflush(asir_out); |
fprintf(asir_out,"-"); fflush(asir_out); |
Line 5698 void nd_det(int mod,MAT f,P *rp) |
|
Line 5806 void nd_det(int mod,MAT f,P *rp) |
|
sgn = -sgn; |
sgn = -sgn; |
} |
} |
bound = nd_det_compute_bound(dm,n,j); |
bound = nd_det_compute_bound(dm,n,j); |
if ( ndl_check_bound(bound,bound) ) |
for ( k = 0; k < nd_nvar; k++ ) |
|
if ( bound[k]*2 > nd_mask0 ) break; |
|
if ( k < nd_nvar ) |
nd_det_reconstruct(dm,n,j,d); |
nd_det_reconstruct(dm,n,j,d); |
|
|
for ( i = j+1, mj = dm[j], mjj = mj[j]; i < n; i++ ) { |
for ( i = j+1, mj = dm[j], mjj = mj[j]; i < n; i++ ) { |
Line 5828 void nd_det_reconstruct(NDV **dm,int n,int j,NDV d) |
|
Line 5938 void nd_det_reconstruct(NDV **dm,int n,int j,NDV d) |
|
#endif |
#endif |
} |
} |
|
|
|
/* returns a UINT array containing degree bounds */ |
|
|
UINT *nd_det_compute_bound(NDV **dm,int n,int j) |
UINT *nd_det_compute_bound(NDV **dm,int n,int j) |
{ |
{ |
UINT *d0,*d1,*d,*t,*r; |
UINT *d0,*d1,*d,*t,*r; |
int k,l; |
int k,l,i; |
|
|
d0 = (UINT *)ALLOCA(nd_wpd*sizeof(UINT)); |
d0 = (UINT *)MALLOC(nd_nvar*sizeof(UINT)); |
d1 = (UINT *)ALLOCA(nd_wpd*sizeof(UINT)); |
for ( k = 0; k < nd_nvar; k++ ) d0[k] = 0; |
for ( k = 0; k < nd_wpd; k++ ) d0[k] = 0; |
|
for ( k = j; k < n; k++ ) |
for ( k = j; k < n; k++ ) |
for ( l = j; l < n; l++ ) |
for ( l = j; l < n; l++ ) |
if ( dm[k][l] ) { |
if ( dm[k][l] ) { |
d = ndv_compute_bound(dm[k][l]); |
d = ndv_compute_bound(dm[k][l]); |
ndl_lcm(d,d0,d1); |
for ( i = 0; i < nd_nvar; i++ ) |
t = d1; d1 = d0; d0 = t; |
d0[i] = MAX(d0[i],d[i]); |
} |
} |
r = (UINT *)ALLOCA(nd_wpd*sizeof(UINT)); |
return d0; |
for ( k = 0; k < nd_wpd; k++ ) r[k] = d0[k]; |
|
return r; |
|
} |
} |
|
|
DL nd_separate_d(UINT *d,UINT *trans) |
DL nd_separate_d(UINT *d,UINT *trans) |