Learn R Programming

pbdDMAT (version 0.4-2)

math: Miscellaneous Mathematical Functions

Description

Binary operations for distributed matrix/distributed matrix and distributed matrix/vector operations.

Usage

# S4 method for ddmatrix
sqrt(x)

# S4 method for ddmatrix abs(x)

# S4 method for ddmatrix exp(x)

# S4 method for ddmatrix log(x, base = exp(1))

# S4 method for ddmatrix log2(x)

# S4 method for ddmatrix log10(x)

# S4 method for ddmatrix log1p(x)

# S4 method for ddmatrix sin(x)

# S4 method for ddmatrix cos(x)

# S4 method for ddmatrix tan(x)

# S4 method for ddmatrix asin(x)

# S4 method for ddmatrix acos(x)

# S4 method for ddmatrix atan(x)

# S4 method for ddmatrix sinh(x)

# S4 method for ddmatrix cosh(x)

# S4 method for ddmatrix tanh(x)

Arguments

x

numeric distributed matrix

base

a positive number: the base with respect to which logarithms are computed. Defaults to e='exp(1)'.

Value

Returns a distributed matrix.

Details

Performs the miscellaneous mathematical calculation on a distributed matrix.

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()

# don't do this in production code
x <- matrix(1:9, 3)
x <- as.ddmatrix(x)

y <- sqrt(abs(log(x/10)))
comm.print(y)

finalize()
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab