Learn R Programming

pbdDMAT (version 0.2-3)

Arithmetic: Arithmetic Operators

Description

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

Usage

x + y
  x - y
  -y
  x * y
  x / y
  x ^ y
  x %% y
  x %/% y

Arguments

x, y
numeric distributed matrices or numeric vectors

Value

  • Returns a distributed matrix.

Details

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

See Also

Arithmetic, LinAlg, MatMult

Examples

Run this code
# 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 <- (2*x) - x^(.5)
print(y)

finalize()

Run the code above in your browser using DataLab