version 1.151, 2006/12/14 02:49:59 |
version 1.153, 2007/04/30 02:11:12 |
|
|
/* $OpenXM: OpenXM_contrib2/asir2000/engine/nd.c,v 1.150 2006/12/12 11:50:37 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" |
|
|
Line 50 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 5805 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 5935 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) |