Computes a truncated SVD using a block Lanczos bidiagonalization. Each Krylov step issues one GPU GEMM per block rather than sequential GEMVs, significantly reducing kernel-launch overhead on accelerated backends.
Usage
block_lanczos(
A,
nv = 5L,
nu = nv,
block_size = NULL,
n_steps = NULL,
mode = "fast",
backend = NULL
)
block_svd(
A,
k,
block_size = NULL,
n_steps = NULL,
mode = "fast",
backend = NULL
)Arguments
- A
Numeric matrix,
adgeMatrix, oradgCMatrix. Plain matrices are coerced toadgeMatrixusingmodeandbackend.- nv
Number of right singular vectors to return.
- nu
Number of left singular vectors to return. Defaults to
nv.- block_size
Integer block width for the Krylov iteration. When
NULL(default), a size is chosen automatically based onnvandnu.- n_steps
Number of Krylov steps. When
NULL(default), chosen automatically.- mode
Execution mode passed to
adgeMatrix()when coercing plain matrices.- backend
Backend name passed to
adgeMatrix()when coercing plain matrices. Ignored whenAis already anaMatrix.- k
Number of singular values/vectors. Alias for
nv = nu = k.
Value
A named list with components:
- u
Numeric matrix
[m, nu]: left singular vectors.- d
Numeric vector of length
min(nu, nv): singular values in decreasing order.- v
Numeric matrix
[n, nv]: right singular vectors.- iter
Integer: number of Krylov steps performed.
- mprod
Integer: total matrix-vector products issued.
See also
rsvd, block_svd