From 2fcdd113162665234486485c6c150c3f5521b80c Mon Sep 17 00:00:00 2001 From: Alan Mishchenko Date: Fri, 27 Feb 2015 09:41:04 -0800 Subject: Experiments with cube hashing. --- src/misc/vec/vecBit.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/misc/vec/vecBit.h') 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 -- cgit v1.2.3