diff options
author | Alan Mishchenko <alanmi@berkeley.edu> | 2012-01-21 04:30:10 -0800 |
---|---|---|
committer | Alan Mishchenko <alanmi@berkeley.edu> | 2012-01-21 04:30:10 -0800 |
commit | 8014f25f6db719fa62336f997963532a14c568f6 (patch) | |
tree | c691ee91a3a2d452a2bd24ac89a8c717beaa7af7 /src/misc/nm | |
parent | c44cc5de9429e6b4f1c05045fcf43c9cb96437b5 (diff) | |
download | abc-8014f25f6db719fa62336f997963532a14c568f6.tar.gz abc-8014f25f6db719fa62336f997963532a14c568f6.tar.bz2 abc-8014f25f6db719fa62336f997963532a14c568f6.zip |
Major restructuring of the code.
Diffstat (limited to 'src/misc/nm')
-rw-r--r-- | src/misc/nm/nm.h | 4 | ||||
-rw-r--r-- | src/misc/nm/nmApi.c | 2 | ||||
-rw-r--r-- | src/misc/nm/nmInt.h | 9 | ||||
-rw-r--r-- | src/misc/nm/nmTable.c | 37 |
4 files changed, 8 insertions, 44 deletions
diff --git a/src/misc/nm/nm.h b/src/misc/nm/nm.h index 015b4ef4..2fa46d73 100644 --- a/src/misc/nm/nm.h +++ b/src/misc/nm/nm.h @@ -18,8 +18,8 @@ ***********************************************************************/ -#ifndef __NM_H__ -#define __NM_H__ +#ifndef ABC__misc__nm__nm_h +#define ABC__misc__nm__nm_h /* diff --git a/src/misc/nm/nmApi.c b/src/misc/nm/nmApi.c index e6bfb069..ab334032 100644 --- a/src/misc/nm/nmApi.c +++ b/src/misc/nm/nmApi.c @@ -52,7 +52,7 @@ Nm_Man_t * Nm_ManCreate( int nSize ) p->nSizeFactor = 2; // determined the limit on the grow of data before the table resizes p->nGrowthFactor = 3; // determined how much the table grows after resizing // allocate and clean the bins - p->nBins = Cudd_PrimeNm(nSize); + p->nBins = Abc_PrimeCudd(nSize); p->pBinsI2N = ABC_ALLOC( Nm_Entry_t *, p->nBins ); p->pBinsN2I = ABC_ALLOC( Nm_Entry_t *, p->nBins ); memset( p->pBinsI2N, 0, sizeof(Nm_Entry_t *) * p->nBins ); diff --git a/src/misc/nm/nmInt.h b/src/misc/nm/nmInt.h index 0978c6b6..4463b276 100644 --- a/src/misc/nm/nmInt.h +++ b/src/misc/nm/nmInt.h @@ -18,16 +18,16 @@ ***********************************************************************/ -#ifndef __NM_INT_H__ -#define __NM_INT_H__ +#ifndef ABC__misc__nm__nmInt_h +#define ABC__misc__nm__nmInt_h //////////////////////////////////////////////////////////////////////// /// INCLUDES /// //////////////////////////////////////////////////////////////////////// -#include "extra.h" -#include "vec.h" +#include "src/misc/extra/extra.h" +#include "src/misc/vec/vec.h" #include "nm.h" //////////////////////////////////////////////////////////////////////// @@ -78,7 +78,6 @@ extern int Nm_ManTableAdd( Nm_Man_t * p, Nm_Entry_t * pEntry ); extern int Nm_ManTableDelete( Nm_Man_t * p, int ObjId ); extern Nm_Entry_t * Nm_ManTableLookupId( Nm_Man_t * p, int ObjId ); extern Nm_Entry_t * Nm_ManTableLookupName( Nm_Man_t * p, char * pName, int Type ); -extern unsigned int Cudd_PrimeNm( unsigned int p ); diff --git a/src/misc/nm/nmTable.c b/src/misc/nm/nmTable.c index 29c751a6..4c2b7a0a 100644 --- a/src/misc/nm/nmTable.c +++ b/src/misc/nm/nmTable.c @@ -260,7 +260,7 @@ void Nm_ManResize( Nm_Man_t * p ) clk = clock(); // get the new table size - nBinsNew = Cudd_PrimeCopy( p->nGrowthFactor * p->nBins ); + nBinsNew = Abc_PrimeCudd( p->nGrowthFactor * p->nBins ); // allocate a new array pBinsNewI2N = ABC_ALLOC( Nm_Entry_t *, nBinsNew ); pBinsNewN2I = ABC_ALLOC( Nm_Entry_t *, nBinsNew ); @@ -299,41 +299,6 @@ clk = clock(); } -/**Function************************************************************* - - Synopsis [Returns the smallest prime larger than the number.] - - Description [] - - SideEffects [] - - SeeAlso [] - -***********************************************************************/ -unsigned int Cudd_PrimeNm( 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 */ //////////////////////////////////////////////////////////////////////// /// END OF FILE /// |