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

  Synopsis    [Extracts a dense subset from a BDD with the heavy branch
  heuristic.]

  Description [Extracts a dense subset from a BDD. This procedure
  builds a subset by throwing away one of the children of each node,
  starting from the root, until the result is small enough. The child
  that is eliminated from the result is the one that contributes the
  fewer minterms.  Returns a pointer to the BDD of the subset if
  successful. NULL if the procedure runs out of memory. The parameter
  numVars is the maximum number of variables to be used in minterm
  calculation and node count calculation.  The optimal number should
  be as close as possible to the size of the support of f.  However,
  it is safe to pass the value returned by Cudd_ReadSize for numVars
  when the number of variables is under 1023.  If numVars is larger
  than 1023, it will overflow. If a 0 parameter is passed then the
  procedure will compute a value which will avoid overflow but will
  cause underflow with 2046 variables or more.]

  SideEffects [None]

  SeeAlso     [Cudd_SubsetShortPaths Cudd_SupersetHeavyBranch Cudd_ReadSize]

******************************************************************************/
Function
Synopsis    [Extracts a dense subset from a BDD with the heavy branch
heuristic.]

Description [Extracts a dense subset from a BDD. This procedure
builds a subset by throwing away one of the children of each node,
starting from the root, until the result is small enough. The child
that is eliminated from the result is the one that contributes the
fewer minterms.  Returns a pointer to the BDD of the subset if
successful. NULL if the procedure runs out of memory. The parameter
numVars is the maximum number of variables to be used in minterm
calculation and node count calculation.  The optimal number should
be as close as possible to the size of the support of f.  However,
it is safe to pass the value returned by Cudd_ReadSize for numVars
when the number of variables is under 1023.  If numVars is larger
than 1023, it will overflow. If a 0 parameter is passed then the
procedure will compute a value which will avoid overflow but will
cause underflow with 2046 variables or more.]




Function Synopsis [ Extracts a dense subset from a BDD with the heavy branch heuristic . ] Description [ Extracts a dense subset from a BDD . This procedure builds a subset by throwing away one of the children of each node starting from the root until the result is small enough . The child that is eliminated from the result is the one that contributes the fewer minterms . Returns a pointer to the BDD of the subset if successful . NULL if the procedure runs out of memory . The parameter numVars is the maximum number of variables to be used in minterm calculation and node count calculation . The optimal number should be as close as possible to the size of the support of f . However it is safe to pass the value returned by Cudd_ReadSize for numVars when the number of variables is under 1023 . If numVars is larger than 1023 it will overflow . If a 0 parameter is passed then the procedure will compute a value which will avoid overflow but will cause underflow with 2046 variables or more . ]
DdNode *
Cudd_SubsetHeavyBranch(
  DdManager * dd ,
  DdNode * f ,
  int  numVars ,
  int  threshold )
{
    DdNode *subset;
    memOut = 0;
    do {
        dd->reordered = 0;
        subset = cuddSubsetHeavyBranch(dd, f, numVars, threshold);
    } while ((dd->reordered == 1) && (!memOut));
    return(subset);
}
DdNode * Cudd_SubsetHeavyBranch ( DdManager * dd , DdNode * f , int numVars , int threshold ) { DdNode * subset ; memOut = 0 ; do { dd -> reordered = 0 ; subset = cuddSubsetHeavyBranch ( dd , f , numVars , threshold ) ; } while ( ( dd -> reordered == 1 ) && ( ! memOut ) ) ; return ( subset ) ; }
Function
Synopsis    [Extracts a dense subset from a BDD with the heavy branch
heuristic.]
Function Synopsis [ Extracts a dense subset from a BDD with the heavy branch heuristic . ]
/* manager */ /* function to be subset */ /* number of variables in the support of f */ /* maximum number of nodes in the subset */