inv_block: Inverse of block matrix

View source: R/lin_alg_blockinv.R

inv_blockR Documentation

Inverse of block matrix

Description

Inverse of block matrix

Usage

inv_block(x)

Arguments

x

A block matrix, either a caracas matrix, or a dense or a sparse matrix.

Value

The inverse in the same form as x.

Author(s)

Søren Højsgaard

Examples

if (has_sympy()) {
 I <- diag_(1, 3)
 M <- as_sym(matrix(c("a", "b", "c", "d"), nrow=2))
 IM <- kronecker(I, M)
 inv(IM)
 inv_block(IM)

 IM. <- subs(IM, c("a", "b", "c", "d"), c(2,1,2,2))
 inv_block(IM.)
}

r-cas/caracas documentation built on Feb. 28, 2025, 3:39 p.m.