Learn R Programming

pbdDMAT (version 0.2-3)

LinAlg: Linear Algebra Functions

Description

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

Usage

## S3 method for class 'ddmatrix':
isSymmetric(object, tol = 100 * .Machine$double.eps, ...) 
## S3 method for class 'ddmatrix':
t(x)
## S3 method for class 'ddmatrix,ddmatrix':
solve(a, b)
## S3 method for class 'ddmatrix,ANY':
solve(a)
## S3 method for class 'ddmatrix':
La.svd(x, nu, nv)
## S3 method for class 'ddmatrix':
svd(x, nu, nv)
## S3 method for class 'ddmatrix':
eigen(x, symmetric, only.values = FALSE)
## S3 method for class 'ddmatrix':
chol(x)
## S3 method for class 'ddmatrix':
lu(x)

Arguments

object, x, a, b
numeric distributed matrices. If applicable, a and b must be on the same BLACS context and have the same blocking dimension.
tol
precision tolerance.
...
additional arguments.
nu
number of left singular vectors to return when calculating singular values.
nv
number of right singular vectors to return when calculating singular values.
symmetric
logical, if TRUE then the matrix is assumed to be symmetric and only the lower triangle is used. Otherwise x is inspected for symmetry.
only.values
logical, if TRUE then only the eigenvalues are returned. Otherwise both eigenvalues and eigenvectors are returned.

Value

  • t() returns the transposed matrix. solve() solves systems and performs matrix inversion when argument b= is missing. 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. eigen() computes the eigenvalues, and eigenvectors if requested. As with svd(), eigenvalues are stored in a global R vector. chol() performs Cholesky factorization. lu() performs LU factorization.

Details

Extensions of R linear algebra functions.

See Also

Arithmetic, Reductions, MatMult, MiscMath

Examples

Run this code
# 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()

# don't do this in production code
x <- matrix(1:9, 3)
x <- as.ddmatrix(x)

y <- solve(t(A) %*% A)
print(y)

finalize()

Run the code above in your browser using DataLab