| ddmatrix-constructors {pbdDMAT} | R Documentation |
Methods for simple construction of distributed matrices.
ddmatrix(data, ...) ## S4 method for signature 'ddmatrix' ddmatrix(data, nrow = 1, ncol = 1, byrow = FALSE, ..., bldim = .pbd_env$BLDIM, ICTXT = .pbd_env$ICTXT) ## S4 method for signature 'missing' ddmatrix(data, nrow = 1, ncol = 1, byrow = FALSE, ..., bldim = .pbd_env$BLDIM, ICTXT = .pbd_env$ICTXT) ## S4 method for signature 'vector' ddmatrix(data, nrow = 1, ncol = 1, byrow = FALSE, ..., bldim = .pbd_env$BLDIM, ICTXT = .pbd_env$ICTXT) ## S4 method for signature 'matrix' ddmatrix(data, nrow = 1, ncol = 1, byrow = FALSE, ..., bldim = .pbd_env$BLDIM, ICTXT = .pbd_env$ICTXT) ## S4 method for signature 'character' ddmatrix(data, nrow = 1, ncol = 1, byrow = FALSE, ..., min = 0, max = 1, mean = 0, sd = 1, rate = 1, shape, scale = 1, bldim = .pbd_env$BLDIM, ICTXT = .pbd_env$ICTXT) ddmatrix.local(data, ...) ## S4 method for signature 'missing' ddmatrix.local(data, nrow = 1, ncol = 1, byrow = FALSE, ..., bldim = .pbd_env$BLDIM, ICTXT = .pbd_env$BLDIM) ## S4 method for signature 'vector' ddmatrix.local(data, nrow = 1, ncol = 1, byrow = FALSE, ..., bldim = .pbd_env$BLDIM, ICTXT = .pbd_env$ICTXT) ## S4 method for signature 'matrix' ddmatrix.local(data, nrow = 1, ncol = 1, byrow = FALSE, ..., bldim = .pbd_env$BLDIM, ICTXT = .pbd_env$ICTXT) ## S4 method for signature 'character' ddmatrix.local(data, nrow = 1, ncol = 1, byrow = FALSE, ..., min = 0, max = 1, mean = 0, sd = 1, rate = 1, shape, scale = 1, bldim = .pbd_env$BLDIM, ICTXT = .pbd_env$ICTXT)
data |
optional data vector. |
... |
Extra arguments |
nrow |
number of rows. Global rows for |
ncol |
number of columns. Global columns for |
byrow |
logical. If |
bldim |
blocking dimension. |
ICTXT |
BLACS context number. |
min, max |
Min and max values for random uniform generation. |
mean, sd |
Mean and standard deviation for random normal generation. |
rate |
Rate for random exponential generation. |
shape, scale |
Shape and scale parameters for random weibull generation. |
These methods are simplified methods of creating distributed matrices,
including random ones. These methods involve only local computations, i.e.,
no communication is performed in the construction of a ddmatrix using
these methods (in contrast to using as.ddmatrix() et al).
For non-character inputs, the methods attempt to mimic R as closely as
possible. So ddmatrix(1:3, 5, 7) produces the distributed analogue
of matrix(1:3, 5, 7).
For character inputs, you may also specify additional parametric family information.
The functions predicated with .local generate data with a fixed local
dimension, i.e., each processor gets an identical amount of data. Likewise,
the remaining functions generate a fixed global amount of data, and each
processor may or may not have an identical amount of local data.
To ensure good random number generation, you should only consider using the
character methods with the comm.set.seed() function from pbdMPI which
uses the method of L'Ecuyer via the rlecuyer package.
Returns a distributed matrix.
## 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() dx <- ddmatrix(data="rnorm", nrow=5, ncol=6, mean=10, sd=100, bldim=2) dx dy <- ddmatrix(data=1:4, nrow=7, ncol=5, bldim=2) dy finalize() ## End(Not run)