version 1.224, 2016/03/31 01:40:10 |
version 1.226, 2016/04/05 04:21:18 |
|
|
/* $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.225 2016/03/31 02:42:43 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 ) { |