BitVector

class BitVector
class BitVector(other: stormpy.datastructures.BitVector)
class BitVector(length: SupportsInt | SupportsIndex)
class BitVector(length: SupportsInt | SupportsIndex, init: bool)
class BitVector(
length: SupportsInt | SupportsIndex,
set_entries: collections.abc.Sequence[SupportsInt | SupportsIndex],
)

Bases: pybind11_object

Compact bit vector with indexed access and iteration over the indices of set bits

clear(self: stormpy.datastructures.BitVector) → None

Clear all bits in the bitvector

complement(self: stormpy.datastructures.BitVector) → None

Complement the bitvector

empty(self: stormpy.datastructures.BitVector) → bool

Check if the bitvector is empty (no bits set)

fill(self: stormpy.datastructures.BitVector) → None

Fill all bits in the bitvector

full(self: stormpy.datastructures.BitVector) → bool

Check if the bitvector is full (all bits set)

get(
self: stormpy.datastructures.BitVector,
index: SupportsInt | SupportsIndex,
) → bool
get_as_int(
self: stormpy.datastructures.BitVector,
index: SupportsInt | SupportsIndex,
no_bits: SupportsInt | SupportsIndex,
) → int

Get as unsigned int

get_next_set_index(
self: stormpy.datastructures.BitVector,
starting_index: SupportsInt | SupportsIndex,
) → int

Get the index of the next set bit after the given starting index. If there is none, it returns the number of bits this vector holds in total.

get_next_unset_index(
self: stormpy.datastructures.BitVector,
starting_index: SupportsInt | SupportsIndex,
) → int

Get the index of the next unset bit after the given starting index. If there is none, it returns the number of bits this vector holds in total.

get_number_of_set_bits(self: stormpy.datastructures.BitVector) → int

Get the number of bits that are set to true in this bit vector

get_number_of_set_bits_before_index(
self: stormpy.datastructures.BitVector,
index: SupportsInt | SupportsIndex,
) → int

Get the number of bits that are set to true before the given index

has_unique_set_bit(self: stormpy.datastructures.BitVector) → bool

Check if the bitvector has a unique set bit

increment(self: stormpy.datastructures.BitVector) → None

Increment the bitvector as if it was a binary number

is_disjoint_from(
self: stormpy.datastructures.BitVector,
other: stormpy.datastructures.BitVector,
) → bool

Check if this bitvector is disjoint from another

is_subset_of(
self: stormpy.datastructures.BitVector,
other: stormpy.datastructures.BitVector,
) → bool

Check if this bitvector is a subset of another

static load_from_string(description: str) → stormpy.datastructures.BitVector
resize(
self: stormpy.datastructures.BitVector,
new_size: SupportsInt | SupportsIndex,
init: bool = False,
) → None

Resize the bitvector to the given new_size

set(
self: stormpy.datastructures.BitVector,
index: SupportsInt | SupportsIndex,
value: bool = True,
) → None

Set

size(self: stormpy.datastructures.BitVector) → int
store_as_string(self: stormpy.datastructures.BitVector) → str