Lucene++ - a full-featured, c++ search engine
API Documentation


Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Static Public Attributes | Static Protected Member Functions
Lucene::BitUtil Class Reference

A variety of high efficiency bit twiddling routines. More...

#include <BitUtil.h>

+ Inheritance diagram for Lucene::BitUtil:

Public Member Functions

virtual ~BitUtil ()
 
virtual String getClassName ()
 
boost::shared_ptr< BitUtilshared_from_this ()
 
- Public Member Functions inherited from Lucene::LuceneObject
virtual ~LuceneObject ()
 
virtual void initialize ()
 Called directly after instantiation to create objects that depend on this object being fully constructed.
 
virtual LuceneObjectPtr clone (const LuceneObjectPtr &other=LuceneObjectPtr())
 Return clone of this object.
 
virtual int32_t hashCode ()
 Return hash code for this object.
 
virtual bool equals (const LuceneObjectPtr &other)
 Return whether two objects are equal.
 
virtual int32_t compareTo (const LuceneObjectPtr &other)
 Compare two objects.
 
virtual String toString ()
 Returns a string representation of the object.
 
- Public Member Functions inherited from Lucene::LuceneSync
virtual ~LuceneSync ()
 
virtual SynchronizePtr getSync ()
 Return this object synchronize lock.
 
virtual LuceneSignalPtr getSignal ()
 Return this object signal.
 
virtual void lock (int32_t timeout=0)
 Lock this object using an optional timeout.
 
virtual void unlock ()
 Unlock this object.
 
virtual bool holdsLock ()
 Returns true if this object is currently locked by current thread.
 
virtual void wait (int32_t timeout=0)
 Wait for signal using an optional timeout.
 
virtual void notifyAll ()
 Notify all threads waiting for signal.
 

Static Public Member Functions

static String _getClassName ()
 
static int32_t pop (int64_t x)
 Returns the number of bits set in the long.
 
static int64_t pop_array (const int64_t *A, int32_t wordOffset, int32_t numWords)
 Returns the number of set bits in an array of longs.
 
static int64_t pop_intersect (const int64_t *A, const int64_t *B, int32_t wordOffset, int32_t numWords)
 Returns the popcount or cardinality of the two sets after an intersection. Neither array is modified.
 
static int64_t pop_union (const int64_t *A, const int64_t *B, int32_t wordOffset, int32_t numWords)
 Returns the popcount or cardinality of the union of two sets. Neither array is modified.
 
static int64_t pop_andnot (const int64_t *A, const int64_t *B, int32_t wordOffset, int32_t numWords)
 Returns the popcount or cardinality of A & ~B. Neither array is modified.
 
static int64_t pop_xor (const int64_t *A, const int64_t *B, int32_t wordOffset, int32_t numWords)
 Returns the popcount or cardinality of A ^ B. Neither array is modified.
 
static int32_t ntz (int64_t val)
 Returns number of trailing zeros in a 64 bit long value.
 
static int32_t ntz (int32_t val)
 Returns number of trailing zeros in a 32 bit int value.
 
static int32_t ntz2 (int64_t x)
 Returns 0 based index of first set bit (only works for x!=0) This is an alternate implementation of ntz()
 
static int32_t ntz3 (int64_t x)
 Returns 0 based index of first set bit. This is an alternate implementation of ntz()
 
static bool isPowerOfTwo (int32_t v)
 Returns true if v is a power of two or zero.
 
static bool isPowerOfTwo (int64_t v)
 Returns true if v is a power of two or zero.
 
static int32_t nextHighestPowerOfTwo (int32_t v)
 Returns the next highest power of two, or the current value if it's already a power of two or zero.
 
static int64_t nextHighestPowerOfTwo (int64_t v)
 Returns the next highest power of two, or the current value if it's already a power of two or zero.
 

Static Public Attributes

static const uint8_t ntzTable []
 Table of number of trailing zeros in a byte.
 

Static Protected Member Functions

static void CSA (int64_t &h, int64_t &l, int64_t a, int64_t b, int64_t c)
 

Additional Inherited Members

- Protected Member Functions inherited from Lucene::LuceneObject
 LuceneObject ()
 
