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

  Synopsis    [Reorders by applying the method of the sliding window.]

  Description [Reorders by applying the method of the sliding window.
  Tries all possible permutations to the variables in a window that
  slides from low to high. The size of the window is determined by
  submethod.  Assumes that no dead nodes are present.  Returns 1 in
  case of success; 0 otherwise.]

  SideEffects [None]

******************************************************************************/
Function
Synopsis    [Reorders by applying the method of the sliding window.]

Description [Reorders by applying the method of the sliding window.
Tries all possible permutations to the variables in a window that
slides from low to high. The size of the window is determined by
submethod.  Assumes that no dead nodes are present.  Returns 1 in
case of success; 0 otherwise.]


Function Synopsis [ Reorders by applying the method of the sliding window . ] Description [ Reorders by applying the method of the sliding window . Tries all possible permutations to the variables in a window that slides from low to high . The size of the window is determined by submethod . Assumes that no dead nodes are present . Returns 1 in case of success ; 0 otherwise . ]
int
cuddWindowReorder(
  DdManager * table ,
  int low ,
  int high ,
  Cudd_ReorderingType submethod )
{
    int res;
#ifdef DD_DEBUG
    int supposedOpt;
#endif
    switch (submethod) {
    case CUDD_REORDER_WINDOW2:
        res = ddWindow2(table,low,high);
        break;
    case CUDD_REORDER_WINDOW3:
        res = ddWindow3(table,low,high);
        break;
    case CUDD_REORDER_WINDOW4:
        res = ddWindow4(table,low,high);
        break;
    case CUDD_REORDER_WINDOW2_CONV:
        res = ddWindowConv2(table,low,high);
        break;
    case CUDD_REORDER_WINDOW3_CONV:
        res = ddWindowConv3(table,low,high);
#ifdef DD_DEBUG
        supposedOpt = table->keys - table->isolated;
        res = ddWindow3(table,low,high);
        if (table->keys - table->isolated != (unsigned) supposedOpt) {
            (void) fprintf(table->err, "Convergence failed! (%d != %d)\n",
                           table->keys - table->isolated, supposedOpt);
        }
#endif
        break;
    case CUDD_REORDER_WINDOW4_CONV:
        res = ddWindowConv4(table,low,high);
#ifdef DD_DEBUG
        supposedOpt = table->keys - table->isolated;
        res = ddWindow4(table,low,high);
        if (table->keys - table->isolated != (unsigned) supposedOpt) {
            (void) fprintf(table->err,"Convergence failed! (%d != %d)\n",
                           table->keys - table->isolated, supposedOpt);
        }
#endif
        break;
    default: return(0);
    }
    return(res);
}
int cuddWindowReorder ( DdManager * table , int low , int high , Cudd_ReorderingType submethod ) { int res ; #ifdef DD_DEBUG int supposedOpt ; #endif switch ( submethod ) { case CUDD_REORDER_WINDOW2 : res = ddWindow2 ( table , low , high ) ; break ; case CUDD_REORDER_WINDOW3 : res = ddWindow3 ( table , low , high ) ; break ; case CUDD_REORDER_WINDOW4 : res = ddWindow4 ( table , low , high ) ; break ; case CUDD_REORDER_WINDOW2_CONV : res = ddWindowConv2 ( table , low , high ) ; break ; case CUDD_REORDER_WINDOW3_CONV : res = ddWindowConv3 ( table , low , high ) ; #ifdef DD_DEBUG supposedOpt = table -> keys - table -> isolated ; res = ddWindow3 ( table , low , high ) ; if ( table -> keys - table -> isolated != ( unsigned ) supposedOpt ) { ( void ) fprintf ( table -> err , " \n " , table -> keys - table -> isolated , supposedOpt ) ; } #endif break ; case CUDD_REORDER_WINDOW4_CONV : res = ddWindowConv4 ( table , low , high ) ; #ifdef DD_DEBUG supposedOpt = table -> keys - table -> isolated ; res = ddWindow4 ( table , low , high ) ; if ( table -> keys - table -> isolated != ( unsigned ) supposedOpt ) { ( void ) fprintf ( table -> err , " \n " , table -> keys - table -> isolated , supposedOpt ) ; } #endif break ; default : return ( 0 ) ; } return ( res ) ; }
Function
Synopsis    [Reorders by applying the method of the sliding window.]
Function Synopsis [ Reorders by applying the method of the sliding window . ]
/* DD table */ /* lowest index to reorder */ /* highest index to reorder */ /* window reordering option */