#include "util_hack.h"
#include "cuddInt.h"
Go to the source code of this file.
Functions | |
DdNode * | Cudd_addScalarInverse (DdManager *dd, DdNode *f, DdNode *epsilon) |
DdNode * | cuddAddScalarInverseRecur (DdManager *dd, DdNode *f, DdNode *epsilon) |
Variables | |
static char rcsid[] | DD_UNUSED = "$Id: cuddAddInv.c,v 1.1.1.1 2003/02/24 22:23:50 wjiang Exp $" |
AutomaticStart AutomaticEnd Function********************************************************************
Synopsis [Computes the scalar inverse of an ADD.]
Description [Computes an n ADD where the discriminants are the multiplicative inverses of the corresponding discriminants of the argument ADD. Returns a pointer to the resulting ADD in case of success. Returns NULL if any discriminants smaller than epsilon is encountered.]
SideEffects [None]
Definition at line 89 of file cuddAddInv.c.
00093 { 00094 DdNode *res; 00095 00096 if (!cuddIsConstant(epsilon)) { 00097 (void) fprintf(dd->err,"Invalid epsilon\n"); 00098 return(NULL); 00099 } 00100 do { 00101 dd->reordered = 0; 00102 res = cuddAddScalarInverseRecur(dd,f,epsilon); 00103 } while (dd->reordered == 1); 00104 return(res); 00105 00106 } /* end of Cudd_addScalarInverse */
Function********************************************************************
Synopsis [Performs the recursive step of addScalarInverse.]
Description [Returns a pointer to the resulting ADD in case of success. Returns NULL if any discriminants smaller than epsilon is encountered.]
SideEffects [None]
Definition at line 125 of file cuddAddInv.c.
00129 { 00130 DdNode *t, *e, *res; 00131 CUDD_VALUE_TYPE value; 00132 00133 statLine(dd); 00134 if (cuddIsConstant(f)) { 00135 if (ddAbs(cuddV(f)) < cuddV(epsilon)) return(NULL); 00136 value = 1.0 / cuddV(f); 00137 res = cuddUniqueConst(dd,value); 00138 return(res); 00139 } 00140 00141 res = cuddCacheLookup2(dd,Cudd_addScalarInverse,f,epsilon); 00142 if (res != NULL) return(res); 00143 00144 t = cuddAddScalarInverseRecur(dd,cuddT(f),epsilon); 00145 if (t == NULL) return(NULL); 00146 cuddRef(t); 00147 00148 e = cuddAddScalarInverseRecur(dd,cuddE(f),epsilon); 00149 if (e == NULL) { 00150 Cudd_RecursiveDeref(dd, t); 00151 return(NULL); 00152 } 00153 cuddRef(e); 00154 00155 res = (t == e) ? t : cuddUniqueInter(dd,(int)f->index,t,e); 00156 if (res == NULL) { 00157 Cudd_RecursiveDeref(dd, t); 00158 Cudd_RecursiveDeref(dd, e); 00159 return(NULL); 00160 } 00161 00162 cuddCacheInsert2(dd,Cudd_addScalarInverse,f,epsilon,res); 00163 00164 return(res); 00165 00166 } /* end of cuddAddScalarInverseRecur */
char rcsid [] DD_UNUSED = "$Id: cuddAddInv.c,v 1.1.1.1 2003/02/24 22:23:50 wjiang Exp $" [static] |
CFile***********************************************************************
FileName [cuddAddInv.c]
PackageName [cudd]
Synopsis [Function to compute the scalar inverse of an ADD.]
Description [External procedures included in this module:
Internal procedures included in this module:
]
Author [Fabio Somenzi]
Copyright [This file was created at the University of Colorado at Boulder. The University of Colorado at Boulder makes no warranty about the suitability of this software for any purpose. It is presented on an AS IS basis.]
Definition at line 51 of file cuddAddInv.c.