summaryrefslogtreecommitdiffstats
path: root/src/misc/vec/vecInt.h
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2014-03-22 16:24:44 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2014-03-22 16:24:44 -0700
commitace340997bfbbbae838c5f06956d06511739f37d (patch)
tree91fbf3c0a3dca0f938d294a1e4048403ddc1f194 /src/misc/vec/vecInt.h
parentc86a13f0b56b061fd0841efd080758fc3b77c53e (diff)
downloadabc-ace340997bfbbbae838c5f06956d06511739f37d.tar.gz
abc-ace340997bfbbbae838c5f06956d06511739f37d.tar.bz2
abc-ace340997bfbbbae838c5f06956d06511739f37d.zip
Experiments with mapping.
Diffstat (limited to 'src/misc/vec/vecInt.h')
-rw-r--r--src/misc/vec/vecInt.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/misc/vec/vecInt.h b/src/misc/vec/vecInt.h
index f8dc9385..613b5437 100644
--- a/src/misc/vec/vecInt.h
+++ b/src/misc/vec/vecInt.h
@@ -695,6 +695,12 @@ static inline void Vec_IntPush( Vec_Int_t * p, int Entry )
}
p->pArray[p->nSize++] = Entry;
}
+static inline void Vec_IntPushArray( Vec_Int_t * p, int * pEntries, int nEntries )
+{
+ int i;
+ for ( i = 0; i < nEntries; i++ )
+ Vec_IntPush( p, pEntries[i] );
+}
/**Function*************************************************************
@@ -1293,6 +1299,16 @@ static inline int Vec_IntCheckUniqueSmall( Vec_Int_t * p )
return 0;
return 1;
}
+static inline int Vec_IntCountUnique( Vec_Int_t * p )
+{
+ int i, Count = 0, Max = Vec_IntFindMax(p);
+ unsigned char * pPres = ABC_CALLOC( unsigned char, Max+1 );
+ for ( i = 0; i < p->nSize; i++ )
+ if ( pPres[p->pArray[i]] == 0 )
+ pPres[p->pArray[i]] = 1, Count++;
+ ABC_FREE( pPres );
+ return Count;
+}
/**Function*************************************************************