Cholesky Decomposition using GPU or multi-core CPU

Share:

Description

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

Usage

1
2
3
chol(x, ...)
## S4 method for signature 'dpoMatrix'
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.

Details

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

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.

References

Martin Maechler, Douglas Bates (Matrix package)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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

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