28 #define inline __inline // compatible with MS VS 6.0
34 #define TEST_VAR_MAX 10
35 #define TEST_SET_MAX 10
77 if ( nCap > 0 && nCap < 16 )
81 p->pArray = p->nCap?
ABC_ALLOC(
int, p->nCap ) : NULL;
91 int * pArray = p->pArray;
99 assert( i >= 0 && i < p->nSize );
100 return p->pArray[i] += Addition;
104 if ( p->nCap >= nCapMin )
106 p->pArray =
ABC_REALLOC(
int, p->pArray, nCapMin );
113 return p->pArray[--p->nSize];
117 if ( p->nSize == p->nCap )
124 p->pArray[p->nSize++] = Entry;
129 for ( i = 0; i < vVec2->nSize; i++ )
165 if ( ProbThis < ProbLimit )
195 assert( ProbLimit > 0 && ProbLimit <= 1 );
196 for ( i = 0; i < sizeZ; i++ )
197 assert( pVarProbs[i] > 0 && pVarProbs[i] <= 1 );
247 DdNode * zOne, * zVar, * zRes, * zTemp;
249 for ( i = 0; i < nSubsets; i++ )
252 for ( k = 0; pSubsets[i][k] != -1; k++ )
280 printf(
"The set contains %d subsets:\n", pSubsets[0] );
281 for ( i = k = 0; i < pSubsets[0]; i++ )
283 printf(
"Subset %3d : {", Counter );
284 for ( k++; pSubsets[k] != -1; k++ )
285 printf(
" %d", pSubsets[k] );
306 int pSubsets[
TEST_SET_MAX][
TEST_VAR_MAX+1] = { {0, 3, 5, -1}, {1, 2, 3, 6, 9, -1}, {1, 5, 7, 8, -1}, {2, 4, -1}, {0, 5, 6, 9, -1} };
308 double pVarProbs[
TEST_VAR_MAX] = { 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1 };
309 double ProbLimit = 0.001;
317 printf(
"The initial ZDD representing %d subsets:\n", nSubsets );
322 printf(
"The resulting ZDD representing %d subsets:\n", pOutput[0] );
void Cudd_RecursiveDerefZdd(DdManager *table, DdNode *n)
#define CUDD_UNIQUE_SLOTS
DdNode * cuddZddGetNode(DdManager *zdd, int id, DdNode *T, DdNode *E)
typedefABC_NAMESPACE_IMPL_START struct Vec_Int_t_ Vec_Int_t
DECLARATIONS ///.
void Cudd_Deref(DdNode *node)
#define ABC_REALLOC(type, obj, num)
#define ABC_ALLOC(type, num)
DdNode * Cudd_ReadZero(DdManager *dd)
DdNode * Cudd_zddUnion(DdManager *dd, DdNode *P, DdNode *Q)
#define ABC_NAMESPACE_IMPL_END
int Cudd_ReadZddSize(DdManager *dd)
DdManager * Cudd_Init(unsigned int numVars, unsigned int numVarsZ, unsigned int numSlots, unsigned int cacheSize, unsigned long maxMemory)
#define ABC_NAMESPACE_IMPL_START
DdNode * Cudd_zddUnateProduct(DdManager *dd, DdNode *f, DdNode *g)
DdNode * Cudd_ReadOne(DdManager *dd)
unsigned int Cudd_NodeReadIndex(DdNode *node)
int Cudd_zddPrintMinterm(DdManager *zdd, DdNode *node)
void Cudd_Quit(DdManager *unique)