Learn R Programming

HiPLARM (version 0.1)

rcond: Estimate the Reciprocal Condition Number using GPU and multi-core CPU

Description

Estimate the reciprocal of the condition number of a matrix using the MAGMA library for GPU or PLASMA library for multi-core CPUs.

Usage

"rcond"(x, norm, ...) "rcond"(x, norm, ...)

Arguments

x
an R object that inherits from the Matrix class.
norm
Character indicating the type of norm to be used in the estimate. The default is "O" for the 1-norm ("O" is equivalent to "1"). The other possible value is "I" for the infinity norm, see also norm.
...
further arguments passed to or from other methods.

Value

An estimate of the reciprocal condition number of x.

Details

Uses the LU decomposition using magma_dgetrf or PLASMA_dgetrf with the respective MAGMA or PLASMA norms if available (see norm documentation for more info).It also calls LAPACK dgecon as this is not supported in MAGMA/PLASMA. For further details on classes and methods see the Matrix package documentation.

References

Martin Maechler, Douglas Bates (Matrix package)

Examples

Run this code
x <- Matrix(rnorm(9), 3, 3)
rcond(x)
## typically "the same" (with more computational effort):
1 / (norm(x) * norm(solve(x)))
rcond(Hilbert(9))  # should be about 9.1e-13

## For non-square matrices:
rcond(x1 <- cbind(1,1:10))# 0.05278
rcond(x2 <- cbind(x1, 2:11))# practically 0, since x2 does not have full rank

Run the code above in your browser using DataLab