version 1.186, 2010/04/23 07:35:44 |
version 1.188, 2010/04/26 01:10:04 |
|
|
/* $OpenXM: OpenXM_contrib2/asir2000/engine/nd.c,v 1.185 2010/04/23 04:44:51 noro Exp $ */ |
/* $OpenXM: OpenXM_contrib2/asir2000/engine/nd.c,v 1.187 2010/04/26 01:06:22 noro Exp $ */ |
|
|
#include "nd.h" |
#include "nd.h" |
|
|
Line 49 static int nd_demand; |
|
Line 49 static int nd_demand; |
|
static int nd_module,nd_ispot,nd_mpos,nd_pot_nelim; |
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,nd_nora,nd_incr; |
static int nd_gentrace,nd_gensyz,nd_nora; |
|
static int *nd_gbblock; |
|
|
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 2300 ND_pairs nd_newpairs( NODE g, int t ) |
|
Line 2301 ND_pairs nd_newpairs( NODE g, int t ) |
|
{ |
{ |
NODE h; |
NODE h; |
UINT *dl; |
UINT *dl; |
int ts,s; |
int ts,s,i,t0,min,max; |
ND_pairs r,r0; |
ND_pairs r,r0; |
|
|
dl = DL(nd_psh[t]); |
dl = DL(nd_psh[t]); |
Line 2308 ND_pairs nd_newpairs( NODE g, int t ) |
|
Line 2309 ND_pairs nd_newpairs( NODE g, int t ) |
|
for ( r0 = 0, h = g; h; h = NEXT(h) ) { |
for ( r0 = 0, h = g; h; h = NEXT(h) ) { |
if ( nd_module && (MPOS(DL(nd_psh[(long)BDY(h)])) != MPOS(dl)) ) |
if ( nd_module && (MPOS(DL(nd_psh[(long)BDY(h)])) != MPOS(dl)) ) |
continue; |
continue; |
if ( (long)BDY(h) < nd_incr && t < nd_incr ) continue; |
if ( nd_gbblock ) { |
|
t0 = (long)BDY(h); |
|
for ( i = 0; nd_gbblock[i] >= 0; i += 2 ) { |
|
min = nd_gbblock[i]; max = nd_gbblock[i+1]; |
|
if ( t0 >= min && t0 <= max && t >= min && t <= max ) |
|
break; |
|
} |
|
if ( nd_gbblock[i] >= 0 ) |
|
continue; |
|
} |
NEXTND_pairs(r0,r); |
NEXTND_pairs(r0,r); |
r->i1 = (long)BDY(h); |
r->i1 = (long)BDY(h); |
r->i2 = t; |
r->i2 = t; |
Line 2895 void nd_gr(LIST f,LIST v,int m,int homo,int f4,struct |
|
Line 2905 void nd_gr(LIST f,LIST v,int m,int homo,int f4,struct |
|
ndv_homogenize((NDV)BDY(t),obpe,oadv,oepos,ompos); |
ndv_homogenize((NDV)BDY(t),obpe,oadv,oepos,ompos); |
} |
} |
|
|
ndv_setup(m,0,fd0,nd_incr?1:0,0); |
ndv_setup(m,0,fd0,nd_gbblock?1:0,0); |
if ( nd_gentrace ) { |
if ( nd_gentrace ) { |
MKLIST(l1,nd_tracelist); MKNODE(nd_alltracelist,l1,0); |
MKLIST(l1,nd_tracelist); MKNODE(nd_alltracelist,l1,0); |
} |
} |
Line 3162 void nd_gr_trace(LIST f,LIST v,int trace,int homo,int |
|
Line 3172 void nd_gr_trace(LIST f,LIST v,int trace,int homo,int |
|
tl1 = tl2 = tl3 = tl4 = 0; |
tl1 = tl2 = tl3 = tl4 = 0; |
if ( Demand ) |
if ( Demand ) |
nd_demand = 1; |
nd_demand = 1; |
ret = ndv_setup(m,1,fd0,nd_incr?1:0,0); |
ret = ndv_setup(m,1,fd0,nd_gbblock?1:0,0); |
if ( nd_gentrace ) { |
if ( nd_gentrace ) { |
MKLIST(l1,nd_tracelist); MKNODE(nd_alltracelist,l1,0); |
MKLIST(l1,nd_tracelist); MKNODE(nd_alltracelist,l1,0); |
} |
} |
Line 6937 void conv_ilist(int demand,int trace,NODE g,int **indp |
|
Line 6947 void conv_ilist(int demand,int trace,NODE g,int **indp |
|
|
|
void parse_nd_option(NODE opt) |
void parse_nd_option(NODE opt) |
{ |
{ |
NODE t,p; |
NODE t,p,u; |
|
int i,s; |
char *key; |
char *key; |
Obj value; |
Obj value; |
|
|
nd_gentrace = 0; nd_gensyz = 0; nd_nora = 0; nd_incr = 0; |
nd_gentrace = 0; nd_gensyz = 0; nd_nora = 0; nd_gbblock = 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 6952 void parse_nd_option(NODE opt) |
|
Line 6963 void parse_nd_option(NODE opt) |
|
nd_gensyz = value?1:0; |
nd_gensyz = value?1:0; |
else if ( !strcmp(key,"nora") ) |
else if ( !strcmp(key,"nora") ) |
nd_nora = value?1:0; |
nd_nora = value?1:0; |
else if ( !strcmp(key,"incr") ) |
else if ( !strcmp(key,"gbblock") ) { |
nd_incr = QTOS((Q)value); |
if ( !value || OID(value) != O_LIST ) |
|
error("nd_* : invalid value for gbblock option"); |
|
u = BDY((LIST)value); |
|
nd_gbblock = MALLOC(2*length(t)+1); |
|
for ( i = 0; u; u = NEXT(u) ) { |
|
p = BDY((LIST)BDY(u)); |
|
s = nd_gbblock[i++] = QTOS((Q)BDY(p)); |
|
nd_gbblock[i++] = s+QTOS((Q)BDY(NEXT(p)))-1; |
|
} |
|
nd_gbblock[i] = -1; |
|
} |
} |
} |
} |
} |