bitvec.cpp File Reference

Fast and efficient bitstring class. More...

#include "bitvec.h"
#include "oberror.h"

Namespaces

namespace  OpenBabel

Defines

#define LowBit(set, bit)

Functions

OBBitVec operator| (OBBitVec &bv1, OBBitVec &bv2)
OBBitVec operator & (OBBitVec &bv1, OBBitVec &bv2)
OBBitVec operator^ (OBBitVec &bv1, OBBitVec &bv2)
bool operator== (const OBBitVec &bv1, const OBBitVec &bv2)
OBBitVec operator- (OBBitVec &bv1, OBBitVec &bv2)
istream & operator>> (istream &is, OBBitVec &bv)
ostream & operator<< (ostream &os, const OBBitVec &bv)
double Tanimoto (OBBitVec &, OBBitVec &)
 This function can change the size of second parameter. There is an alternative with different parameters.

Variables

OBMessageHandler obErrorLog
 Global OBMessageHandler error handler.
static int bitsoff [SETWORD]


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))) {set = m; bit -= 16;}\
      if ((m = (set & 0x00ff00ff))) {set = m; bit -= 8;}\
      if ((m = (set & 0x0f0f0f0f))) {set = m; bit -= 4;}\
      if ((m = (set & 0x33333333))) {set = m; bit -= 2;}\
      if ((m = (set & 0x55555555))) {set = m; bit -= 1;}}}\
   else bit = -1;}