bitvec.cpp File Reference

Fast and efficient bitstring class. More...

#include <openbabel/babelconfig.h>
#include <openbabel/bitvec.h>
#include <openbabel/oberror.h>
#include <cstdlib>

Namespaces

namespace  OpenBabel

Defines

#define LowBit(set, bit)

Functions

OBBitVec operator| (const OBBitVec &bv1, const OBBitVec &bv2)
OBBitVec operator& (const OBBitVec &bv1, const OBBitVec &bv2)
OBBitVec operator^ (const OBBitVec &bv1, const OBBitVec &bv2)
OBBitVec operator- (const OBBitVec &bv1, const OBBitVec &bv2)
bool operator== (const OBBitVec &bv1, const OBBitVec &bv2)
bool operator< (const OBBitVec &bv1, const OBBitVec &bv2)
std::istream & operator>> (std::istream &is, OBBitVec &bv)
std::ostream & operator<< (std::ostream &os, const OBBitVec &bv)
double Tanimoto (const OBBitVec &bv1, const OBBitVec &bv2)

Variables

static int bitsoff [SETWORD]
const unsigned nibble_bit_count [0x10]

Detailed Description

Fast and efficient bitstring class.


Define Documentation

#define LowBit (   set,
  bit 
)
Value:
{register int m;                                              \
    if (set != 0)                                               \
      {                                                         \
        bit = 31;                                               \
        if (set != 0x80000000) {                                \
          if ((m = (set & 0x0000ffff))!=0) {set = m; bit -= 16;}   \
          if ((m = (set & 0x00ff00ff))!=0) {set = m; bit -= 8;}    \
          if ((m = (set & 0x0f0f0f0f))!=0) {set = m; bit -= 4;}    \
          if ((m = (set & 0x33333333))!=0) {set = m; bit -= 2;}    \
          if ((m = (set & 0x55555555))!=0) {set = m; bit -= 1;}}}  \
    else bit = -1;}

Referenced by OBBitVec::NextBit().

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines