abc/src/bdd/cudd/cuddAPI.c
/**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]

******************************************************************************/
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.]




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 . ]
double
Cudd_ReadUsedSlots(
  DdManager * dd)
{
    unsigned long used = 0;
    int i, j;
    int size = dd->size;
    DdNodePtr *nodelist;
    DdSubtable *subtable;
    DdNode *node;
    DdNode *sentinel = &(dd->sentinel);
    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++;
            }
        }
    }
    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++;
            }
        }
    }
    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);
}
double Cudd_ReadUsedSlots ( DdManager * dd ) { unsigned long used = 0 ; int i , j ; int size = dd -> size ; DdNodePtr * nodelist ; DdSubtable * subtable ; DdNode * node ; DdNode * sentinel = & ( dd -> sentinel ) ; 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 ++ ; } } } 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 ++ ; } } } 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 ) ; }
Function
Synopsis    [Reads the fraction of used slots in the unique table.]
Function Synopsis [ Reads the fraction of used slots in the unique table . ]
/* Scan each BDD/ADD subtable. */ /* Scan the ZDD subtables. */ /* Constant table. */