fm.eigen | R Documentation |
fm.eigen
computes eigenvalues/vectors of a square matrix.
fm.cal.residul
computes the residual of the eigenvalues.
fm.eigen(mul, k, n, which = "LM", sym = TRUE, options = NULL, env = parent.frame()) fm.cal.residul(mul, values, vectors)
mul |
The function to perform the matrix-vector multiplication. |
k |
Integer. The number of eigenvalues to compute. |
which |
String. Selection criteria. |
sym |
Logical scalar, whether the input matrix is symmetric. |
options |
List. Additional options to the eigensolver. |
env |
The environment in which |
values |
The eigenvalues |
vectors |
The eigenvectors The solver String. The name of the eigensolver to solve the eigenproblems. Currently, it supports three eigensolvers: KrylovSchur, Davidson and LOBPCG. KrylovSchur is the default eigensolver. tol Numeric scalar. Stopping criterion: the relative accuracy of
the Ritz value is considered acceptable if its error is less
than block_size Numeric scalar. The eigensolvers use a block extension of an eigensolver algorithm. The block size determines the number of the vectors that operate together. num_blocks Numeric scalar. The number of blocks to compute eigenpairs. |
fm.eigen
uses Anasazi package of Trilinos, if Anasazi is compiled
into FlashR, or eigs to compute eigenvalues.
The which
specify which eigenvalues/vectors to compute, character
constant with exactly two characters. Possible values for symmetric input
matrices:
"LA"Compute nev
largest (algebraic) eigenvalues.
"SA"Compute nev
smallest (algebraic) eigenvalues.
"LM"Compute nev
largest (in magnitude) eigenvalues.
"SM"Compute nev
smallest (in magnitude) eigenvalues.
fm.eigen
returns a named list with the following members:
values: Numeric vector, the desired eigenvalues.
vectors: Numeric matrix, the desired eigenvectors as columns.
fm.cal.residul
returns the corresponding residuals for
the eigenvalues.
Da Zheng <dzheng5@jhu.edu>
mat <- fm.load.sparse.matrix("./spm123.mat", "./spm123.mat_idx") res <- fm.eigen(mul, 10, nrow(mat)) fm.cal.residul(mul, res$values, res$vectors)