ddmatrix-svd: Singular Value Decomposition

Description Usage Arguments Details Value Examples

Description

SVD for distributed matrices with R-like syntax, with calculations performed by the PBLAS and ScaLAPACK libraries.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## S4 method for signature 'ANY'
La.svd(x, nu = min(n, p), nv = min(n, p))

## S4 method for signature 'ddmatrix'
La.svd(x, nu = min(n, p), nv = min(n, p))

## S4 method for signature 'ANY'
svd(x, nu = min(n, p), nv = min(n, p), LINPACK = FALSE)

## S4 method for signature 'ddmatrix'
svd(x, nu = min(n, p), nv = min(n, p))

Arguments

x

numeric distributed matrices.

nu

number of left singular vectors to return when calculating singular values.

nv

number of right singular vectors to return when calculating singular values.

LINPACK

Ignored.

Details

Extensions of R linear algebra functions.

Value

La.svd() performs singular value decomposition, and returns the transpose of right singular vectors if any are requested. Singular values are stored as a global R vector. Left and right singular vectors are unique up to sign. Sometimes core R (via LAPACK) and ScaLAPACK will disagree as to what the left/right singular vectors are, but the disagreement is always only up to sign.

svd() performs singular value decomposition. Differs from La.svd() in that the right singular vectors, if requested, are returned non-transposed. Singular values are stored as a global R vector. Sometimes core R (via LAPACK) and ScaLAPACK will disagree as to what the left/right singular vectors are, but the disagreement is always only up to sign.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
spmd.code = "
  library(pbdDMAT, quiet = TRUE)
  init.grid()
  
  # don't do this in production code
  x <- matrix(1:9, 3)
  x <- as.ddmatrix(x)
  
  y <- svd(A)
  y
  
  finalize()
"

pbdMPI::execmpi(spmd.code = spmd.code, nranks = 2L)

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