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

  Synopsis    [Returns a new BDD variable at a specified level.]

  Description [Creates a new BDD variable.  The new variable has an
  index equal to the largest previous index plus 1 and is positioned at
  the specified level in the order.  Returns a pointer to the new
  variable if successful; NULL otherwise.]

  SideEffects [None]

  SeeAlso     [Cudd_bddNewVar Cudd_bddIthVar Cudd_addNewVarAtLevel]

******************************************************************************/
Function
Synopsis    [Returns a new BDD variable at a specified level.]

Description [Creates a new BDD variable.  The new variable has an
index equal to the largest previous index plus 1 and is positioned at
the specified level in the order.  Returns a pointer to the new
variable if successful; NULL otherwise.]




Function Synopsis [ Returns a new BDD variable at a specified level . ] Description [ Creates a new BDD variable . The new variable has an index equal to the largest previous index plus 1 and is positioned at the specified level in the order . Returns a pointer to the new variable if successful ; NULL otherwise . ]
DdNode *
Cudd_bddNewVarAtLevel(
  DdManager * dd,
  int  level)
{
    DdNode *res;
    if ((unsigned int) dd->size >= CUDD_MAXINDEX - 1) return(NULL);
    if (level >= dd->size) return(Cudd_bddIthVar(dd,level));
    if (!cuddInsertSubtables(dd,1,level)) return(NULL);
    res = dd->vars[dd->size - 1];
    return(res);
}
DdNode * Cudd_bddNewVarAtLevel ( DdManager * dd , int level ) { DdNode * res ; if ( ( unsigned int ) dd -> size >= CUDD_MAXINDEX - 1 ) return ( NULL ) ; if ( level >= dd -> size ) return ( Cudd_bddIthVar ( dd , level ) ) ; if ( ! cuddInsertSubtables ( dd , 1 , level ) ) return ( NULL ) ; res = dd -> vars [ dd -> size - 1 ] ; return ( res ) ; }
Function
Synopsis    [Returns a new BDD variable at a specified level.]
Function Synopsis [ Returns a new BDD variable at a specified level . ]