diag-constructors: Distributed Matrix Diagonals

Description Usage Arguments Details Value

Description

Get the diagonal of a distributed matrix, or construct a distributed matrix which is diagonal.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
## S4 method for signature 'vector'
diag(
  x,
  nrow,
  ncol,
  type = "matrix",
  ...,
  bldim = .pbd_env$BLDIM,
  ICTXT = .pbd_env$ICTXT
)

## S4 method for signature '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 signature 'ddmatrix'
diag(x)

## S4 method for signature 'matrix'
diag(x, nrow, ncol)

## S4 replacement method for signature 'ddmatrix,vector'
diag(x) <- value

Arguments

x

distributed matrix or a vector.

nrow, ncol

in the case that x is a vector, these specify the global dimension of the diagonal distributed matrix to be created.

type

character. Options are 'matrix' or 'ddmatrix', with partial matching. This specifies the return type.

...

Extra arguments

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.

value

Replacement value.

Details

Gets the diagonal of a distributed matrix and stores it as a global R vector owned by all processes.

Value

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.


RBigData/pbdDMAT documentation built on Oct. 29, 2021, 6:20 p.m.