93 static char rcsid[]
DD_UNUSED =
"$Id: cuddBddCorr.c,v 1.14 2004/08/13 18:04:46 fabio Exp $";
116 static int CorrelCompare (
const char *key1,
const char *key2);
243 DdNode *Fv, *Fnv, *G, *Gv, *Gnv;
244 double min, *pmin, min1, min2, *dummy;
246 unsigned int topF, topG;
254 if (f == g)
return(1.0);
276 entry->f = f; entry->g = g;
282 if (
st__lookup(table, (
const char *)entry, (
char **)&dummy)) {
290 if (topF <= topG) { Fv =
cuddT(f); Fnv =
cuddE(f); }
else { Fv = Fnv = f; }
291 if (topG <= topF) { Gv =
cuddT(G); Gnv =
cuddE(G); }
else { Gv = Gnv = G; }
301 return(CUDD_OUT_OF_MEM);
304 if (min2 == (
double)CUDD_OUT_OF_MEM) {
306 return(CUDD_OUT_OF_MEM);
313 return((
double)CUDD_OUT_OF_MEM);
320 return((
double)CUDD_OUT_OF_MEM);
346 DdNode *Fv, *Fnv, *G, *Gv, *Gnv;
347 double min, *pmin, min1, min2, *dummy;
349 int topF, topG, index;
357 if (f == g)
return(1.0);
379 entry->f = f; entry->g = g;
385 if (
st__lookup(table, (
const char *)entry, (
char **)&dummy)) {
400 if (topG <= topF) { Gv =
cuddT(G); Gnv =
cuddE(G); }
else { Gv = Gnv = G; }
410 return((
double)CUDD_OUT_OF_MEM);
415 return((
double)CUDD_OUT_OF_MEM);
422 return((
double)CUDD_OUT_OF_MEM);
429 return((
double)CUDD_OUT_OF_MEM);
456 if (entry1->f != entry2->f || entry1->g != entry2->g)
return(1);
482 #if SIZEOF_VOID_P == 8 && SIZEOF_INT == 4
483 val = ((int) ((
long)entry->f))*997 + ((int) ((
long)entry->g));
485 val = ((int) entry->f)*997 + ((int) entry->g);
488 return ((val < 0) ? -val : val) % modulus;
static double bddCorrelationAux(DdManager *dd, DdNode *f, DdNode *g, st__table *table)
void st__free_table(st__table *table)
static int CorrelCompare(const char *key1, const char *key2)
int st__insert(st__table *table, const char *key, char *value)
static double bddCorrelationWeightsAux(DdManager *dd, DdNode *f, DdNode *g, double *prob, st__table *table)
#define Cudd_Regular(node)
#define ABC_ALLOC(type, num)
double Cudd_bddCorrelationWeights(DdManager *manager, DdNode *f, DdNode *g, double *prob)
st__table * st__init_table(st__compare_func_type compare, st__hash_func_type hash)
#define Cudd_IsComplement(node)
static enum st__retval CorrelCleanUp(char *key, char *value, char *arg)
#define ABC_NAMESPACE_IMPL_END
int st__foreach(st__table *table, enum st__retval(*func)(char *, char *, char *), char *arg)
double Cudd_bddCorrelation(DdManager *manager, DdNode *f, DdNode *g)
#define ABC_NAMESPACE_IMPL_START
int st__lookup(st__table *table, const char *key, char **value)
static int CorrelHash(const char *key, int modulus)
ABC_NAMESPACE_IMPL_START struct hashEntry HashEntry
static char rcsid[] DD_UNUSED