From 8014f25f6db719fa62336f997963532a14c568f6 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Sat, 21 Jan 2012 04:30:10 -0800 Subject: Major restructuring of the code. --- src/misc/nm/nm.h | 4 ++-- src/misc/nm/nmApi.c | 2 +- src/misc/nm/nmInt.h | 9 ++++----- src/misc/nm/nmTable.c | 37 +------------------------------------ 4 files changed, 8 insertions(+), 44 deletions(-) (limited to 'src/misc/nm') 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 /// -- cgit v1.2.3