diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2012-01-13 15:43:09 -0800 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2012-01-13 15:43:09 -0800 |
commit | 095345fc4a8208364d4c1fdf645e0217d3921b8e (patch) | |
tree | 5d6d68b940f540453b693d6eeafc05ebfbcfe92d /src/misc/util/abc_global.h | |
parent | cb2d12bb043bd3521c706e747cd9579273090583 (diff) | |
download | abc-095345fc4a8208364d4c1fdf645e0217d3921b8e.tar.gz abc-095345fc4a8208364d4c1fdf645e0217d3921b8e.tar.bz2 abc-095345fc4a8208364d4c1fdf645e0217d3921b8e.zip |
Added new name manager and modified hierarchy manager to use it.
Diffstat (limited to 'src/misc/util/abc_global.h')
-rw-r--r-- | src/misc/util/abc_global.h | 27 |
1 files changed, 27 insertions, 0 deletions
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 ); |