wecopttool.block_diag_jax

block_diag_jax(*arrays)[source]

Creates a block diagonal matrix from provided arrays.

Given the inputs A, B, and C, the output will have these arrays arranged on the diagonal:

[[A, 0, 0],

[0, B, 0], [0, 0, C]]

Parameters:

arrays (ArrayLike) – Input arrays. Each array can be up to 2-D. A 1-D array or array-like sequence of length n is treated as a 2-D array with shape (1, n).

Returns:

Array with A, B, C, … on the diagonal. D has the same dtype as the first input array.

Return type:

block_diag_mat

Notes

Empty sequences (i.e., array-likes of zero size) will not be ignored. Noteworthy, both [] and [[]] are treated as matrices with shape (1, 0).