Inverse from Choleski (or QR) Decomposition

Share:

Description

qr() takes the QR decomposition.

Usage

1
2
## S4 method for signature 'ddmatrix'
chol2inv(x, size = NCOL(x))

Arguments

x

numeric distributed matrices for

size

number of columns of x containing the Choleski factorization.

Details

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

Value

A numeric distributed matrix.

Methods

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## 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()

## End(Not run)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.