From 85e23c84597c57d45c70125871fb3b6e1352aa90 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Tue, 17 Jun 2014 21:00:51 -0700 Subject: Various changes to enable better CNF generation. --- src/aig/gia/giaIso3.c | 68 --------------------------------------------------- 1 file changed, 68 deletions(-) (limited to 'src/aig/gia/giaIso3.c') diff --git a/src/aig/gia/giaIso3.c b/src/aig/gia/giaIso3.c index 18430a6c..a88a0569 100644 --- a/src/aig/gia/giaIso3.c +++ b/src/aig/gia/giaIso3.c @@ -34,74 +34,6 @@ static unsigned Iso_Compl[2] = { 0x8ba63e50, 0x14d87f02 }; // non-compl, compl //////////////////////////////////////////////////////////////////////// /// FUNCTION DEFINITIONS /// //////////////////////////////////////////////////////////////////////// -/**Function************************************************************* - - Synopsis [Counts the number of unique entries.] - - Description [] - - SideEffects [] - - SeeAlso [] - -***********************************************************************/ -static inline unsigned Vec_IntUniqueHashKey( unsigned char * pStr, int nChars ) -{ - static unsigned s_BigPrimes[4] = {12582917, 25165843, 50331653, 100663319}; - unsigned Key = 0; int c; - for ( c = 0; c < nChars; c++ ) - Key += (unsigned)pStr[c] * s_BigPrimes[c & 3]; - return Key; -} -static inline int * Vec_IntUniqueLookup( Vec_Int_t * vData, int i, int nIntSize, int * pNexts, int * pStart ) -{ - int * pData = Vec_IntEntryP( vData, i*nIntSize ); - for ( ; *pStart != -1; pStart = pNexts + *pStart ) - if ( !memcmp( pData, Vec_IntEntryP(vData, *pStart*nIntSize), sizeof(int) * nIntSize ) ) - return pStart; - return pStart; -} -static inline int Vec_IntUniqueCount( Vec_Int_t * vData, int nIntSize, Vec_Int_t ** pvMap ) -{ - int nEntries = Vec_IntSize(vData) / nIntSize; - int TableMask = (1 << Abc_Base2Log(nEntries)) - 1; - int * pTable = ABC_FALLOC( int, TableMask+1 ); - int * pNexts = ABC_FALLOC( int, TableMask+1 ); - int * pClass = ABC_ALLOC( int, nEntries ); - int i, Key, * pEnt, nUnique = 0; - assert( nEntries * nIntSize == Vec_IntSize(vData) ); - for ( i = 0; i < nEntries; i++ ) - { - pEnt = Vec_IntEntryP( vData, i*nIntSize ); - Key = TableMask & Vec_IntUniqueHashKey( (unsigned char *)pEnt, 4*nIntSize ); - pEnt = Vec_IntUniqueLookup( vData, i, nIntSize, pNexts, pTable+Key ); - if ( *pEnt == -1 ) - *pEnt = i, nUnique++; - pClass[i] = *pEnt; - } - ABC_FREE( pTable ); - ABC_FREE( pNexts ); - if ( pvMap ) - *pvMap = Vec_IntAllocArray( pClass, nEntries ); - else - ABC_FREE( pClass ); - return nUnique; -} -static inline Vec_Int_t * Vec_IntUniqifyHash( Vec_Int_t * vData, int nIntSize ) -{ - Vec_Int_t * vMap, * vUnique; - int i, Ent, nUnique = Vec_IntUniqueCount( vData, nIntSize, &vMap ); - vUnique = Vec_IntAlloc( nUnique * nIntSize ); - Vec_IntForEachEntry( vMap, Ent, i ) - { - if ( Ent < i ) continue; - assert( Ent == i ); - Vec_IntPushArray( vUnique, Vec_IntEntryP(vData, i*nIntSize), nIntSize ); - } - assert( Vec_IntSize(vUnique) == nUnique * nIntSize ); - Vec_IntFree( vMap ); - return vUnique; -} /**Function************************************************************* -- cgit v1.2.3