version 1.224, 2016/03/31 01:40:10 |
version 1.227, 2016/07/11 08:00:30 |
|
|
/* $OpenXM: OpenXM_contrib2/asir2000/engine/nd.c,v 1.223 2015/08/14 13:51:54 fujimoto Exp $ */ |
/* $OpenXM: OpenXM_contrib2/asir2000/engine/nd.c,v 1.226 2016/04/05 04:21:18 noro Exp $ */ |
|
|
#include "nd.h" |
#include "nd.h" |
|
|
Line 658 int ndl_module_weight_compare(UINT *d1,UINT *d2) |
|
Line 658 int ndl_module_weight_compare(UINT *d1,UINT *d2) |
|
s = 0; |
s = 0; |
for ( j = 0; j < nd_nvar; j++ ) |
for ( j = 0; j < nd_nvar; j++ ) |
s += (GET_EXP(d1,j)-GET_EXP(d2,j))*nd_poly_weight[j]; |
s += (GET_EXP(d1,j)-GET_EXP(d2,j))*nd_poly_weight[j]; |
s += nd_module_weight[MPOS(d1)-1]-nd_module_weight[MPOS(d2)-1]; |
if ( MPOS(d1) >= 1 && MPOS(d2) >= 1 ) { |
|
s += nd_module_weight[MPOS(d1)-1]-nd_module_weight[MPOS(d2)-1]; |
|
} |
if ( s > 0 ) return 1; |
if ( s > 0 ) return 1; |
else if ( s < 0 ) return -1; |
else if ( s < 0 ) return -1; |
else return 0; |
else return 0; |
Line 668 int ndl_module_grlex_compare(UINT *d1,UINT *d2) |
|
Line 670 int ndl_module_grlex_compare(UINT *d1,UINT *d2) |
|
{ |
{ |
int i,c; |
int i,c; |
|
|
if ( !MPOS(d1) || !MPOS(d2) ) { |
|
printf("afo\n"); |
|
} |
|
|
|
if ( nd_module_rank && (c = ndl_module_weight_compare(d1,d2)) ) return c; |
if ( nd_module_rank && (c = ndl_module_weight_compare(d1,d2)) ) return c; |
if ( nd_ispot ) { |
if ( nd_ispot ) { |
if ( nd_pot_nelim && MPOS(d1)>=nd_pot_nelim+1 && MPOS(d2) >= nd_pot_nelim+1 ) { |
if ( nd_pot_nelim && MPOS(d1)>=nd_pot_nelim+1 && MPOS(d2) >= nd_pot_nelim+1 ) { |
|
|
FREENDP(l); |
FREENDP(l); |
} |
} |
if ( nd_nalg ) { |
if ( nd_nalg ) { |
print_eg("monic",&eg_monic); |
if ( DP_Print ) { |
print_eg("invdalg",&eg_invdalg); |
print_eg("monic",&eg_monic); |
print_eg("le",&eg_le); |
print_eg("invdalg",&eg_invdalg); |
|
print_eg("le",&eg_le); |
|
} |
} |
} |
conv_ilist(nd_demand,1,g,indp); |
conv_ilist(nd_demand,1,g,indp); |
if ( DP_Print ) { printf("nd_gb_trace done.\n"); fflush(stdout); } |
if ( DP_Print ) { printf("nd_gb_trace done.\n"); fflush(stdout); } |
Line 6624 init_eg(&eg_search); |
|
Line 6624 init_eg(&eg_search); |
|
} |
} |
} |
} |
mat->row = i; |
mat->row = i; |
fprintf(asir_out,"%dx%d,",mat->row,mat->col); fflush(asir_out); |
if ( DP_Print ) { |
|
fprintf(asir_out,"%dx%d,",mat->row,mat->col); fflush(asir_out); |
|
} |
size = ((col+BLEN-1)/BLEN)*sizeof(unsigned long); |
size = ((col+BLEN-1)/BLEN)*sizeof(unsigned long); |
v = CALLOC((col+BLEN-1)/BLEN,sizeof(unsigned long)); |
v = CALLOC((col+BLEN-1)/BLEN,sizeof(unsigned long)); |
for ( rp = rp0, i = 0; rp; rp = NEXT(rp), i++ ) { |
for ( rp = rp0, i = 0; rp; rp = NEXT(rp), i++ ) { |
Line 6678 init_eg(&eg_search); |
|
Line 6680 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 */ |
fprintf(stderr,"%dx%d,",nsp+nred,col); |
if ( DP_Print ) { |
|
fprintf(stderr,"%dx%d,",nsp+nred,col); |
|
} |
rvect = (NM_ind_pair *)ALLOCA(nred*sizeof(NM_ind_pair)); |
rvect = (NM_ind_pair *)ALLOCA(nred*sizeof(NM_ind_pair)); |
s0hash = (int *)ALLOCA(col*sizeof(int)); |
s0hash = (int *)ALLOCA(col*sizeof(int)); |
for ( i = 0, s = s0vect; i < col; i++, s += nd_wpd ) |
for ( i = 0, s = s0vect; i < col; i++, s += nd_wpd ) |
Line 6692 init_eg(&eg_search); |
|
Line 6696 init_eg(&eg_search); |
|
r0 = nd_f4_red_main(m,sp0,nsp,s0vect,col,rvect,rhead,imat,nred,nz); |
r0 = nd_f4_red_main(m,sp0,nsp,s0vect,col,rvect,rhead,imat,nred,nz); |
else |
else |
r0 = nd_f4_red_gz_main(sp0,nsp,trace,s0vect,col,rvect,rhead,imat,nred); |
r0 = nd_f4_red_gz_main(sp0,nsp,trace,s0vect,col,rvect,rhead,imat,nred); |
print_eg("search",&eg_search); |
if ( DP_Print ) print_eg("search",&eg_search); |
return r0; |
return r0; |
} |
} |
|
|