Learn R Programming

pbdDMAT (version 0.2-3)

Print: Printing a Distributed Matrix

Description

Print method for a distributed matrices.

Usage

## S3 method for class 'ddmatrix':
print(x, ..., all = FALSE, name = "x")

Arguments

x
numeric distributed matrix
...
additional arguments
all
control for whether the entire distributed matrix should be printed to standard output
name
character string that will be printed to standard output along with the matrix elements

Value

  • The function silently returns 0.

Details

Print method for class ddmatrix. If argument all=TRUE, then a modified version of the ScaLAPACK TOOLS routine PDLAPRNT is used to print the entire distributed matrix. The matrix will be printed in column-major fashion, with one element of the matrix per line. If all=FALSE then the name= argument is ignored.

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) 

print(dx)

print(dx, all=T)

finalize()

Run the code above in your browser using DataLab