AMROC Main     Blockstructured Adaptive Mesh Refinement in object-oriented C++


Main Page   Class Hierarchy   Compound List   File List  

BitVec Class Reference

Class BitVec defines a bit-vector as an array of BitVecType. More...

#include <BitVec.h>

Inheritance diagram for BitVec:

Inheritance graph
[legend]
List of all members.

Public Methods

 BitVec ()
 BitVec (const int len)
 Constructor BitVec creates a bit vector of length "len" as an of BitVecType. More...

 BitVec (BitVec const &other)
 ~BitVec ()
BitVec const & operator= (BitVec const &other)
 Overload the various operators for BitVec.

int operator== (BitVec const &other) const
int operator!= (BitVec const &other) const
int operator> (BitVec const &other) const
int operator< (BitVec const &other) const
int operator>= (BitVec const &other) const
int operator<= (BitVec const &other) const
int TestBit (const int loc) const
void SetBit (const int loc)
void UnsetBit (const int loc)
void ToggleBit (const int loc)
void SwapBit (const int loc1, const int loc2)
 swaps the bits at locations "loc1" and "loc2". More...

int IsolateBit (const int loc, const int num=1) const
 Isolates the bit at location "loc" of bit vector and returns it as the LSB of an int.

void ResetVec (void)
void SetVec (void)
int GetLength (void) const
int GetSlotWidth (void) const
int GetSlots (void) const

Detailed Description

Class BitVec defines a bit-vector as an array of BitVecType.

Necessary for space-filling curve. Bit are numbered from O; i.e. The MSB of BitVec[0] is bit 0 and the LSB of BitVec[Dim-1] is bit NBit-1 where NBit=Sizeof(BitVecType)*Dim. Operations on the bit vector include testing/setting and toggleing a set of bits corresponding to a digit and isolating the bits. This class has been modified to have a fix maxlen of the bitvector so that it does not need dynamic allocations.

Author:
Manish Parashar

Definition at line 36 of file BitVec.h.


Constructor & Destructor Documentation

BitVec::BitVec const int    len
 

Constructor BitVec creates a bit vector of length "len" as an of BitVecType.

The bit vector is initialized to 0.

Definition at line 19 of file BitVec.C.


Member Function Documentation

void BitVec::SwapBit const int    loc1,
const int    loc2
 

swaps the bits at locations "loc1" and "loc2".

Remember that the most significant bit is numbered 0.

Definition at line 276 of file BitVec.C.

References IsolateBit().

Referenced by sfcIndex::sfcSwapDigitWd().


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


Quickstart     Users Guide     Programmers Reference     Installation      Examples     Download



AMROC Main      Home      Contact
last update: 06/01/04