summaryrefslogtreecommitdiffstats
path: root/src/misc/vec/vecBit.h
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2015-02-27 09:41:04 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2015-02-27 09:41:04 -0800
commit2fcdd113162665234486485c6c150c3f5521b80c (patch)
tree098175aadbbd07cc80a2733e15a827ab855082d1 /src/misc/vec/vecBit.h
parent118776f39dcc3bbcfa0675807aae1abea639a340 (diff)
downloadabc-2fcdd113162665234486485c6c150c3f5521b80c.tar.gz
abc-2fcdd113162665234486485c6c150c3f5521b80c.tar.bz2
abc-2fcdd113162665234486485c6c150c3f5521b80c.zip
Experiments with cube hashing.
Diffstat (limited to 'src/misc/vec/vecBit.h')
-rw-r--r--src/misc/vec/vecBit.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/misc/vec/vecBit.h b/src/misc/vec/vecBit.h
index 2c0c65e5..cb89e982 100644
--- a/src/misc/vec/vecBit.h
+++ b/src/misc/vec/vecBit.h
@@ -310,6 +310,13 @@ static inline void Vec_BitWriteEntry( Vec_Bit_t * p, int i, int Entry )
p->pArray[i >> 5] &= ~(1 << (i & 31));
else assert(0);
}
+static inline int Vec_BitAddEntry( Vec_Bit_t * p, int i )
+{
+ if ( Vec_BitEntry(p, i) )
+ return 1;
+ Vec_BitWriteEntry( p, i, 1 );
+ return 0;
+}
/**Function*************************************************************
@@ -601,6 +608,24 @@ static inline int Vec_BitCount( Vec_Bit_t * p )
return Counter;
}
+/**Function*************************************************************
+
+ Synopsis []
+
+ Description []
+
+ SideEffects []
+
+ SeeAlso []
+
+***********************************************************************/
+static inline void Vec_BitReset( Vec_Bit_t * p )
+{
+ int i, nWords = (p->nSize >> 5) + ((p->nSize & 31) > 0);
+ for ( i = 0; i < nWords; i++ )
+ p->pArray[i] = 0;
+}
+
ABC_NAMESPACE_HEADER_END
#endif