#include <BitVec.h>
Inheritance diagram for BitVec:
Public Member Functions | |
BitVec (const int len) | |
Constructor BitVec creates a bit vector of length "len" as an of BitVecType. | |
BitVec const & | operator= (BitVec const &other) |
Overload the various operators for BitVec. | |
void | SwapBit (const int loc1, const int loc2) |
swaps the bits at locations "loc1" and "loc2". | |
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. |
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.
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.
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.