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

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files

- Data Structures
- Class Hierarchy
- Data Fields

All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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< BitUtil > | shared_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. More...
virtual LuceneObjectPtr | clone (LuceneObjectPtr other=LuceneObjectPtr())
| Return clone of this object. More...
virtual int32_t | hashCode ()
| Return hash code for this object. More...
virtual bool | equals (LuceneObjectPtr other)
| Return whether two objects are equal. More...
virtual int32_t | compareTo (LuceneObjectPtr other)
| Compare two objects. More...
virtual String | toString ()
| Returns a string representation of the object. More...
Public Member Functions inherited from Lucene::LuceneSync
virtual | ~LuceneSync ()
virtual SynchronizePtr | getSync ()
| Return this object synchronize lock. More...
virtual LuceneSignalPtr | getSignal ()
| Return this object signal. More...
virtual void | lock (int32_t timeout=0)
| Lock this object using an optional timeout. More...
virtual void | unlock ()
| Unlock this object. More...
virtual bool | holdsLock ()
| Returns true if this object is currently locked by current thread. More...
virtual void | wait (int32_t timeout=0)
| Wait for signal using an optional timeout. More...
virtual void | notifyAll ()
| Notify all threads waiting for signal. More...

## Static Public Member Functions

static String | _getClassName ()
static int32_t | pop (int64_t x)
| Returns the number of bits set in the long. More...
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. More...
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. More...
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. More...
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. More...
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. More...
static int32_t | ntz (int64_t val)
| Returns number of trailing zeros in a 64 bit long value. More...
static int32_t | ntz (int32_t val)
| Returns number of trailing zeros in a 32 bit int value. More...
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() More...
static int32_t | ntz3 (int64_t x)
| Returns 0 based index of first set bit. This is an alternate implementation of ntz() More...
static bool | isPowerOfTwo (int32_t v)
| Returns true if v is a power of two or zero. More...
static bool | isPowerOfTwo (int64_t v)
| Returns true if v is a power of two or zero. More...
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. More...
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. More...

## Static Public Attributes

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

## 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

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

virtual

## Member Function Documentation

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

inline static

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

inline static protected

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

inline virtual

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

static

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

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

static

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

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.

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.

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

static

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

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

static

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

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()

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()

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

static

Returns the number of bits set in the long.

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.

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.

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.

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.

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.

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

inline

## Field Documentation

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:

- BitUtil.h

clucene.sourceforge.net