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

  Synopsis    [Sample hook function to call before reordering.]

  Description [Sample hook function to call before reordering.
  Prints on the manager's stdout reordering method and initial size.
  Returns 1 if successful; 0 otherwise.]

  SideEffects [None]

  SeeAlso     [Cudd_StdPostReordHook]

******************************************************************************/
Function
Synopsis    [Sample hook function to call before reordering.]

Description [Sample hook function to call before reordering.
Prints on the manager's stdout reordering method and initial size.
Returns 1 if successful; 0 otherwise.]




Function Synopsis [ Sample hook function to call before reordering . ] Description [ Sample hook function to call before reordering . Prints on the manager ' s stdout reordering method and initial size . Returns 1 if successful ; 0 otherwise . ]
int
Cudd_StdPreReordHook(
  DdManager *dd,
  const char *str,
  void *data)
{
    Cudd_ReorderingType method = (Cudd_ReorderingType) (ptruint) data;
    int retval;
    retval = fprintf(dd->out,"%s reordering with ", str);
    if (retval == EOF) return(0);
    switch (method) {
    case CUDD_REORDER_SIFT_CONVERGE:
    case CUDD_REORDER_SYMM_SIFT_CONV:
    case CUDD_REORDER_GROUP_SIFT_CONV:
    case CUDD_REORDER_WINDOW2_CONV:
    case CUDD_REORDER_WINDOW3_CONV:
    case CUDD_REORDER_WINDOW4_CONV:
    case CUDD_REORDER_LINEAR_CONVERGE:
        retval = fprintf(dd->out,"converging ");
        if (retval == EOF) return(0);
        break;
    default:
        break;
    }
    switch (method) {
    case CUDD_REORDER_RANDOM:
    case CUDD_REORDER_RANDOM_PIVOT:
        retval = fprintf(dd->out,"random");
        break;
    case CUDD_REORDER_SIFT:
    case CUDD_REORDER_SIFT_CONVERGE:
        retval = fprintf(dd->out,"sifting");
        break;
    case CUDD_REORDER_SYMM_SIFT:
    case CUDD_REORDER_SYMM_SIFT_CONV:
        retval = fprintf(dd->out,"symmetric sifting");
        break;
    case CUDD_REORDER_LAZY_SIFT:
        retval = fprintf(dd->out,"lazy sifting");
        break;
    case CUDD_REORDER_GROUP_SIFT:
    case CUDD_REORDER_GROUP_SIFT_CONV:
        retval = fprintf(dd->out,"group sifting");
        break;
    case CUDD_REORDER_WINDOW2:
    case CUDD_REORDER_WINDOW3:
    case CUDD_REORDER_WINDOW4:
    case CUDD_REORDER_WINDOW2_CONV:
    case CUDD_REORDER_WINDOW3_CONV:
    case CUDD_REORDER_WINDOW4_CONV:
        retval = fprintf(dd->out,"window");
        break;
    case CUDD_REORDER_ANNEALING:
        retval = fprintf(dd->out,"annealing");
        break;
    case CUDD_REORDER_GENETIC:
        retval = fprintf(dd->out,"genetic");
        break;
    case CUDD_REORDER_LINEAR:
    case CUDD_REORDER_LINEAR_CONVERGE:
        retval = fprintf(dd->out,"linear sifting");
        break;
    case CUDD_REORDER_EXACT:
        retval = fprintf(dd->out,"exact");
        break;
    default:
        return(0);
    }
    if (retval == EOF) return(0);
    retval = fprintf(dd->out,": from %ld to ... ", strcmp(str, "BDD") == 0 ?
                     Cudd_ReadNodeCount(dd) : Cudd_zddReadNodeCount(dd));
    if (retval == EOF) return(0);
    fflush(dd->out);
    return(1);
}
int Cudd_StdPreReordHook ( DdManager * dd , const char * str , void * data ) { Cudd_ReorderingType method = ( Cudd_ReorderingType ) ( ptruint ) data ; int retval ; retval = fprintf ( dd -> out , " " , str ) ; if ( retval == EOF ) return ( 0 ) ; switch ( method ) { case CUDD_REORDER_SIFT_CONVERGE : case CUDD_REORDER_SYMM_SIFT_CONV : case CUDD_REORDER_GROUP_SIFT_CONV : case CUDD_REORDER_WINDOW2_CONV : case CUDD_REORDER_WINDOW3_CONV : case CUDD_REORDER_WINDOW4_CONV : case CUDD_REORDER_LINEAR_CONVERGE : retval = fprintf ( dd -> out , " " ) ; if ( retval == EOF ) return ( 0 ) ; break ; default : break ; } switch ( method ) { case CUDD_REORDER_RANDOM : case CUDD_REORDER_RANDOM_PIVOT : retval = fprintf ( dd -> out , " " ) ; break ; case CUDD_REORDER_SIFT : case CUDD_REORDER_SIFT_CONVERGE : retval = fprintf ( dd -> out , " " ) ; break ; case CUDD_REORDER_SYMM_SIFT : case CUDD_REORDER_SYMM_SIFT_CONV : retval = fprintf ( dd -> out , " " ) ; break ; case CUDD_REORDER_LAZY_SIFT : retval = fprintf ( dd -> out , " " ) ; break ; case CUDD_REORDER_GROUP_SIFT : case CUDD_REORDER_GROUP_SIFT_CONV : retval = fprintf ( dd -> out , " " ) ; break ; case CUDD_REORDER_WINDOW2 : case CUDD_REORDER_WINDOW3 : case CUDD_REORDER_WINDOW4 : case CUDD_REORDER_WINDOW2_CONV : case CUDD_REORDER_WINDOW3_CONV : case CUDD_REORDER_WINDOW4_CONV : retval = fprintf ( dd -> out , " " ) ; break ; case CUDD_REORDER_ANNEALING : retval = fprintf ( dd -> out , " " ) ; break ; case CUDD_REORDER_GENETIC : retval = fprintf ( dd -> out , " " ) ; break ; case CUDD_REORDER_LINEAR : case CUDD_REORDER_LINEAR_CONVERGE : retval = fprintf ( dd -> out , " " ) ; break ; case CUDD_REORDER_EXACT : retval = fprintf ( dd -> out , " " ) ; break ; default : return ( 0 ) ; } if ( retval == EOF ) return ( 0 ) ; retval = fprintf ( dd -> out , " " , strcmp ( str , " " ) == 0 ? Cudd_ReadNodeCount ( dd ) : Cudd_zddReadNodeCount ( dd ) ) ; if ( retval == EOF ) return ( 0 ) ; fflush ( dd -> out ) ; return ( 1 ) ; }
Function
Synopsis    [Sample hook function to call before reordering.]
Function Synopsis [ Sample hook function to call before reordering . ]