Learn R Programming

pbdDMAT (version 0.4-2)

chol2inv: Inverse from Choleski (or QR) Decomposition

Description

qr() takes the QR decomposition.

Usage

# S4 method for ddmatrix
chol2inv(x, size = NCOL(x))

Arguments

x

numeric distributed matrices for

size

number of columns of x containing the Choleski factorization.

Value

A numeric distributed matrix.

Methods

list("signature(x = \"ddmatrix\")")

list("signature(x = \"ANY\")")

Details

The function returns the inverse of a choleski factored matrix, or the inverse of crossprod(x) if qr.R(qr(x)) is passed.

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
# Save code in a file "demo.r" and run with 2 processors by
# > mpiexec -np 2 Rscript demo.r

library(pbdDMAT, quiet = TRUE)
init.grid()

comm.set.seed(diff=T)
x <- ddmatrix("rnorm", 3, 3, bldim=2)

R <- qr.R(qr(x))
xtx.inv <- chol2inv(R)

id <- as.matrix(xtx.inv %*% crossprod(x))

comm.print(id)

finalize()
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab