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

  Synopsis    [Reorders by applying a sliding window of width 3.]

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

  SideEffects [None]

******************************************************************************/
Function
Synopsis    [Reorders by applying a sliding window of width 3.]

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


Function Synopsis [ Reorders by applying a sliding window of width 3 . ] Description [ Reorders by applying a sliding window of width 3 . Tries all possible permutations to the variables in a window that slides from low to high . Assumes that no dead nodes are present . Returns 1 in case of success ; 0 otherwise . ]
static int
ddWindow3(
  DdManager * table,
  int  low,
  int  high)
{
    int x;
    int res;
#ifdef DD_DEBUG
    assert(low >= 0 && high < table->size);
#endif
    if (high-low < 2) return(ddWindow2(table,low,high));
    for (x = low; x+1 < high; x++) {
        res = ddPermuteWindow3(table,x);
        if (res == 0) return(0);
#ifdef DD_STATS
        if (res == ABC) {
            (void) fprintf(table->out,"=");
        } else {
            (void) fprintf(table->out,"-");
        }
        fflush(table->out);
#endif
    }
    return(1);
}
static int ddWindow3 ( DdManager * table , int low , int high ) { int x ; int res ; #ifdef DD_DEBUG assert ( low >= 0 && high < table -> size ) ; #endif if ( high - low < 2 ) return ( ddWindow2 ( table , low , high ) ) ; for ( x = low ; x + 1 < high ; x ++ ) { res = ddPermuteWindow3 ( table , x ) ; if ( res == 0 ) return ( 0 ) ; #ifdef DD_STATS if ( res == ABC ) { ( void ) fprintf ( table -> out , " " ) ; } else { ( void ) fprintf ( table -> out , " " ) ; } fflush ( table -> out ) ; #endif } return ( 1 ) ; }
Function
Synopsis    [Reorders by applying a sliding window of width 3.]
Function Synopsis [ Reorders by applying a sliding window of width 3 . ]