summaryrefslogtreecommitdiffstats
path: root/src/misc/vec
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2016-04-09 17:00:46 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2016-04-09 17:00:46 -0700
commitd0a0cf63951e24a6d979af65c58d564254caec70 (patch)
tree188a285b131308422bb081f88293551dff2181c5 /src/misc/vec
parent8b07237bf5041bf6a09fdeabb52bbf2745c027bf (diff)
downloadabc-d0a0cf63951e24a6d979af65c58d564254caec70.tar.gz
abc-d0a0cf63951e24a6d979af65c58d564254caec70.tar.bz2
abc-d0a0cf63951e24a6d979af65c58d564254caec70.zip
Command &esop to convert AIG into ESOP.
Diffstat (limited to 'src/misc/vec')
-rw-r--r--src/misc/vec/vecHsh.h20
-rw-r--r--src/misc/vec/vecPtr.h20
2 files changed, 40 insertions, 0 deletions
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
@@ -770,6 +770,26 @@ static inline void Vec_PtrRemove( Vec_Ptr_t * p, void * Entry )
/**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.]
Description []