Skip to content

brahmap.base.BlockHorizontalLinearOperator

Bases: BlockLinearOperator

A block horizontal linear operator.

Each block must be a linear operator. The blocks must be specified as one list, e.g., [A, B, C].

Parameters:

Name Type Description Default
blocks List[LinearOperator]

description

required
**kwargs Any

description

{}
Source code in brahmap/base/blkop.py
class BlockHorizontalLinearOperator(BlockLinearOperator):
    """
    A block horizontal linear operator.

    Each block must be a linear operator.
    The blocks must be specified as one list, e.g., `[A, B, C]`.

    Parameters
    ----------
    blocks : List[LinearOperator]
        _description_
    **kwargs: Any
        _description_
    """

    def __init__(
        self,
        blocks: List[LinearOperator],
        **kwargs: Any,
    ):
        try:
            for block in blocks:
                __ = block.shape
        except (TypeError, AttributeError):
            raise ValueError("blocks should be a flattened list of operators")

        blocks = [[blk for blk in blocks]]

        super(BlockHorizontalLinearOperator, self).__init__(
            blocks=blocks, symmetric=False, **kwargs
        )