Learn R Programming

pbdDMAT (version 0.4-2)

ddmatrix-norm: Norm

Description

Computes the norm of a distributed matrix.

Usage

# S4 method for ddmatrix,ANY
norm(x, type = c("O", "I", "F", "M", "2"))

Arguments

x

numeric distributed matrices.

type

character. Determines which matrix norm is to be used.

Value

Returns a number.

Methods

list("signature(x = \"ddmatrix\")")

Examples

Run this code
# 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", 10, 10)

nrm <- norm(x)

comm.print(nrm)

finalize()
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab