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

  Synopsis    [Merges groups in the DD table.]

  Description [Creates a single group from low to high and adjusts the
  idex field of the tree node.]

  SideEffects [None]

******************************************************************************/
Function
Synopsis    [Merges groups in the DD table.]

Description [Creates a single group from low to high and adjusts the
idex field of the tree node.]


Function Synopsis [ Merges groups in the DD table . ] Description [ Creates a single group from low to high and adjusts the idex field of the tree node . ]
static void
zddMergeGroups(
  DdManager * table,
  MtrNode * treenode,
  int  low,
  int  high)
{
    int i;
    MtrNode *auxnode;
    int saveindex;
    int newindex;
    if (treenode != table->treeZ) {
        for (i = low; i < high; i++)
            table->subtableZ[i].next = i+1;
        table->subtableZ[high].next = low;
    }
    saveindex = treenode->index;
    newindex = table->invpermZ[low];
    auxnode = treenode;
    do {
        auxnode->index = newindex;
        if (auxnode->parent == NULL ||
                (int) auxnode->parent->index != saveindex)
            break;
        auxnode = auxnode->parent;
    } while (1);
    return;
}
static void zddMergeGroups ( DdManager * table , MtrNode * treenode , int low , int high ) { int i ; MtrNode * auxnode ; int saveindex ; int newindex ; if ( treenode != table -> treeZ ) { for ( i = low ; i < high ; i ++ ) table -> subtableZ [ i ] . next = i + 1 ; table -> subtableZ [ high ] . next = low ; } saveindex = treenode -> index ; newindex = table -> invpermZ [ low ] ; auxnode = treenode ; do { auxnode -> index = newindex ; if ( auxnode -> parent == NULL || ( int ) auxnode -> parent -> index != saveindex ) break ; auxnode = auxnode -> parent ; } while ( 1 ) ; return ; }
Function
Synopsis    [Merges groups in the DD table.]
Function Synopsis [ Merges groups in the DD table . ]
/* Merge all variables from low to high in one group, unless
    ** this is the topmost group. In such a case we do not merge lest
    ** we lose the symmetry information. */ /* Adjust the index fields of the tree nodes. If a node is the
    ** first child of its parent, then the parent may also need adjustment. */