Learn R Programming

pbdDMAT (version 0.2-3)

MatMult: Matrix Multiplication

Description

Multiplies two distributed matrices, if they are conformable.

Usage

x %*% y
## S3 method for class 'ddmatrix,ANY':
crossprod(x, y = NULL)
## S3 method for class 'ddmatrix,ANY':
tcrossprod(x, y = NULL)

Arguments

x, y
numeric distributed matrices

Value

  • Returns a distributed matrix.

Details

x and y must be conformable, on the same BLACS context, but they need not be blocked with the same blocking dimension. The return will default to the blocking dimension of x. If you need to use x and y with differing blocking dimensions and you want the return to have blocking different from that of x, then use the function base.rpdgemm(). The crossprod() and tcrossprod() functions behave exactly as their R counterparts.

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 <- x %*% x
print(y)

finalize()

Run the code above in your browser using DataLab