From 095345fc4a8208364d4c1fdf645e0217d3921b8e Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Fri, 13 Jan 2012 15:43:09 -0800 Subject: Added new name manager and modified hierarchy manager to use it. --- src/misc/util/abc_global.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src/misc/util/abc_global.h') diff --git a/src/misc/util/abc_global.h b/src/misc/util/abc_global.h index 67b8abb0..61aa9327 100644 --- a/src/misc/util/abc_global.h +++ b/src/misc/util/abc_global.h @@ -298,6 +298,33 @@ static inline void Abc_PrintMemoryP( int level, const char * pStr, int time, int ABC_PRMP( pStr, time, Time ); } +// Returns the next prime >= p +static inline int Abc_PrimeCudd( unsigned int p ) +{ + int i,pn; + p--; + do { + p++; + if (p&1) + { + pn = 1; + i = 3; + while ((unsigned) (i * i) <= p) + { + if (p % i == 0) { + pn = 0; + break; + } + i += 2; + } + } + else + pn = 0; + } while (!pn); + return(p); + +} // end of Cudd_Prime + extern void Abc_Sort( int * pInput, int nSize ); extern int * Abc_SortCost( int * pCosts, int nSize ); -- cgit v1.2.3