Learn R Programming

HiPLARM (version 0.1)

chol: Cholesky Decomposition using GPU or multi-core CPU

Description

Compute the Cholesky factorization of a real symmetric positive-definite square matrix using GPU or multi-core CPU.

Usage

chol(x, ...) "chol"(x, pivot = FALSE, ...)

Arguments

x
if x is not positive definite, an error is signalled.
pivot
logical indicating if pivoting is used. This is not supported for the GPU implementation
...
potentially further arguments passed to methods.

Methods

chol
signature(x = "dgeMatrix"): works via "dpoMatrix"
chol
signature(x = "dpoMatrix"): Returns (and stores) the Cholesky decomposition of x, via LAPACK routines dlacpy and either magma_dpotrf or PLASMA_dpotrf.

Details

For further details on classes and methods see the full Matrix package documentation.

References

Martin Maechler, Douglas Bates (Matrix package)

Examples

Run this code
showMethods(chol, inherited = FALSE) # show different methods

sy2 <- new("dsyMatrix", Dim = as.integer(c(2,2)), x = c(14, NA,32,77))
(c2 <- chol(sy2))#-> "Cholesky" matrix
stopifnot(all.equal(c2, chol(as(sy2, "dpoMatrix")), tol= 1e-13))
str(c2)

## An example where chol() can't work
(sy3 <- new("dsyMatrix", Dim = as.integer(c(2,2)), x = c(14, -1, 2, -7)))
try(chol(sy3)) # error, since it is not positive definite

Run the code above in your browser using DataLab