ch.akuhn.matrix.eigenvalues

## Class FewEigenvalues

• ```public abstract class FewEigenvalues
extends Eigenvalues```
Finds a few eigenvalues of a matrix.

This class use ARPACK to find a few eigenvalues (λ) and corresponding eigenvectors (x) for the standard eigenvalue problem:

``` `Ax = λx`
```
where `A` is an `n` × `n` real symmetric matrix.

The only thing that must be supplied in order to use this class on your problem is to change the array dimensions appropriately, to specify which eigenvalues you want to compute and to supply a matrix-vector product

``` w ← Av
```
in the `callback(Vector)` method.

Please refer to the ARPACK guide for further information.

Example:

``` Matrix A = …square matrix…;
Eigenvalues eigen = Eigenvalues.of(A).largest(4);
eigen.run();
double[] l = eigen.values;
Vector[] x = eigen.vectors;
```
Author:
Adrian Kuhn (Java) based on `ddsimp.f` by Richard Lehoucq, Danny Sorensen, Chao Yang (Fortran)
"http://www.caam.rice.edu/software/ARPACK/UG"

• ### Fields inherited from class ch.akuhn.matrix.eigenvalues.Eigenvalues

`n, nev, value, vector`
• ### Constructor Summary

Constructors
Constructor and Description
`FewEigenvalues(int n)`
• ### Method Summary

All Methods
Modifier and Type Method and Description
`protected abstract Vector` `callback(Vector vector)`
`FewEigenvalues` `fromBothEnds(int nev0)`
Compute eigenvalues from both end of the spectrum.
`FewEigenvalues` `greatest(int nev0)`
Compute the largest eigenvalues in magnitude.
`FewEigenvalues` `largest(int nev0)`
Compute the largest algebraic eigenvalues.
`FewEigenvalues` `lowest(int nev0)`
Compute the smallest eigenvalues in magnitude.
`static FewEigenvalues` `of(Matrix matrix)`
`Eigenvalues` `run()`
Runs the eigenvalue decomposition, using an implicitly restarted Arnoldi process (IRAP).
`FewEigenvalues` `smallest(int nev0)`
Compute the smallest algebraic eigenvalues.
• ### Methods inherited from class ch.akuhn.matrix.eigenvalues.Eigenvalues

`getN`
• ### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`
• ### Constructor Detail

• #### FewEigenvalues

`public FewEigenvalues(int n)`
• ### Method Detail

• #### of

`public static FewEigenvalues of(Matrix matrix)`
• #### largest

`public FewEigenvalues largest(int nev0)`
Compute the largest algebraic eigenvalues.
Overrides:
`largest` in class `Eigenvalues`
Returns:
this
• #### smallest

`public FewEigenvalues smallest(int nev0)`
Compute the smallest algebraic eigenvalues.
• #### greatest

`public FewEigenvalues greatest(int nev0)`
Compute the largest eigenvalues in magnitude.
• #### lowest

`public FewEigenvalues lowest(int nev0)`
Compute the smallest eigenvalues in magnitude.
• #### fromBothEnds

`public FewEigenvalues fromBothEnds(int nev0)`
Compute eigenvalues from both end of the spectrum. When the `nev` is odd, compute one more from the high end than from the low end.
• #### run

`public Eigenvalues run()`
Runs the eigenvalue decomposition, using an implicitly restarted Arnoldi process (IRAP). Please refer to the ARPACK guide for more information.
Overrides:
`run` in class `Eigenvalues`
Returns:
this
• #### callback

`protected abstract Vector callback(Vector vector)`