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

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

  Description [Reorders by applying a sliding window of width 4.
  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 4.]

Description [Reorders by applying a sliding window of width 4.
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 4 . ] Description [ Reorders by applying a sliding window of width 4 . 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
ddWindow4(
  DdManager * table,
  int  low,
  int  high)
{
    int w;
    int res;
#ifdef DD_DEBUG
    assert(low >= 0 && high < table->size);
#endif
    if (high-low < 3) return(ddWindow3(table,low,high));
    for (w = low; w+2 < high; w++) {
        res = ddPermuteWindow4(table,w);
        if (res == 0) return(0);
#ifdef DD_STATS
        if (res == ABCD) {
            (void) fprintf(table->out,"=");
        } else {
            (void) fprintf(table->out,"-");
        }
        fflush(table->out);
#endif
    }
    return(1);
}
static int ddWindow4 ( DdManager * table , int low , int high ) { int w ; int res ; #ifdef DD_DEBUG assert ( low >= 0 && high < table -> size ) ; #endif if ( high - low < 3 ) return ( ddWindow3 ( table , low , high ) ) ; for ( w = low ; w + 2 < high ; w ++ ) { res = ddPermuteWindow4 ( table , w ) ; if ( res == 0 ) return ( 0 ) ; #ifdef DD_STATS if ( res == ABCD ) { ( 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 4.]
Function Synopsis [ Reorders by applying a sliding window of width 4 . ]