Learn R Programming

pbdDMAT (version 0.4-2)

arithmetic: Arithmetic Operators

Description

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

Usage

# S4 method for ddmatrix,numeric
+(e1, e2)

# S4 method for numeric,ddmatrix +(e1, e2)

# S4 method for ddmatrix,ddmatrix +(e1, e2)

# S4 method for ddmatrix,numeric -(e1, e2)

# S4 method for numeric,ddmatrix -(e1, e2)

# S4 method for ddmatrix,ddmatrix -(e1, e2)

# S4 method for ddmatrix,missing -(e1, e2)

# S4 method for ddmatrix,numeric *(e1, e2)

# S4 method for numeric,ddmatrix *(e1, e2)

# S4 method for ddmatrix,ddmatrix *(e1, e2)

# S4 method for ddmatrix,numeric /(e1, e2)

# S4 method for numeric,ddmatrix /(e1, e2)

# S4 method for ddmatrix,ddmatrix /(e1, e2)

# S4 method for ddmatrix,numeric ^(e1, e2)

# S4 method for ddmatrix,ddmatrix ^(e1, e2)

# S4 method for ddmatrix,ddmatrix %%(e1, e2)

# S4 method for ddmatrix,numeric %%(e1, e2)

# S4 method for numeric,ddmatrix %%(e1, e2)

# S4 method for ddmatrix,ddmatrix %/%(e1, e2)

# S4 method for numeric,ddmatrix %/%(e1, e2)

# S4 method for ddmatrix,numeric %/%(e1, e2)

Arguments

e1, e2

numeric distributed matrices or numeric vectors

Value

Returns a distributed matrix.

Details

If e1 and e2 are distributed matrices, then they must be conformable, on the same BLACS context, and have the same blocking dimension.

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

x <- ddmatrix(1:9, 3, bldim=2)

y <- (2*x) - x^(.5)
print(y)

finalize()
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab