matrix_diag Function

public pure function matrix_diag(A, B) result(R)

Constructs a block-diagonal matrix R from two general matrices A and B.

Arguments

Type IntentOptional Attributes Name
complex(kind=wp), intent(in), dimension(:, :) :: A

Left matrix [n×m]

complex(kind=wp), intent(in), dimension(:, :) :: B

Right matrix [p×q]

Return Value complex(kind=wp), dimension(size(A, 1) + size(B, 1), size(A, 2) + size(B, 2))

R = Diag(A,B)