=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/engine/nd.c,v retrieving revision 1.172 retrieving revision 1.174 diff -u -p -r1.172 -r1.174 --- OpenXM_contrib2/asir2000/engine/nd.c 2009/02/15 03:07:41 1.172 +++ OpenXM_contrib2/asir2000/engine/nd.c 2009/06/01 07:31:54 1.174 @@ -1,4 +1,4 @@ -/* $OpenXM: OpenXM_contrib2/asir2000/engine/nd.c,v 1.171 2009/02/11 06:30:21 noro Exp $ */ +/* $OpenXM: OpenXM_contrib2/asir2000/engine/nd.c,v 1.173 2009/02/15 09:22:07 noro Exp $ */ #include "nd.h" @@ -46,10 +46,10 @@ static int nd_worb_len; static int nd_found,nd_create,nd_notfirst; static int nmv_adv; static int nd_demand; -static int nd_module,nd_ispot,nd_mpos; +static int nd_module,nd_ispot,nd_mpos,nd_pot_nelim; static NODE nd_tracelist; static NODE nd_alltracelist; -static int nd_gentrace,nd_gensyz; +static int nd_gentrace,nd_gensyz,nd_nora; NumberField get_numberfield(); UINT *nd_det_compute_bound(NDV **dm,int n,int j); @@ -581,6 +581,14 @@ int ndl_module_grlex_compare(UINT *d1,UINT *d2) int i,c; if ( nd_ispot ) { + if ( nd_pot_nelim && MPOS(d1)>=nd_pot_nelim+1 && MPOS(d2) >= nd_pot_nelim+1 ) { + if ( TD(d1) > TD(d2) ) return 1; + else if ( TD(d1) < TD(d2) ) return -1; + if ( c = ndl_lex_compare(d1,d2) ) return c; + if ( MPOS(d1) < MPOS(d2) ) return 1; + else if ( MPOS(d1) > MPOS(d2) ) return -1; + return 0; + } if ( MPOS(d1) < MPOS(d2) ) return 1; else if ( MPOS(d1) > MPOS(d2) ) return -1; } @@ -2192,6 +2200,7 @@ NODE ndv_reduceall(int m,NODE f) union oNDC hc; P cont,cont1; + if ( nd_nora ) return f; n = length(f); ndv_setup(m,0,f,0,1); perm = (int *)MALLOC(n*sizeof(int)); @@ -2795,7 +2804,7 @@ void nd_gr(LIST f,LIST v,int m,int f4,struct order_spe EPOS oepos; int obpe,oadv,ompos; - nd_module; + nd_module = 0; if ( !m && Demand ) nd_demand = 1; else nd_demand = 0; parse_nd_option(current_option); @@ -3144,9 +3153,9 @@ void nd_gr_trace(LIST f,LIST v,int trace,int homo,int cand = ndv_reduceall(0,cand); cbpe = nd_bpe; if ( nd_gentrace ) { tl2 = nd_alltracelist; nd_alltracelist = 0; } + get_eg(&eg0); if ( nocheck ) break; - get_eg(&eg0); if ( ret = ndv_check_membership(0,in0,obpe,oadv,oepos,cand) ) { if ( nd_gentrace ) { tl3 = nd_alltracelist; nd_alltracelist = 0; @@ -4739,6 +4748,7 @@ void nd_init_ord(struct order_spec *ord) /* module order */ case 256: nd_ispot = ord->ispot; + nd_pot_nelim = ord->pot_nelim; nd_dcomp = -1; switch ( ord->ord.simple ) { case 0: @@ -4759,16 +4769,28 @@ void nd_init_ord(struct order_spec *ord) break; case 257: /* block order */ + nd_ispot = ord->ispot; + nd_pot_nelim = ord->pot_nelim; + nd_dcomp = -1; + nd_isrlex = 0; ndl_compare_function = ndl_module_block_compare; break; case 258: /* matrix order */ + nd_ispot = ord->ispot; + nd_pot_nelim = ord->pot_nelim; + nd_dcomp = -1; + nd_isrlex = 0; nd_matrix_len = ord->ord.matrix.row; nd_matrix = ord->ord.matrix.matrix; ndl_compare_function = ndl_module_matrix_compare; break; case 259: /* composite order */ + nd_ispot = ord->ispot; + nd_pot_nelim = ord->pot_nelim; + nd_dcomp = -1; + nd_isrlex = 0; nd_worb_len = ord->ord.composite.length; nd_worb = ord->ord.composite.w_or_b; ndl_compare_function = ndl_module_composite_compare; @@ -6800,7 +6822,7 @@ void parse_nd_option(NODE opt) char *key; Obj value; - nd_gentrace = 0; nd_gensyz = 0; + nd_gentrace = 0; nd_gensyz = 0; nd_nora = 0; for ( t = opt; t; t = NEXT(t) ) { p = BDY((LIST)BDY(t)); key = BDY((STRING)BDY(p)); @@ -6809,5 +6831,7 @@ void parse_nd_option(NODE opt) nd_gentrace = value?1:0; else if ( !strcmp(key,"gensyz") ) nd_gensyz = value?1:0; + else if ( !strcmp(key,"nora") ) + nd_nora = value?1:0; } }