Get the diagonal of a distributed matrix, or construct a distributed matrix which is diagonal.
# S4 method for vector
diag(x, nrow, ncol, type = "matrix", ...,
bldim = .pbd_env$BLDIM, ICTXT = .pbd_env$ICTXT)# S4 method for character
diag(x, nrow, ncol, type = "matrix", ...,
min = 0, max = 1, mean = 0, sd = 1, rate = 1, shape,
scale = 1, bldim = .pbd_env$BLDIM, ICTXT = .pbd_env$ICTXT)
# S4 method for ddmatrix
diag(x)
# S4 method for matrix
diag(x, nrow, ncol)
distributed matrix or a vector.
in the case that x
is a vector, these specify the
global dimension of the diagonal distributed matrix to be created.
character. Options are 'matrix' or 'ddmatrix', with partial matching. This specifies the return type.
Extra arguments
blocking dimension.
BLACS context number.
Min and max values for random uniform generation.
Mean and standard deviation for random normal generation.
Rate for random exponential generation.
Shape and scale parameters for random weibull generation.
If a distributed matrix is passed to diag()
then it returns a
global R vector.
If a vector (numeric or character) is passed to diag()
and
type='ddmatrix'
, then the return is a diagonal distributed matrix.
Gets the diagonal of a distributed matrix and stores it as a global R vector owned by all processes.