From d0a0cf63951e24a6d979af65c58d564254caec70 Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Sat, 9 Apr 2016 17:00:46 -0700 Subject: Command &esop to convert AIG into ESOP. --- src/misc/vec/vecHsh.h | 20 ++++++++++++++++++++ src/misc/vec/vecPtr.h | 20 ++++++++++++++++++++ 2 files changed, 40 insertions(+) (limited to 'src/misc/vec') diff --git a/src/misc/vec/vecHsh.h b/src/misc/vec/vecHsh.h index 8fcf7b0a..52289231 100644 --- a/src/misc/vec/vecHsh.h +++ b/src/misc/vec/vecHsh.h @@ -79,6 +79,8 @@ struct Hsh_VecMan_t_ Vec_Int_t * vData; // data storage Vec_Int_t * vMap; // mapping entries into data; Vec_Int_t vTemp; // temporary array + Vec_Int_t vTemp1; // temporary array + Vec_Int_t vTemp2; // temporary array }; //////////////////////////////////////////////////////////////////////// @@ -305,6 +307,10 @@ static inline void Hsh_VecManStop( Hsh_VecMan_t * p ) Vec_IntFree( p->vMap ); ABC_FREE( p ); } +static inline int * Hsh_VecReadArray( Hsh_VecMan_t * p, int i ) +{ + return (int*)Hsh_VecObj(p, i) + 2; +} static inline Vec_Int_t * Hsh_VecReadEntry( Hsh_VecMan_t * p, int i ) { Hsh_VecObj_t * pObj = Hsh_VecObj( p, i ); @@ -312,6 +318,20 @@ static inline Vec_Int_t * Hsh_VecReadEntry( Hsh_VecMan_t * p, int i ) p->vTemp.pArray = (int*)pObj + 2; return &p->vTemp; } +static inline Vec_Int_t * Hsh_VecReadEntry1( Hsh_VecMan_t * p, int i ) +{ + Hsh_VecObj_t * pObj = Hsh_VecObj( p, i ); + p->vTemp1.nSize = p->vTemp1.nCap = pObj->nSize; + p->vTemp1.pArray = (int*)pObj + 2; + return &p->vTemp1; +} +static inline Vec_Int_t * Hsh_VecReadEntry2( Hsh_VecMan_t * p, int i ) +{ + Hsh_VecObj_t * pObj = Hsh_VecObj( p, i ); + p->vTemp2.nSize = p->vTemp2.nCap = pObj->nSize; + p->vTemp2.pArray = (int*)pObj + 2; + return &p->vTemp2; +} static inline int Hsh_VecSize( Hsh_VecMan_t * p ) { return Vec_IntSize(p->vMap); diff --git a/src/misc/vec/vecPtr.h b/src/misc/vec/vecPtr.h index f40a7807..5b40665f 100644 --- a/src/misc/vec/vecPtr.h +++ b/src/misc/vec/vecPtr.h @@ -768,6 +768,26 @@ static inline void Vec_PtrRemove( Vec_Ptr_t * p, void * Entry ) p->nSize--; } +/**Function************************************************************* + + Synopsis [] + + Description [] + + SideEffects [] + + SeeAlso [] + +***********************************************************************/ +static inline void Vec_PtrDrop( Vec_Ptr_t * p, int i ) +{ + int k; + assert( i >= 0 && i < Vec_PtrSize(p) ); + p->nSize--; + for ( k = i; k < p->nSize; k++ ) + p->pArray[k] = p->pArray[k+1]; +} + /**Function************************************************************* Synopsis [Interts entry at the index iHere. Shifts other entries.] -- cgit v1.2.3