Learn R Programming

HiPLARM (version 0.1)

norm: Matrix Norms

Description

Computes a matrix norm of x, using MAGMA for GPUs or PLASMA for multi-core CPUs. The norm can be the one norm, the infinity norm, the Frobenius norm, or the maximum modulus among elements of a matrix, as determined by the value of type. Not all norms are supported by MAGMA or PLASMA and these are documented below.

Usage

"norm"(x, type, ...) "norm"(x, type, ...) "norm"(x, type, ...) "norm"(x, type, ...) "norm"(x, type, ...)

Arguments

x
a real matrix.
type
A character indicating the type of norm desired. All these norms are supported in the latest PLASMA library (v2.4.6 asof writing).

"O", "o" or "1"
specifies the one norm, (maximum absolute column sum); This is not supported in MAGMA currently.

"I" or "i"
specifies the infinity norm (maximum absolute row sum);

"F" or "f"
specifies the Frobenius norm (the Euclidean norm of x treated as if it were a vector); This is not supported in PLASMA versions < 2.4.6 or in MAGMA.

"M" or "m"
specifies the maximum modulus of all the elements in x. This is not supported in MAGMA for dgeMatrix, but is for symmetric matrices dpoMatrix and dsyMatrix.

The default is "O". Only the first character of type[1] is used.

...
further arguments passed to or from other methods.

Value

A numeric value of class "norm", representing the quantity chosen according to type.

Details

When or if the GPU is used magmablas_dlange for dgeMatrix is called or magmablas_dlansy is used for symmetric dsyMatrix or dpoMatrix. When the multi-core library PLASMA is used PLASMA_dlange and PLASMA_dlansy are used for the respective matrix types mentioned previously.

References

Martin Maechler, Douglas Bates (Matrix package)

Examples

Run this code
x <- Hilbert(9)
norm(x, "1")
norm(x, "I")
norm(x, "F")
norm(x, "M")

Run the code above in your browser using DataLab