77 for ( i = 0; i <
nWords; i++ )
78 uHash ^= pTruth[i] * pPrimes[i & 0x7];
95 static int s_Primes[10] = { 1291, 1699, 2357, 4177, 5147, 5647, 6343, 7103, 7873, 8147 };
98 assert( (pTruth[0] & 1) == 0 );
99 pSpot = p->pTable +
Tru_ManHash( pTruth, p->nWords, p->nTableSize, s_Primes );
120 int * pTableOld, * pSpot;
121 int nTableSizeOld, iNext,
Counter, i;
122 assert( p->pTable != NULL );
124 pTableOld = p->pTable;
125 nTableSizeOld = p->nTableSize;
126 p->nTableSize = 2 * p->nTableSize + 1;
130 for ( i = 0; i < nTableSizeOld; i++ )
132 iNext = (pThis? pThis->
Next : 0);
134 iNext = (pThis? pThis->
Next : 0) )
168 fCompl = pTruth[0] & 1;
176 assert( (*pSpot & 1) == 0 );
184 return *pSpot ^ fCompl;
211 assert( nVars > 0 && nVars <= 16 );
214 p->nWords = (nVars < 6) ? 1 : (1 << (nVars-6));
215 p->nEntrySize = (
sizeof(
Tru_One_t) + p->nWords *
sizeof(
word))/
sizeof(
int);
216 p->nTableSize = 8147;
221 for ( i = 0; i < nVars; i++ )
223 for ( w = 0; w < p->nWords; w++ )
225 p->pZero[w] = Masks[i];
226 else if ( w & (1 << (i-6)) )
227 p->pZero[w] = ~(
word)0;
231 assert( !i || p->hIthVars[i] > p->hIthVars[i-1] );
250 printf(
"Lookups = %d. Entries = %d.\n", p->nTableLookups,
Vec_SetEntryNum(p->pMem) );
270 assert( v >= 0 && v < p->nVars );
static word * Tru_ManNot(word *pOut, int nWords)
void Tru_ManFree(Tru_Man_t *p)
Tru_Man_t * Tru_ManAlloc(int nVars)
FUNCTION DECLARATIONS ///.
static void Vec_SetFree(Vec_Set_t *p)
static Vec_Set_t * Vec_SetAlloc(int nPageSize)
#define ABC_ALLOC(type, num)
static word * Vec_SetEntry(Vec_Set_t *p, int h)
void Tru_ManResize(Tru_Man_t *p)
static int Vec_SetAppend(Vec_Set_t *p, int *pArray, int nSize)
static int Vec_SetEntryNum(Vec_Set_t *p)
static int s_Primes[MAX_PRIMES]
struct Tru_One_t_ Tru_One_t
static int Tru_ManEqual0(word *pOut, int nWords)
unsigned __int64 word
DECLARATIONS ///.
#define ABC_NAMESPACE_IMPL_END
static Tru_One_t * Tru_ManReadOne(Tru_Man_t *p, int h)
int * Tru_ManLookup(Tru_Man_t *p, word *pTruth)
typedefABC_NAMESPACE_HEADER_START struct Tru_Man_t_ Tru_Man_t
INCLUDES ///.
static word * Tru_ManCopy(word *pOut, word *pIn, int nWords)
word * Tru_ManFunc(Tru_Man_t *p, int h)
int Tru_ManInsert(Tru_Man_t *p, word *pTruth)
#define ABC_NAMESPACE_IMPL_START
static int Tru_ManEqual1(word *pOut, int nWords)
typedefABC_NAMESPACE_HEADER_START struct Vec_Set_t_ Vec_Set_t
INCLUDES ///.
static word * Tru_ManClear(word *pOut, int nWords)
static unsigned Tru_ManHash(word *pTruth, int nWords, int nBins, int *pPrimes)
FUNCTION DEFINITIONS ///.
#define ABC_CONST(number)
PARAMETERS ///.
#define ABC_CALLOC(type, num)
static int Tru_ManEqual(word *pOut, word *pIn, int nWords)
GLOBAL VARIABLES ///.
word * Tru_ManVar(Tru_Man_t *p, int v)