DataStructs.cDataStructs.ExplicitBitVect

Package DataStructs :: Module cDataStructs :: Class ExplicitBitVect |
[hide private]
[frames] | no frames]

# Class ExplicitBitVect

     object --+
              |
    ??.instance --+
                  |
                 ExplicitBitVect

    A class to store explicit bit vectors.

    This class is most useful for situations where the size of the vector
    is relatively small (tens of thousands or smaller).

    For larger vectors, use the _SparseBitVect_ class instead.

    As you would expect, _ExplicitBitVects_ support a set of binary operations
    so you can do things like:
      bv3 = bv1 & bv2  (bitwise and)
      bv3 = bv1 | bv2  (bitwise or)
      bv3 = bv1 ^ bv2  (bitwise xor)
      bv3 = ~bv1       (bitwise negation)

    Bits can be set and read using either the Set/UnsetBit() and GetBit() methods
    or by indexing (i.e. bv[i] = 1 or if bv[i]).

Instance Methods | [hide private]
FromBase64(...) Initializes the vector from a base64 string (the Daylight encoding). |
GetBit(...) Returns the value of a bit. |
GetNumBits(...) Returns the number of bits in the vector (the vector's size). |
GetNumOffBits(...) Returns the number of off bits. |
GetNumOnBits(...) Returns the number of on bits. |
GetOnBits(...) Returns a tuple containing IDs of the on bits. |
SetBit(...) Turns on a particular bit on. |
SetBitsFromList(...) Turns on a set of bits. |
ToBase64(...) Converts the vector to a base64 string (the Daylight encoding). |
ToBinary(...) Returns a binary string representation of the vector. |
ToBitString(...) C++ signature: BitVectToText(SparseBitVect) -> std::string Returns a string of zeros and ones representing the bit vector. | source code
UnSetBit(...) Turns on a particular bit off. |
__and__(...) C++ signature:... |
__getinitargs__(...) C++ signature:... |
__getitem__(...) C++ signature:... |
__init__(...) C++ signature:... |
__invert__(...) C++ signature:... |
__len__(...) C++ signature:... |
__or__(...) C++ signature:... |
__reduce__(...) helper for pickle |
__setitem__(...) C++ signature:... |
__xor__(...) C++ signature:... |
Inherited from `unreachable.instance`: `__new__` Inherited from `object`: `__delattr__`, `__getattribute__`, `__hash__`, `__reduce_ex__`, `__repr__`, `__setattr__`, `__str__`

Class Variables | [hide private]
| __instance_size__ = `24`
| __safe_for_unpickling__ = `True`

Properties | [hide private]
Inherited from `object`: `__class__`

Method Details | [hide private]

### FromBase64(...) |
    Initializes the vector from a base64 string (the Daylight encoding).

    C++ signature:
        FromBase64(ExplicitBitVect {lvalue}, std::string) -> void*

### GetBit(...) |
    Returns the value of a bit.

    C++ signature:
        GetBit(ExplicitBitVect {lvalue}, unsigned int) -> bool

### GetNumBits(...) |
    Returns the number of bits in the vector (the vector's size).

    C++ signature:
        GetNumBits(ExplicitBitVect {lvalue}) -> unsigned int

### GetNumOffBits(...) |
    Returns the number of off bits.

    C++ signature:
        GetNumOffBits(ExplicitBitVect {lvalue}) -> unsigned int

### GetNumOnBits(...) |
    Returns the number of on bits.

    C++ signature:
        GetNumOnBits(ExplicitBitVect {lvalue}) -> unsigned int

### GetOnBits(...) |
    Returns a tuple containing IDs of the on bits.

    C++ signature:
        GetOnBits(ExplicitBitVect) -> std::vector<int, std::allocator<int> >

### SetBit(...) |
    Turns on a particular bit on.  Returns the original state of the bit.

    C++ signature:
        SetBit(ExplicitBitVect {lvalue}, unsigned int) -> bool

### SetBitsFromList(...) |
    Turns on a set of bits.  The argument should be a tuple or list of bit ids.

    C++ signature:
        SetBitsFromList(ExplicitBitVect*, boost::python::api::object) -> void*

### ToBase64(...) |
    Converts the vector to a base64 string (the Daylight encoding).

    C++ signature:
        ToBase64(ExplicitBitVect {lvalue}) -> std::string

### ToBinary(...) |
    Returns a binary string representation of the vector.

    C++ signature:
        ToBinary(ExplicitBitVect {lvalue}) -> std::string

### ToBitString(...) | source code
    C++ signature:
        BitVectToText(SparseBitVect) -> std::string

    Returns a string of zeros and ones representing the bit vector.
    C++ signature:
        BitVectToText(ExplicitBitVect) -> std::string

### UnSetBit(...) |
    Turns on a particular bit off.  Returns the original state of the bit.

    C++ signature:
        UnSetBit(ExplicitBitVect {lvalue}, unsigned int) -> bool

### __and__(...) (And operator) |
    C++ signature:
    __and__(ExplicitBitVect {lvalue}, ExplicitBitVect) -> _object*

### __getinitargs__(...) |
    C++ signature:
    __getinitargs__(ExplicitBitVect) -> boost::python::tuple

### __getitem__(...) (Indexing operator) |
    C++ signature:
    __getitem__(ExplicitBitVect, unsigned int) -> int

### __init__(...) (Constructor) |
    C++ signature:
        __init__(_object*, unsigned int) -> void*
    C++ signature:
        __init__(_object*, std::string) -> void*
Overrides: object.__init__

### __invert__(...) |
    C++ signature:
    __invert__(ExplicitBitVect {lvalue}) -> _object*

### __len__(...) (Length operator) |
    C++ signature:
    __len__(ExplicitBitVect {lvalue}) -> unsigned int

### __or__(...) (Or operator) |
    C++ signature:
    __or__(ExplicitBitVect {lvalue}, ExplicitBitVect) -> _object*

### __reduce__(...) |
    helper for pickle
Overrides: object.__reduce__ (inherited documentation)

### __setitem__(...) (Index assignment operator) |
    C++ signature:
    __setitem__(ExplicitBitVect {lvalue}, unsigned int, int) -> int

### __xor__(...) |
    C++ signature:
    __xor__(ExplicitBitVect {lvalue}, ExplicitBitVect) -> _object*