direct_sum: Direct Sum of Matrices

View source: R/RcppExports.R

direct_sumR Documentation

Direct Sum of Matrices

Description

Computes the direct sum of all matrices passed in via the list.

Usage

direct_sum(x)

Arguments

x

A field<matrix> or list containing matrices

Details

Consider matrix A (M x N) and B (k x p). A direct sum is a diagonal matrix A (+) B with dimensions (m + k) x (n + p).

Value

Matrix containing the direct sum of all matrices in the list.

Author(s)

James Joseph Balamuta

Examples


x = list(matrix(0, nrow = 5, ncol = 3),
         matrix(1, nrow = 5, ncol = 3))
direct_sum(x)

x = list(matrix(rnorm(15), nrow = 5, ncol = 3),
         matrix(rnorm(30), nrow = 5, ncol = 6),
         matrix(rnorm(18), nrow = 2, ncol = 9))
direct_sum(x)

cIRT documentation built on March 18, 2022, 7:38 p.m.