fm.eigen R Documentation

## Eigensolver

### Description

`fm.eigen` computes eigenvalues/vectors of a square matrix. `fm.cal.residul` computes the residual of the eigenvalues.

### Usage

```fm.eigen(mul, k, n, which = "LM", sym = TRUE, options = NULL,
env = parent.frame())

fm.cal.residul(mul, values, vectors)
```

### Arguments

 `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 `mul` will bevaluated. `values` The eigenvalues `vectors` The eigenvectors The `options` argument specifies what kind of computation to perform. It is a list with the following members, which correspond directly to Anasazi parameters: 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 `tol` times its estimated value. 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.

### Details

`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.

### Value

`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.

### Author(s)

Da Zheng <dzheng5@jhu.edu>

### Examples

```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)
```