inv_woodbury: Inverse using woodburys matrix identity

View source: R/lin_alg_blockinv.R

inv_woodburyR Documentation

Inverse using woodburys matrix identity

Description

Computes the inverse of (A + U C V) provided that the inverse of A and C exists.

Usage

inv_woodbury(A, U, C, V = t(U), method = "ge", simplify = TRUE)

Arguments

A, U, C, V

Either a caracas matrix, or a dense or a sparse matrix.

method

One of the methods that can be supplied to inv().

simplify

Should temporary quantities be simplified?

Value

The inverse of (A + U C V)

Author(s)

Søren Højsgaard

Examples

if (has_sympy()) {

n <- 8
m <- 4
A <- diag_("a", n)
U <- round(10*(matrix(rnorm(n*m), nrow=n)))
U[U < 0] <- 0
U <- as_sym(U)
V <- t(U)
C <- diag_("c", m)

B <- A + U %*% C %*% V
B

Bi <- inv_woodbury(A, U, C)
}

r-cas/caracas documentation built on June 2, 2025, 11:33 a.m.