| 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 |
|||
|
|||
FromBase64( (SparseBitVect)arg1, (str)arg2) -> None :
Initializes the vector from a base64 string (the Daylight encoding).
C++ signature :
void FromBase64(SparseBitVect {lvalue},std::string)
|
GetBit( (SparseBitVect)arg1, (int)arg2) -> bool :
Returns the value of a bit.
C++ signature :
bool GetBit(SparseBitVect {lvalue},unsigned int)
|
GetNumBits( (SparseBitVect)arg1) -> int :
Returns the number of bits in the vector (the vector's size).
C++ signature :
unsigned int GetNumBits(SparseBitVect {lvalue})
|
GetNumOffBits( (SparseBitVect)arg1) -> int :
Returns the number of off bits.
C++ signature :
unsigned int GetNumOffBits(SparseBitVect {lvalue})
|
GetNumOnBits( (SparseBitVect)arg1) -> int :
Returns the number of on bits.
C++ signature :
unsigned int GetNumOnBits(SparseBitVect {lvalue})
|
GetOnBits( (SparseBitVect)arg1) -> _vecti :
Returns a tuple containing IDs of the on bits.
C++ signature :
std::vector<int, std::allocator<int> > GetOnBits(SparseBitVect)
|
SetBit( (SparseBitVect)arg1, (int)arg2) -> bool :
Turns on a particular bit on. Returns the original state of the bit.
C++ signature :
bool SetBit(SparseBitVect {lvalue},unsigned int)
|
SetBitsFromList( (SparseBitVect)arg1, (AtomPairsParameters)arg2) -> None :
Turns on a set of bits. The argument should be a tuple or list of bit ids.
C++ signature :
void SetBitsFromList(SparseBitVect*,boost::python::api::object)
|
ToBase64( (SparseBitVect)arg1) -> str :
Converts the vector to a base64 string (the Daylight encoding).
C++ signature :
std::string ToBase64(SparseBitVect {lvalue})
|
ToBinary( (SparseBitVect)arg1) -> str :
Returns a binary string representation of the vector.
C++ signature :
std::string ToBinary(SparseBitVect {lvalue})
|
BitVectToText( (SparseBitVect)arg1) -> str :
C++ signature :
std::string BitVectToText(SparseBitVect)
BitVectToText( (ExplicitBitVect)arg1) -> str :
Returns a string of zeros and ones representing the bit vector.
C++ signature :
std::string BitVectToText(ExplicitBitVect)
|
UnSetBit( (SparseBitVect)arg1, (int)arg2) -> bool :
Turns on a particular bit off. Returns the original state of the bit.
C++ signature :
bool UnSetBit(SparseBitVect {lvalue},unsigned int)
|
__and__( (SparseBitVect)arg1, (SparseBitVect)arg2) -> object :
C++ signature :
_object* __and__(SparseBitVect {lvalue},SparseBitVect)
|
__eq__( (SparseBitVect)arg1, (SparseBitVect)arg2) -> object :
C++ signature :
_object* __eq__(SparseBitVect {lvalue},SparseBitVect)
|
__getinitargs__( (SparseBitVect)arg1) -> tuple :
C++ signature :
boost::python::tuple __getinitargs__(SparseBitVect)
|
__getitem__( (SparseBitVect)arg1, (int)arg2) -> int :
C++ signature :
int __getitem__(SparseBitVect,int)
|
__init__( (object)arg1, (int)arg2) -> None :
C++ signature :
void __init__(_object*,unsigned int)
__init__( (object)arg1, (str)arg2) -> None :
C++ signature :
void __init__(_object*,std::string)
|
__invert__( (SparseBitVect)arg1) -> object :
C++ signature :
_object* __invert__(SparseBitVect {lvalue})
|
__len__( (SparseBitVect)arg1) -> int :
C++ signature :
unsigned int __len__(SparseBitVect {lvalue})
|
__ne__( (SparseBitVect)arg1, (SparseBitVect)arg2) -> object :
C++ signature :
_object* __ne__(SparseBitVect {lvalue},SparseBitVect)
|
__or__( (SparseBitVect)arg1, (SparseBitVect)arg2) -> object :
C++ signature :
_object* __or__(SparseBitVect {lvalue},SparseBitVect)
|
helper for pickle
|
__setitem__( (SparseBitVect)arg1, (int)arg2, (int)arg3) -> int :
C++ signature :
int __setitem__(SparseBitVect {lvalue},int,int)
|
__xor__( (SparseBitVect)arg1, (SparseBitVect)arg2) -> object :
C++ signature :
_object* __xor__(SparseBitVect {lvalue},SparseBitVect)
|
| Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0beta1 on Tue Oct 7 06:26:50 2008 | http://epydoc.sourceforge.net |