abc/src/bdd/cudd/cuddAPI.c
/**Function********************************************************************

  Synopsis    [Reports the number of nodes in BDDs and ADDs.]

  Description [Reports the number of live nodes in BDDs and ADDs. This
  number does not include the isolated projection functions and the
  unused constants. These nodes that are not counted are not part of
  the DDs manipulated by the application.]

  SideEffects [None]

  SeeAlso     [Cudd_ReadPeakNodeCount Cudd_zddReadNodeCount]

******************************************************************************/
Function
Synopsis    [Reports the number of nodes in BDDs and ADDs.]

Description [Reports the number of live nodes in BDDs and ADDs. This
number does not include the isolated projection functions and the
unused constants. These nodes that are not counted are not part of
the DDs manipulated by the application.]




Function Synopsis [ Reports the number of nodes in BDDs and ADDs . ] Description [ Reports the number of live nodes in BDDs and ADDs . This number does not include the isolated projection functions and the unused constants . These nodes that are not counted are not part of the DDs manipulated by the application . ]
long
Cudd_ReadNodeCount(
  DdManager * dd)
{
    long count;
    int i;
#ifndef DD_NO_DEATH_ROW
    cuddClearDeathRow(dd);
#endif
    count = (long) (dd->keys - dd->dead);
    for (i=0; i < dd->size; i++) {
        if (dd->vars[i]->ref == 1) count--;
    }
    if (DD_ZERO(dd)->ref == 1) count--;
    if (DD_PLUS_INFINITY(dd)->ref == 1) count--;
    if (DD_MINUS_INFINITY(dd)->ref == 1) count--;
    return(count);
}
long Cudd_ReadNodeCount ( DdManager * dd ) { long count ; int i ; #ifndef DD_NO_DEATH_ROW cuddClearDeathRow ( dd ) ; #endif count = ( long ) ( dd -> keys - dd -> dead ) ; for ( i = 0 ; i < dd -> size ; i ++ ) { if ( dd -> vars [ i ] -> ref == 1 ) count -- ; } if ( DD_ZERO ( dd ) -> ref == 1 ) count -- ; if ( DD_PLUS_INFINITY ( dd ) -> ref == 1 ) count -- ; if ( DD_MINUS_INFINITY ( dd ) -> ref == 1 ) count -- ; return ( count ) ; }
Function
Synopsis    [Reports the number of nodes in BDDs and ADDs.]
Function Synopsis [ Reports the number of nodes in BDDs and ADDs . ]
/* Count isolated projection functions. Their number is subtracted
    ** from the node count because they are not part of the BDDs.
    */ /* Subtract from the count the unused constants. */