Learn R Programming

pbdDMAT (version 0.2-3)

Binders: Row and Column binds for Distributed Matrices

Description

Row and column binds.

Usage

## S3 method for class '...':
rbind(..., ICTXT = .ICTXT, deparse.level = 1)
## S3 method for class '...':
cbind(..., ICTXT = .ICTXT, deparse.level = 1)

Arguments

...
vectors, matrices, or distributed matrices.
ICTXT
BLACS communicator number for return object.
deparse.level
integer controlling the construction of labels in the case of non-matrix-like arguments. Does nothing for distributed matrices.

Value

  • Returns a vector, matrix, or distributed matrix, depending on input.

Details

The ... list of arguments can be vectors, matrices, or distributed matrices so long as non-distributed objects are not used with distributed objects. This kind of mixing-and-matching will lead to chaos. Currently no check is performed to prevent the user from this mixing-and-matching for performance reasons (it is slow enough already).

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:16, ncol=4)
dx <- as.ddmatrix(x) 

y <- rbind(dx, dx)

print(y)

finalize()

Run the code above in your browser using DataLab