Skip to contents

Computes V %*% (Z / d), mapping coordinates in the rank-k SVD subspace back to the original column space. Routes through a GPU backend when the factor was computed in "fast" precision and a device copy of V is available.

Usage

svd_reconstruct(factor, Z)

Arguments

factor

An amSVD object from svd_factor.

Z

Numeric matrix or vector with nrow(Z) equal to factor@k.

Value

Numeric matrix of dimensions ncol(X) x ncol(Z), where X is the original source matrix.

Examples

m <- matrix(rnorm(30), nrow = 6)
A <- adgeMatrix(m)
fac <- svd_factor(A, k = 2L)
coords <- svd_project(fac, m)
approx <- svd_reconstruct(fac, coords)