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

  Synopsis [Prints to the standard output a ZDD and its statistics.]

  Description [Prints to the standard output a DD and its statistics.
  The statistics include the number of nodes and the number of minterms.
  (The number of minterms is also the number of combinations in the set.)
  The statistics are printed if pr &gt; 0.  Specifically:
  <ul>
  <li> pr = 0 : prints nothing
  <li> pr = 1 : prints counts of nodes and minterms
  <li> pr = 2 : prints counts + disjoint sum of products
  <li> pr = 3 : prints counts + list of nodes
  <li> pr &gt; 3 : prints counts + disjoint sum of products + list of nodes
  </ul>
  Returns 1 if successful; 0 otherwise.
  ]

  SideEffects [None]

  SeeAlso     []

******************************************************************************/
Function
Synopsis [Prints to the standard output a ZDD and its statistics.]

Description [Prints to the standard output a DD and its statistics.
The statistics include the number of nodes and the number of minterms.
(The number of minterms is also the number of combinations in the set.)
The statistics are printed if pr > 0.




Function Synopsis [ Prints to the standard output a ZDD and its statistics . ] Description [ Prints to the standard output a DD and its statistics . The statistics include the number of nodes and the number of minterms . ( The number of minterms is also the number of combinations in the set . ) The statistics are printed if pr > 0 .
int
Cudd_zddPrintDebug(
  DdManager * zdd,
  DdNode * f,
  int  n,
  int  pr)
{
    DdNode      *empty = DD_ZERO(zdd);
    int         nodes;
    double      minterms;
    int         retval = 1;
    if (f == empty && pr > 0) {
        (void) fprintf(zdd->out,": is the empty ZDD\n");
        (void) fflush(zdd->out);
        return(1);
    }
    if (pr > 0) {
        nodes = Cudd_zddDagSize(f);
        if (nodes == CUDD_OUT_OF_MEM) retval = 0;
        minterms = Cudd_zddCountMinterm(zdd, f, n);
        if (minterms == (double)CUDD_OUT_OF_MEM) retval = 0;
        (void) fprintf(zdd->out,": %d nodes %g minterms\n",
                       nodes, minterms);
        if (pr > 2)
            if (!cuddZddP(zdd, f)) retval = 0;
        if (pr == 2 || pr > 3) {
            if (!Cudd_zddPrintMinterm(zdd, f)) retval = 0;
            (void) fprintf(zdd->out,"\n");
        }
        (void) fflush(zdd->out);
    }
    return(retval);
}
int Cudd_zddPrintDebug ( DdManager * zdd , DdNode * f , int n , int pr ) { DdNode * empty = DD_ZERO ( zdd ) ; int nodes ; double minterms ; int retval = 1 ; if ( f == empty && pr > 0 ) { ( void ) fprintf ( zdd -> out , " \n " ) ; ( void ) fflush ( zdd -> out ) ; return ( 1 ) ; } if ( pr > 0 ) { nodes = Cudd_zddDagSize ( f ) ; if ( nodes == CUDD_OUT_OF_MEM ) retval = 0 ; minterms = Cudd_zddCountMinterm ( zdd , f , n ) ; if ( minterms == ( double ) CUDD_OUT_OF_MEM ) retval = 0 ; ( void ) fprintf ( zdd -> out , " \n " , nodes , minterms ) ; if ( pr > 2 ) if ( ! cuddZddP ( zdd , f ) ) retval = 0 ; if ( pr == 2 || pr > 3 ) { if ( ! Cudd_zddPrintMinterm ( zdd , f ) ) retval = 0 ; ( void ) fprintf ( zdd -> out , " \n " ) ; } ( void ) fflush ( zdd -> out ) ; } return ( retval ) ; }
Function
Synopsis [Prints to the standard output a ZDD and its statistics.]
Function Synopsis [ Prints to the standard output a ZDD and its statistics . ]