version 1.172, 2009/02/15 03:07:41 |
version 1.174, 2009/06/01 07:31:54 |
|
|
/* $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" |
#include "nd.h" |
|
|
Line 46 static int nd_worb_len; |
|
Line 46 static int nd_worb_len; |
|
static int nd_found,nd_create,nd_notfirst; |
static int nd_found,nd_create,nd_notfirst; |
static int nmv_adv; |
static int nmv_adv; |
static int nd_demand; |
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_tracelist; |
static NODE nd_alltracelist; |
static NODE nd_alltracelist; |
static int nd_gentrace,nd_gensyz; |
static int nd_gentrace,nd_gensyz,nd_nora; |
|
|
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); |
Line 581 int ndl_module_grlex_compare(UINT *d1,UINT *d2) |
|
Line 581 int ndl_module_grlex_compare(UINT *d1,UINT *d2) |
|
int i,c; |
int i,c; |
|
|
if ( nd_ispot ) { |
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; |
if ( MPOS(d1) < MPOS(d2) ) return 1; |
else if ( MPOS(d1) > MPOS(d2) ) return -1; |
else if ( MPOS(d1) > MPOS(d2) ) return -1; |
} |
} |
Line 2192 NODE ndv_reduceall(int m,NODE f) |
|
Line 2200 NODE ndv_reduceall(int m,NODE f) |
|
union oNDC hc; |
union oNDC hc; |
P cont,cont1; |
P cont,cont1; |
|
|
|
if ( nd_nora ) return f; |
n = length(f); |
n = length(f); |
ndv_setup(m,0,f,0,1); |
ndv_setup(m,0,f,0,1); |
perm = (int *)MALLOC(n*sizeof(int)); |
perm = (int *)MALLOC(n*sizeof(int)); |
Line 2795 void nd_gr(LIST f,LIST v,int m,int f4,struct order_spe |
|
Line 2804 void nd_gr(LIST f,LIST v,int m,int f4,struct order_spe |
|
EPOS oepos; |
EPOS oepos; |
int obpe,oadv,ompos; |
int obpe,oadv,ompos; |
|
|
nd_module; |
nd_module = 0; |
if ( !m && Demand ) nd_demand = 1; |
if ( !m && Demand ) nd_demand = 1; |
else nd_demand = 0; |
else nd_demand = 0; |
parse_nd_option(current_option); |
parse_nd_option(current_option); |
Line 3144 void nd_gr_trace(LIST f,LIST v,int trace,int homo,int |
|
Line 3153 void nd_gr_trace(LIST f,LIST v,int trace,int homo,int |
|
cand = ndv_reduceall(0,cand); |
cand = ndv_reduceall(0,cand); |
cbpe = nd_bpe; |
cbpe = nd_bpe; |
if ( nd_gentrace ) { tl2 = nd_alltracelist; nd_alltracelist = 0; } |
if ( nd_gentrace ) { tl2 = nd_alltracelist; nd_alltracelist = 0; } |
|
get_eg(&eg0); |
if ( nocheck ) |
if ( nocheck ) |
break; |
break; |
get_eg(&eg0); |
|
if ( ret = ndv_check_membership(0,in0,obpe,oadv,oepos,cand) ) { |
if ( ret = ndv_check_membership(0,in0,obpe,oadv,oepos,cand) ) { |
if ( nd_gentrace ) { |
if ( nd_gentrace ) { |
tl3 = nd_alltracelist; nd_alltracelist = 0; |
tl3 = nd_alltracelist; nd_alltracelist = 0; |
Line 4739 void nd_init_ord(struct order_spec *ord) |
|
Line 4748 void nd_init_ord(struct order_spec *ord) |
|
/* module order */ |
/* module order */ |
case 256: |
case 256: |
nd_ispot = ord->ispot; |
nd_ispot = ord->ispot; |
|
nd_pot_nelim = ord->pot_nelim; |
nd_dcomp = -1; |
nd_dcomp = -1; |
switch ( ord->ord.simple ) { |
switch ( ord->ord.simple ) { |
case 0: |
case 0: |
Line 4759 void nd_init_ord(struct order_spec *ord) |
|
Line 4769 void nd_init_ord(struct order_spec *ord) |
|
break; |
break; |
case 257: |
case 257: |
/* block order */ |
/* 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; |
ndl_compare_function = ndl_module_block_compare; |
break; |
break; |
case 258: |
case 258: |
/* matrix order */ |
/* 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_len = ord->ord.matrix.row; |
nd_matrix = ord->ord.matrix.matrix; |
nd_matrix = ord->ord.matrix.matrix; |
ndl_compare_function = ndl_module_matrix_compare; |
ndl_compare_function = ndl_module_matrix_compare; |
break; |
break; |
case 259: |
case 259: |
/* composite order */ |
/* 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_len = ord->ord.composite.length; |
nd_worb = ord->ord.composite.w_or_b; |
nd_worb = ord->ord.composite.w_or_b; |
ndl_compare_function = ndl_module_composite_compare; |
ndl_compare_function = ndl_module_composite_compare; |
Line 6800 void parse_nd_option(NODE opt) |
|
Line 6822 void parse_nd_option(NODE opt) |
|
char *key; |
char *key; |
Obj value; |
Obj value; |
|
|
nd_gentrace = 0; nd_gensyz = 0; |
nd_gentrace = 0; nd_gensyz = 0; nd_nora = 0; |
for ( t = opt; t; t = NEXT(t) ) { |
for ( t = opt; t; t = NEXT(t) ) { |
p = BDY((LIST)BDY(t)); |
p = BDY((LIST)BDY(t)); |
key = BDY((STRING)BDY(p)); |
key = BDY((STRING)BDY(p)); |
Line 6809 void parse_nd_option(NODE opt) |
|
Line 6831 void parse_nd_option(NODE opt) |
|
nd_gentrace = value?1:0; |
nd_gentrace = value?1:0; |
else if ( !strcmp(key,"gensyz") ) |
else if ( !strcmp(key,"gensyz") ) |
nd_gensyz = value?1:0; |
nd_gensyz = value?1:0; |
|
else if ( !strcmp(key,"nora") ) |
|
nd_nora = value?1:0; |
} |
} |
} |
} |