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

  Synopsis    [Given a set of moves, returns the DD heap to the position
  giving the minimum size.]

  Description [Given a set of moves, returns the DD heap to the
  position giving the minimum size. In case of ties, returns to the
  closest position giving the minimum size. Returns 1 in case of
  success; 0 otherwise.]

  SideEffects [None]

******************************************************************************/
Function
Synopsis    [Given a set of moves, returns the DD heap to the position
giving the minimum size.]

Description [Given a set of moves, returns the DD heap to the
position giving the minimum size. In case of ties, returns to the
closest position giving the minimum size. Returns 1 in case of
success; 0 otherwise.]


Function Synopsis [ Given a set of moves returns the DD heap to the position giving the minimum size . ] Description [ Given a set of moves returns the DD heap to the position giving the minimum size . In case of ties returns to the closest position giving the minimum size . Returns 1 in case of success ; 0 otherwise . ]
static int
ddSiftingBackward(
  DdManager * table,
  int  size,
  Move * moves)
{
    Move *move;
    int res;
    for (move = moves; move != NULL; move = move->next) {
        if (move->size < size) {
            size = move->size;
        }
    }
    for (move = moves; move != NULL; move = move->next) {
        if (move->size == size) return(1);
        res = cuddSwapInPlace(table,(int)move->x,(int)move->y);
        if (!res) return(0);
    }
    return(1);
}
static int ddSiftingBackward ( DdManager * table , int size , Move * moves ) { Move * move ; int res ; for ( move = moves ; move != NULL ; move = move -> next ) { if ( move -> size < size ) { size = move -> size ; } } for ( move = moves ; move != NULL ; move = move -> next ) { if ( move -> size == size ) return ( 1 ) ; res = cuddSwapInPlace ( table , ( int ) move -> x , ( int ) move -> y ) ; if ( ! res ) return ( 0 ) ; } return ( 1 ) ; }
Function
Synopsis    [Given a set of moves, returns the DD heap to the position
giving the minimum size.]
Function Synopsis [ Given a set of moves returns the DD heap to the position giving the minimum size . ]