version 1.17, 2019/08/28 23:27:34 |
version 1.19, 2019/09/04 05:32:10 |
|
|
/* $OpenXM: OpenXM_contrib2/asir2018/engine/nd.c,v 1.16 2019/08/21 00:37:47 noro Exp $ */ |
/* $OpenXM: OpenXM_contrib2/asir2018/engine/nd.c,v 1.18 2019/09/04 01:12:02 noro Exp $ */ |
|
|
#include "nd.h" |
#include "nd.h" |
|
|
Line 8 struct oEGT eg_search,f4_symb,f4_conv,f4_elim1,f4_elim |
|
Line 8 struct oEGT eg_search,f4_symb,f4_conv,f4_elim1,f4_elim |
|
int diag_period = 6; |
int diag_period = 6; |
int weight_check = 1; |
int weight_check = 1; |
int (*ndl_compare_function)(UINT *a1,UINT *a2); |
int (*ndl_compare_function)(UINT *a1,UINT *a2); |
|
/* for schreyer order */ |
|
int (*ndl_base_compare_function)(UINT *a1,UINT *a2); |
int nd_dcomp; |
int nd_dcomp; |
int nd_rref2; |
int nd_rref2; |
NM _nm_free_list; |
NM _nm_free_list; |
Line 713 int ndl_module_grlex_compare(UINT *d1,UINT *d2) |
|
Line 715 int ndl_module_grlex_compare(UINT *d1,UINT *d2) |
|
|
|
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 ) { |
if ( TD(d1) > TD(d2) ) return 1; |
if ( TD(d1) > TD(d2) ) return 1; |
else if ( TD(d1) < TD(d2) ) return -1; |
else if ( TD(d1) < TD(d2) ) return -1; |
if ( (c = ndl_lex_compare(d1,d2)) != 0 ) return c; |
if ( (c = ndl_lex_compare(d1,d2)) != 0 ) return c; |
if ( MPOS(d1) < MPOS(d2) ) return 1; |
if ( MPOS(d1) < MPOS(d2) ) return 1; |
else if ( MPOS(d1) > MPOS(d2) ) return -1; |
else if ( MPOS(d1) > MPOS(d2) ) return -1; |
return 0; |
return 0; |
|
} |
|
if ( MPOS(d1) < MPOS(d2) ) return 1; |
|
else if ( MPOS(d1) > MPOS(d2) ) return -1; |
} |
} |
if ( MPOS(d1) < MPOS(d2) ) return 1; |
|
else if ( MPOS(d1) > MPOS(d2) ) return -1; |
|
} |
|
if ( TD(d1) > TD(d2) ) return 1; |
if ( TD(d1) > TD(d2) ) return 1; |
else if ( TD(d1) < TD(d2) ) return -1; |
else if ( TD(d1) < TD(d2) ) return -1; |
if ( (c = ndl_lex_compare(d1,d2)) != 0 ) return c; |
if ( (c = ndl_lex_compare(d1,d2)) != 0 ) return c; |
Line 5512 void dpm_sort(DPM p,DPM *rp) |
|
Line 5514 void dpm_sort(DPM p,DPM *rp) |
|
MKDPM(n,t,d); |
MKDPM(n,t,d); |
SG(d) = SG(p); |
SG(d) = SG(p); |
*rp = d; |
*rp = d; |
|
} |
|
|
|
int dpm_comp(DPM *a,DPM *b) |
|
{ |
|
return compdpm(CO,*a,*b); |
|
} |
|
|
|
NODE dpm_sort_list(NODE l) |
|
{ |
|
int i,len; |
|
NODE t,t1; |
|
DPM *a; |
|
|
|
len = length(l); |
|
a = (DPM *)MALLOC(len*sizeof(DPM)); |
|
for ( t = l, i = 0; i < len; i++, t = NEXT(t) ) a[i] = (DPM)BDY(t); |
|
qsort(a,len,sizeof(DPM),(int (*)(const void *,const void *))dpm_comp); |
|
t = 0; |
|
for ( i = len-1; i >= 0; i-- ) { |
|
MKNODE(t1,(pointer)a[i],t); t = t1; |
|
} |
|
return t; |
} |
} |
|
|
NDV dpmtondv(int mod,DPM p) |
NDV dpmtondv(int mod,DPM p) |