| chol2inv {pbdDMAT} | R Documentation |
qr() takes the QR decomposition.
## S4 method for signature 'ddmatrix' chol2inv(x, size = NCOL(x))
x |
numeric distributed matrices for |
size |
number of columns of |
The function returns the inverse of a choleski factored matrix, or the
inverse of crossprod(x) if qr.R(qr(x)) is passed.
A numeric distributed matrix.
## 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)