Dynamic bitset class.
More...
|
|
None | __init__ () |
| | Initializes the BitSet instance.
|
| |
| None | __init__ (BitSet bs) |
| | Initializes a copy of the BitSet instance bs. More...
|
| |
| None | __init__ (int num_bits, int value=0) |
| | Initializes the BitSet instance. More...
|
| |
| None | __init__ (str bit_str) |
| | Initializes the BitSet instance. More...
|
| |
| int | getObjectID () |
| | Returns the numeric identifier (ID) of the wrapped C++ class instance. More...
|
| |
|
None | swap (BitSet bs) |
| |
| BitSet | assign (BitSet bs) |
| | Replaces the current state of self with a copy of the state of the BitSet instance bs. More...
|
| |
|
None | resize (int num_bits, bool value=False) |
| |
|
None | clear () |
| |
|
None | append (bool value) |
| |
|
BitSet | flip () |
| |
|
BitSet | flip (int idx) |
| |
|
BitSet | set () |
| |
|
BitSet | set (int idx, bool value=True) |
| |
|
BitSet | reset () |
| |
|
BitSet | reset (int idx) |
| |
|
bool | test (int idx) |
| |
|
int | findFirst () |
| |
|
int | findNext (int idx) |
| |
|
bool | isSubsetOf (BitSet bs) |
| |
|
bool | isProperSubsetOf (BitSet bs) |
| |
|
bool | isEmpty () |
| |
|
int | getCount () |
| |
|
int | getSize () |
| |
|
int | getMaxSize () |
| |
|
bool | hasAny () |
| |
|
bool | hasNone () |
| |
|
bool | __getitem__ (int idx) |
| |
|
None | __setitem__ (int idx, bool value) |
| |
|
BitSet | __and__ (BitSet bs) |
| |
|
BitSet | __or__ (BitSet bs) |
| |
|
BitSet | __xor__ (BitSet bs) |
| |
| BitSet | __sub__ (BitSet bs) |
| | Returns the result of the subtraction operation self - bs. More...
|
| |
|
BitSet | __iand__ (BitSet bs) |
| |
|
BitSet | __ior__ (BitSet bs) |
| |
|
BitSet | __ixor__ (BitSet bs) |
| |
| BitSet | __isub__ (BitSet bs) |
| | Performs the in-place subtraction operation self -= bs. More...
|
| |
|
int | __long__ () |
| |
|
BitSet | __ilshift__ (int num_bits) |
| |
|
BitSet | __lshift__ (int num_bits) |
| |
|
BitSet | __irshift__ (int num_bits) |
| |
|
BitSet | __rshift__ (int num_bits) |
| |
|
BitSet | __invert__ () |
| |
| bool | __eq__ (BitSet bs) |
| | Returns the result of the comparison operation self == bs. More...
|
| |
| bool | __ne__ (BitSet bs) |
| | Returns the result of the comparison operation self != bs. More...
|
| |
| bool | __lt__ (BitSet bs) |
| | Returns the result of the comparison operation self < bs. More...
|
| |
| bool | __le__ (BitSet bs) |
| | Returns the result of the comparison operation self <= bs. More...
|
| |
| bool | __gt__ (BitSet bs) |
| | Returns the result of the comparison operation self > bs. More...
|
| |
| bool | __ge__ (BitSet bs) |
| | Returns the result of the comparison operation self >= bs. More...
|
| |
|
int | __len__ () |
| |
|
bool | __nonzero__ () |
| |
|
bool | __bool__ () |
| |
| str | __str__ () |
| | Returns a string representation of the BitSet instance. More...
|
| |
|
|
int | npos = 18446744073709551615 |
| |
|
|
| objectID = property(getObjectID) |
| |
|
| empty = property(isEmpty) |
| |
|
| count = property(getCount) |
| |
|
| size = property(getSize) |
| |
|
| maxSize = property(getMaxSize) |
| |
|
| any = property(hasAny) |
| |
|
| none = property(hasNone) |
| |
Dynamic bitset class.
For further information see [BDBS].
◆ __init__() [1/3]
| None CDPL.Util.BitSet.__init__ |
( |
BitSet |
bs | ) |
|
Initializes a copy of the BitSet instance bs.
- Parameters
-
| bs | The BitSet instance to copy. |
◆ __init__() [2/3]
| None CDPL.Util.BitSet.__init__ |
( |
int |
num_bits, |
|
|
int |
value = 0 |
|
) |
| |
Initializes the BitSet instance.
- Parameters
-
◆ __init__() [3/3]
| None CDPL.Util.BitSet.__init__ |
( |
str |
bit_str | ) |
|
Initializes the BitSet instance.
- Parameters
-
◆ getObjectID()
| int CDPL.Util.BitSet.getObjectID |
( |
| ) |
|
Returns the numeric identifier (ID) of the wrapped C++ class instance.
Different Python BitSet instances may reference the same underlying C++ class instance. The commonly used Python expression a is not b thus cannot tell reliably whether the two BitSet instances a and b reference different C++ objects. The numeric identifier returned by this method allows to correctly implement such an identity test via the simple expression a.getObjectID() != b.getObjectID().
- Returns
- The numeric ID of the internally referenced C++ class instance.
◆ assign()
Replaces the current state of self with a copy of the state of the BitSet instance bs.
- Parameters
-
| bs | The BitSet instance to copy. |
- Returns
- self
◆ __sub__()
Returns the result of the subtraction operation self - bs.
- Parameters
-
| bs | Specifies the subtrahend. |
- Returns
- A
BitSet instance holding the result of the subtraction.
◆ __isub__()
Performs the in-place subtraction operation self -= bs.
- Parameters
-
| bs | Specifies the subtrahend. |
- Returns
- The updated
BitSet instance self.
◆ __eq__()
| bool CDPL.Util.BitSet.__eq__ |
( |
BitSet |
bs | ) |
|
Returns the result of the comparison operation self == bs.
- Parameters
-
| bs | The BitSet instance to be compared with. |
- Returns
- The result of the comparison operation.
◆ __ne__()
| bool CDPL.Util.BitSet.__ne__ |
( |
BitSet |
bs | ) |
|
Returns the result of the comparison operation self != bs.
- Parameters
-
| bs | The BitSet instance to be compared with. |
- Returns
- The result of the comparison operation.
◆ __lt__()
| bool CDPL.Util.BitSet.__lt__ |
( |
BitSet |
bs | ) |
|
Returns the result of the comparison operation self < bs.
- Parameters
-
| bs | The BitSet instance to be compared with. |
- Returns
- The result of the comparison operation.
◆ __le__()
| bool CDPL.Util.BitSet.__le__ |
( |
BitSet |
bs | ) |
|
Returns the result of the comparison operation self <= bs.
- Parameters
-
| bs | The BitSet instance to be compared with. |
- Returns
- The result of the comparison operation.
◆ __gt__()
| bool CDPL.Util.BitSet.__gt__ |
( |
BitSet |
bs | ) |
|
Returns the result of the comparison operation self > bs.
- Parameters
-
| bs | The BitSet instance to be compared with. |
- Returns
- The result of the comparison operation.
◆ __ge__()
| bool CDPL.Util.BitSet.__ge__ |
( |
BitSet |
bs | ) |
|
Returns the result of the comparison operation self >= bs.
- Parameters
-
| bs | The BitSet instance to be compared with. |
- Returns
- The result of the comparison operation.
◆ __str__()
| str CDPL.Util.BitSet.__str__ |
( |
| ) |
|
Returns a string representation of the BitSet instance.
- Returns
- The generated string representation.