- Protected Attributes inherited from Lucene::LuceneSync
SynchronizePtr objectLock
 
LuceneSignalPtr objectSignal
 

Detailed Description

A variety of high efficiency bit twiddling routines.

Constructor & Destructor Documentation

◆ ~BitUtil()

virtual Lucene::BitUtil::~BitUtil ( )
virtual

Member Function Documentation

◆ _getClassName()

static String Lucene::BitUtil::_getClassName ( )
inlinestatic

◆ CSA()

static void Lucene::BitUtil::CSA ( int64_t &  h,
int64_t &  l,
int64_t  a,
int64_t  b,
int64_t  c 
)
inlinestaticprotected

◆ getClassName()

virtual String Lucene::BitUtil::getClassName ( )
inlinevirtual

◆ isPowerOfTwo() [1/2]

static bool Lucene::BitUtil::isPowerOfTwo ( int32_t  v)
static

Returns true if v is a power of two or zero.

◆ isPowerOfTwo() [2/2]

static bool Lucene::BitUtil::isPowerOfTwo ( int64_t  v)
static

Returns true if v is a power of two or zero.

◆ nextHighestPowerOfTwo() [1/2]

static int32_t Lucene::BitUtil::nextHighestPowerOfTwo ( int32_t  v)
static

Returns the next highest power of two, or the current value if it's already a power of two or zero.

◆ nextHighestPowerOfTwo() [2/2]

static int64_t Lucene::BitUtil::nextHighestPowerOfTwo ( int64_t  v)
static

Returns the next highest power of two, or the current value if it's already a power of two or zero.

◆ ntz() [1/2]

static int32_t Lucene::BitUtil::ntz ( int32_t  val)
static

Returns number of trailing zeros in a 32 bit int value.

◆ ntz() [2/2]

static int32_t Lucene::BitUtil::ntz ( int64_t  val)
static

Returns number of trailing zeros in a 64 bit long value.

◆ ntz2()

static int32_t Lucene::BitUtil::ntz2 ( int64_t  x)
static

Returns 0 based index of first set bit (only works for x!=0) This is an alternate implementation of ntz()

◆ ntz3()

static int32_t Lucene::BitUtil::ntz3 ( int64_t  x)
static

Returns 0 based index of first set bit. This is an alternate implementation of ntz()

◆ pop()

static int32_t Lucene::BitUtil::pop ( int64_t  x)
static

Returns the number of bits set in the long.

◆ pop_andnot()

static int64_t Lucene::BitUtil::pop_andnot ( const int64_t *  A,
const int64_t *  B,
int32_t  wordOffset,
int32_t  numWords 
)
static

Returns the popcount or cardinality of A & ~B. Neither array is modified.

◆ pop_array()

static int64_t Lucene::BitUtil::pop_array ( const int64_t *  A,
int32_t  wordOffset,
int32_t  numWords 
)
static

Returns the number of set bits in an array of longs.

◆ pop_intersect()

static int64_t Lucene::BitUtil::pop_intersect ( const int64_t *  A,
const int64_t *  B,
int32_t  wordOffset,
int32_t  numWords 
)
static

Returns the popcount or cardinality of the two sets after an intersection. Neither array is modified.

◆ pop_union()

static int64_t Lucene::BitUtil::pop_union ( const int64_t *  A,
const int64_t *  B,
int32_t  wordOffset,
int32_t  numWords 
)
static

Returns the popcount or cardinality of the union of two sets. Neither array is modified.

◆ pop_xor()

static int64_t Lucene::BitUtil::pop_xor ( const int64_t *  A,
const int64_t *  B,
int32_t  wordOffset,
int32_t  numWords 
)
static

Returns the popcount or cardinality of A ^ B. Neither array is modified.

◆ shared_from_this()

boost::shared_ptr< BitUtil > Lucene::BitUtil::shared_from_this ( )
inline

Field Documentation

◆ ntzTable

const uint8_t Lucene::BitUtil::ntzTable[]
static

Table of number of trailing zeros in a byte.


The documentation for this class was generated from the following file:

clucene.sourceforge.net