matrices.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:simupy 作者: sixpearls 项目源码 文件源码
def block_matrix(blocks):
    """
    Construct a matrix where the elements are specified by the block structure
    by joining the blocks appropriately.

    Parameters
    ----------
    blocks : two level deep iterable of sympy Matrix objects
        The block specification of the matrices used to construct the block
        matrix.

    Returns
    -------
    matrix : sympy Matrix
        A matrix whose elements are the elements of the blocks with the
        specified block structure.
    """
    return sp.Matrix.col_join(
        *tuple(
            sp.Matrix.row_join(
                *tuple(mat for mat in row)) for row in blocks
        )
    )
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号