pbdDMAT (version 0.5-0)

ddmatrix-svd: Singular Value Decomposition

Description

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

Usage

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

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

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

# S4 method for 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.

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.

Details

Extensions of R linear algebra functions.

Examples

Run this code
# NOT RUN {
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)

# }

Run the code above in your browser using DataCamp Workspace