| Trees | Indices | Help |
|
|---|
|
|
object --+
|
??.instance --+
|
SparseBitVect
A class to store sparse bit vectors.
This class is most useful for situations where the size of the vector
is large and relatively few bits are set
For smaller or denser vectors, the _ExplicitBitVect_ class is much faster.
As you would expect, _SparseBitVects_ 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) NOTE: this operation is likely
to be VERY slow and inefficient.
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]).
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from Inherited from |
|||
|
|||
__instance_size__ = 20
|
|||
__safe_for_unpickling__ = True
|
|||
|
|||
|
Inherited from |
|||
|
|||
Initializes the vector from a base64 string (the Daylight encoding).
C++ signature:
FromBase64(SparseBitVect {lvalue}, std::string) -> void*
|
Returns the value of a bit.
C++ signature:
GetBit(SparseBitVect {lvalue}, unsigned int) -> bool
|
Returns the number of bits in the vector (the vector's size).
C++ signature:
GetNumBits(SparseBitVect {lvalue}) -> unsigned int
|
Returns the number of off bits.
C++ signature:
GetNumOffBits(SparseBitVect {lvalue}) -> unsigned int
|
Returns the number of on bits.
C++ signature:
GetNumOnBits(SparseBitVect {lvalue}) -> unsigned int
|
Returns a tuple containing IDs of the on bits.
C++ signature:
GetOnBits(SparseBitVect) -> std::vector<int, std::allocator<int> >
|
Turns on a particular bit on. Returns the original state of the bit.
C++ signature:
SetBit(SparseBitVect {lvalue}, unsigned int) -> bool
|
Turns on a set of bits. The argument should be a tuple or list of bit ids.
C++ signature:
SetBitsFromList(SparseBitVect*, boost::python::api::object) -> void*
|
Converts the vector to a base64 string (the Daylight encoding).
C++ signature:
ToBase64(SparseBitVect {lvalue}) -> std::string
|
Returns a binary string representation of the vector.
C++ signature:
ToBinary(SparseBitVect {lvalue}) -> std::string
|
C++ signature:
BitVectToText(SparseBitVect) -> std::string
Returns a string of zeros and ones representing the bit vector.
C++ signature:
BitVectToText(ExplicitBitVect) -> std::string
|
Turns on a particular bit off. Returns the original state of the bit.
C++ signature:
UnSetBit(SparseBitVect {lvalue}, unsigned int) -> bool
|
C++ signature:
__and__(SparseBitVect {lvalue}, SparseBitVect) -> _object*
|
C++ signature: __getinitargs__(SparseBitVect) -> boost::python::tuple |
C++ signature: __getitem__(SparseBitVect, unsigned int) -> int |
C++ signature:
__init__(_object*, unsigned int) -> void*
C++ signature:
__init__(_object*, std::string) -> void*
|
C++ signature:
__invert__(SparseBitVect {lvalue}) -> _object*
|
C++ signature:
__len__(SparseBitVect {lvalue}) -> unsigned int
|
C++ signature:
__or__(SparseBitVect {lvalue}, SparseBitVect) -> _object*
|
helper for pickle
|
C++ signature:
__setitem__(SparseBitVect {lvalue}, unsigned int, int) -> int
|
C++ signature:
__xor__(SparseBitVect {lvalue}, SparseBitVect) -> _object*
|
| Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0beta1 on Sat May 24 08:37:06 2008 | http://epydoc.sourceforge.net |