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.
class
MutableStridedBitArrayView2DMutable two-dimensional bit array view with stride information
See StridedBitArrayView1D and MutableStridedBitArrayView1D for more information.
Methods
- def broadcasted(self, dimension: int, size: int) -> MutableStridedBitArrayView2D
- Broadcast a dimension
- def expanded(self, dimension: int, size: tuple[int, int]) -> MutableStridedBitArrayView3D
- Expand a dimension
- def expanded(self, dimension: int, size: tuple[int, int, int]) -> MutableStridedBitArrayView4D
- Expand a dimension
- def flipped(self, dimension: int) -> MutableStridedBitArrayView2D
- Flip a dimension
- def transposed(self, a: int, b: int) -> MutableStridedBitArrayView2D
- Transpose two dimensions
Special methods
- def __buffer__(self, flags, /)
- Return a buffer object that exposes the underlying memory of the object.
- def __getitem__(self, slice: slice) -> MutableStridedBitArrayView2D
- Slice the view
- def __getitem__(self, i: int) -> MutableStridedBitArrayView1D
- Sub-view at given position
- def __getitem__(self, i: tuple[int, int]) -> bool
- Bit at given position
- def __getitem__(self, slice: tuple[slice, slice]) -> MutableStridedBitArrayView2D
- Slice the view
- def __init__(self, /) -> None
- Default constructor
- def __len__(self, /) -> int
- View size in the top-level dimension
- def __release_buffer__(self, buffer, /)
- Release the buffer object that exposes the underlying memory of the object.
- def __setitem__(self, i: tuple[int, int], value: bool) -> None
- Set a bit at given position
Properties
Method documentation
def corrade. containers. MutableStridedBitArrayView2D. broadcasted(self,
dimension: int,
size: int) -> MutableStridedBitArrayView2D
Broadcast a dimension
Exceptions | |
---|---|
IndexError | If dimension is not 0 or 1 |
def corrade. containers. MutableStridedBitArrayView2D. expanded(self,
dimension: int,
size: tuple[int, int]) -> MutableStridedBitArrayView3D
Expand a dimension
Exceptions | |
---|---|
IndexError | If dimension is not 0 or 1 |
ValueError | If product of size is not equal to size in
dimension |
def corrade. containers. MutableStridedBitArrayView2D. expanded(self,
dimension: int,
size: tuple[int, int, int]) -> MutableStridedBitArrayView4D
Expand a dimension
Exceptions | |
---|---|
IndexError | If dimension is not 0 or 1 |
ValueError | If product of size is not equal to size in
dimension |
def corrade. containers. MutableStridedBitArrayView2D. flipped(self,
dimension: int) -> MutableStridedBitArrayView2D
Flip a dimension
Exceptions | |
---|---|
IndexError | If dimension is not 0 or 1 |
def corrade. containers. MutableStridedBitArrayView2D. transposed(self,
a: int,
b: int) -> MutableStridedBitArrayView2D
Transpose two dimensions
Exceptions | |
---|---|
IndexError | If a or b is not 0 or 1 or if
they’re the same |