📄 cuddapi.c
字号:
intCudd_ReadZddSize( DdManager * dd){ return(dd->sizeZ);} /* end of Cudd_ReadZddSize *//**Function******************************************************************** Synopsis [Returns the total number of slots of the unique table.] Description [Returns the total number of slots of the unique table. This number ismainly for diagnostic purposes.] SideEffects [None]******************************************************************************/unsigned intCudd_ReadSlots( DdManager * dd){ return(dd->slots);} /* end of Cudd_ReadSlots *//**Function******************************************************************** Synopsis [Reads the fraction of used slots in the unique table.] Description [Reads the fraction of used slots in the unique table. The unused slots are those in which no valid data is stored. Garbage collection, variable reordering, and subtable resizing may cause used slots to become unused.] SideEffects [None] SeeAlso [Cudd_ReadSlots]******************************************************************************/doubleCudd_ReadUsedSlots( DdManager * dd){ unsigned long used = 0; int i, j; int size = dd->size; DdNodePtr *nodelist; DdSubtable *subtable; DdNode *node; DdNode *sentinel = &(dd->sentinel); /* Scan each BDD/ADD subtable. */ for (i = 0; i < size; i++) { subtable = &(dd->subtables[i]); nodelist = subtable->nodelist; for (j = 0; (unsigned) j < subtable->slots; j++) { node = nodelist[j]; if (node != sentinel) { used++; } } } /* Scan the ZDD subtables. */ size = dd->sizeZ; for (i = 0; i < size; i++) { subtable = &(dd->subtableZ[i]); nodelist = subtable->nodelist; for (j = 0; (unsigned) j < subtable->slots; j++) { node = nodelist[j]; if (node != NULL) { used++; } } } /* Constant table. */ subtable = &(dd->constants); nodelist = subtable->nodelist; for (j = 0; (unsigned) j < subtable->slots; j++) { node = nodelist[j]; if (node != NULL) { used++; } } return((double)used / (double) dd->slots);} /* end of Cudd_ReadUsedSlots *//**Function******************************************************************** Synopsis [Computes the expected fraction of used slots in the unique table.] Description [Computes the fraction of slots in the unique table that should be in use. This expected value is based on the assumption that the hash function distributes the keys randomly; it can be compared with the result of Cudd_ReadUsedSlots to monitor the performance of the unique table hash function.] SideEffects [None] SeeAlso [Cudd_ReadSlots Cudd_ReadUsedSlots]******************************************************************************/doubleCudd_ExpectedUsedSlots( DdManager * dd){ int i; int size = dd->size; DdSubtable *subtable; double empty = 0.0; /* To each subtable we apply the corollary to Theorem 8.5 (occupancy ** distribution) from Sedgewick and Flajolet's Analysis of Algorithms. ** The corollary says that for a a table with M buckets and a load ratio ** of r, the expected number of empty buckets is asymptotically given ** by M * exp(-r). */ /* Scan each BDD/ADD subtable. */ for (i = 0; i < size; i++) { subtable = &(dd->subtables[i]); empty += (double) subtable->slots * exp(-(double) subtable->keys / (double) subtable->slots); } /* Scan the ZDD subtables. */ size = dd->sizeZ; for (i = 0; i < size; i++) { subtable = &(dd->subtableZ[i]); empty += (double) subtable->slots * exp(-(double) subtable->keys / (double) subtable->slots); } /* Constant table. */ subtable = &(dd->constants); empty += (double) subtable->slots * exp(-(double) subtable->keys / (double) subtable->slots); return(1.0 - empty / (double) dd->slots);} /* end of Cudd_ExpectedUsedSlots *//**Function******************************************************************** Synopsis [Returns the number of nodes in the unique table.] Description [Returns the total number of nodes currently in the unique table, including the dead nodes.] SideEffects [None] SeeAlso [Cudd_ReadDead]******************************************************************************/unsigned intCudd_ReadKeys( DdManager * dd){ return(dd->keys);} /* end of Cudd_ReadKeys *//**Function******************************************************************** Synopsis [Returns the number of dead nodes in the unique table.] Description [] SideEffects [None] SeeAlso [Cudd_ReadKeys]******************************************************************************/unsigned intCudd_ReadDead( DdManager * dd){ return(dd->dead);} /* end of Cudd_ReadDead *//**Function******************************************************************** Synopsis [Reads the minDead parameter of the manager.] Description [Reads the minDead parameter of the manager. The minDead parameter is used by the package to decide whether to collect garbage or resize a subtable of the unique table when the subtable becomes too full. The application can indirectly control the value of minDead by setting the looseUpTo parameter.] SideEffects [None] SeeAlso [Cudd_ReadDead Cudd_ReadLooseUpTo Cudd_SetLooseUpTo]******************************************************************************/unsigned intCudd_ReadMinDead( DdManager * dd){ return(dd->minDead);} /* end of Cudd_ReadMinDead *//**Function******************************************************************** Synopsis [Returns the number of times reordering has occurred.] Description [Returns the number of times reordering has occurred in the manager. The number includes both the calls to Cudd_ReduceHeap from the application program and those automatically performed by the package. However, calls that do not even initiate reordering are not counted. A call may not initiate reordering if there are fewer than minsize live nodes in the manager, or if CUDD_REORDER_NONE is specified as reordering method. The calls to Cudd_ShuffleHeap are not counted.] SideEffects [None] SeeAlso [Cudd_ReduceHeap Cudd_ReadReorderingTime]******************************************************************************/intCudd_ReadReorderings( DdManager * dd){ return(dd->reorderings);} /* end of Cudd_ReadReorderings *//**Function******************************************************************** Synopsis [Returns the time spent in reordering.] Description [Returns the number of milliseconds spent reordering variables since the manager was initialized. The time spent in collecting garbage before reordering is included.] SideEffects [None] SeeAlso [Cudd_ReadReorderings]******************************************************************************/longCudd_ReadReorderingTime( DdManager * dd){ return(dd->reordTime);} /* end of Cudd_ReadReorderingTime *//**Function******************************************************************** Synopsis [Returns the number of times garbage collection has occurred.] Description [Returns the number of times garbage collection has occurred in the manager. The number includes both the calls from reordering procedures and those caused by requests to create new nodes.] SideEffects [None] SeeAlso [Cudd_ReadGarbageCollectionTime]******************************************************************************/intCudd_ReadGarbageCollections( DdManager * dd){ return(dd->garbageCollections);} /* end of Cudd_ReadGarbageCollections *//**Function******************************************************************** Synopsis [Returns the time spent in garbage collection.] Description [Returns the number of milliseconds spent doing garbage collection since the manager was initialized.] SideEffects [None] SeeAlso [Cudd_ReadGarbageCollections]******************************************************************************/longCudd_ReadGarbageCollectionTime( DdManager * dd){ return(dd->GCTime);} /* end of Cudd_ReadGarbageCollectionTime *//**Function******************************************************************** Synopsis [Returns the number of nodes freed.] Description [Returns the number of nodes returned to the free list if the keeping of this statistic is enabled; -1 otherwise. This statistic is enabled only if the package is compiled with DD_STATS defined.] SideEffects [None] SeeAlso [Cudd_ReadNodesDropped]******************************************************************************/doubleCudd_ReadNodesFreed( DdManager * dd){#ifdef DD_STATS return(dd->nodesFreed);#else return(-1.0);#endif} /* end of Cudd_ReadNodesFreed *//**Function******************************************************************** Synopsis [Returns the number of nodes dropped.] Description [Returns the number of nodes killed by dereferencing if the keeping of this statistic is enabled; -1 otherwise. This statistic is enabled only if the package is compiled with DD_STATS defined.] SideEffects [None] SeeAlso [Cudd_ReadNodesFreed]******************************************************************************/doubleCudd_ReadNodesDropped( DdManager * dd){#ifdef DD_STATS return(dd->nodesDropped);#else return(-1.0);#endif} /* end of Cudd_ReadNodesDropped *//**Function******************************************************************** Synopsis [Returns the number of look-ups in the unique table.] Description [Returns the number of look-ups in the unique table if the keeping of this statistic is enabled; -1 otherwise. This statistic is enabled only if the package is compiled with DD_UNIQUE_PROFILE defined.] SideEffects [None] SeeAlso [Cudd_ReadUniqueLinks]******************************************************************************/doubleCudd_ReadUniqueLookUps( DdManager * dd){#ifdef DD_UNIQUE_PROFILE return(dd->uniqueLookUps);#else return(-1.0);#endif} /* end of Cudd_ReadUniqueLookUps *//**Function******************************************************************** Synopsis [Returns the number of links followed in the unique table.] Description [Returns the number of links followed during look-ups in the unique table if the keeping of this statistic is enabled; -1 otherwise. If an item is found in the first position of its collision list, the number of links followed is taken to be 0. If it is in second position, the number of links is 1, and so on. This statistic is enabled only if the package is compiled with DD_UNIQUE_PROFILE defined.] SideEffects [None] SeeAlso [Cudd_ReadUniqueLookUps]******************************************************************************/doubleCudd_ReadUniqueLinks( DdManager * dd){#ifdef DD_UNIQUE_PROFILE return(dd->uniqueLinks);#else return(-1.0);#endif} /* end of Cudd_ReadUniqueLinks *//**Function******************************************************************** Synopsis [Reads the siftMaxVar parameter of the manager.] Description [Reads the siftMaxVar parameter of the manager. This parameter gives the maximum number of variables that will be sifted for each invocation of sifting.] SideEffects [None] SeeAlso [Cudd_ReadSiftMaxSwap Cudd_SetSiftMaxVar]******************************************************************************/intCudd_ReadSiftMaxVar( DdManager * dd){ return(dd->siftMaxVar);} /* end of Cudd_ReadSiftMaxVar *//**Function******************************************************************** Synopsis [Sets the siftMaxVar parameter of the manager.] Description [Sets the siftMaxVar parameter of the manager. This parameter gives the maximum number of variables that will be sifted for each invocation of sifting.] SideEffects [None] SeeAlso [Cudd_SetSiftMaxSwap Cudd_ReadSiftMaxVar]******************************************************************************/voidCudd_SetSiftMaxVar( DdManager * dd, int smv){ dd->siftMaxVar = smv;} /* end of Cudd_SetSiftMaxVar *//**Function******************************************************************** Synopsis [Reads the siftMaxSwap parameter of the manager.] Description [Reads the siftMaxSwap parameter of the manager. This parameter gives the maximum number of swaps that will be attempted for each invocation of sifting. The real number of swaps may exceed the set limit because the package will always complete the sifting of the variable that causes the limit to be reached.] SideEffects [None] SeeAlso [Cudd_ReadSiftMaxVar Cudd_SetSiftMaxSwap]
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -