Welcome to Python-flavored Magnum! Please note that, while already being rather stable, this functionality is still considered experimental and some APIs might get changed without preserving full backwards compatibility.

corrade.containers.MutableStridedBitArrayView1D class

Mutable one-dimensional bit array view with stride information

Equivalent to StridedBitArrayView1D, but implementing __setitem__() as well.

Methods

def broadcasted(self, dimension: int, size: int) -> MutableStridedBitArrayView1D
Broadcast a dimension
def expanded(self, dimension: int, size: typing.Tuple[int, int]) -> MutableStridedBitArrayView2D
Expand a dimension
def expanded(self, dimension: int, size: typing.Tuple[int, int, int]) -> MutableStridedBitArrayView3D
Expand a dimension
def expanded(self, dimension: int, size: typing.Tuple[int, int, int, int]) -> MutableStridedBitArrayView4D
Expand a dimension
def flipped(self, dimension: int) -> MutableStridedBitArrayView1D
Flip a dimension

Special methods

def __getitem__(self, slice: slice) -> MutableStridedBitArrayView1D
Slice the view
def __getitem__(self, i: int) -> bool
Bit at given position
def __init__(self, /) -> None
Default constructor
def __init__(self, view: MutableBitArrayView) -> None
Construct from a bit array view
def __len__(self, /) -> int
View size in the top-level dimension
def __setitem__(self, i: int, value: bool) -> None
Set a bit at given position

Properties

dimensions: int get
Dimension count
offset: int get
Bit offset
owner: object get
Memory owner object
size: typing.Tuple[int] get
View size in each dimension
stride: typing.Tuple[int] get
View stride in each dimension

Method documentation

def corrade.containers.MutableStridedBitArrayView1D.broadcasted(self, dimension: int, size: int) -> MutableStridedBitArrayView1D

Broadcast a dimension

Exceptions
IndexError If dimension is not 0

def corrade.containers.MutableStridedBitArrayView1D.expanded(self, dimension: int, size: typing.Tuple[int, int]) -> MutableStridedBitArrayView2D

Expand a dimension

Exceptions
IndexError If dimension is not 0
ValueError If product of size is not equal to size in dimension

def corrade.containers.MutableStridedBitArrayView1D.expanded(self, dimension: int, size: typing.Tuple[int, int, int]) -> MutableStridedBitArrayView3D

Expand a dimension

Exceptions
IndexError If dimension is not 0
ValueError If product of size is not equal to size in dimension

def corrade.containers.MutableStridedBitArrayView1D.expanded(self, dimension: int, size: typing.Tuple[int, int, int, int]) -> MutableStridedBitArrayView4D

Expand a dimension

Exceptions
IndexError If dimension is not 0
ValueError If product of size is not equal to size in dimension

def corrade.containers.MutableStridedBitArrayView1D.flipped(self, dimension: int) -> MutableStridedBitArrayView1D

Flip a dimension

Exceptions
IndexError If dimension is not 0