smile.math.matrix

## Class Lanczos

• java.lang.Object
• smile.math.matrix.Lanczos

• ```public class Lanczos
extends java.lang.Object```
The Lanczos algorithm is a direct algorithm devised by Cornelius Lanczos that is an adaptation of power methods to find the most useful eigenvalues and eigenvectors of an nth order linear system with a limited number of operations, m, where m is much smaller than n.

Although computationally efficient in principle, the method as initially formulated was not useful, due to its numerical instability. In this implementation, we use partial reorthogonalization to make the method numerically stable.

• ### Constructor Summary

Constructors
Constructor and Description
`Lanczos()`
• ### Method Summary

All Methods
Modifier and Type Method and Description
`static Matrix.EVD` ```eigen(DMatrix A, int k)```
Find k largest approximate eigen pairs of a symmetric matrix by the Lanczos algorithm.
`static Matrix.EVD` ```eigen(DMatrix A, int k, double kappa, int maxIter)```
Find k largest approximate eigen pairs of a symmetric matrix by the Lanczos algorithm.
• ### Methods inherited from class java.lang.Object

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

• #### Lanczos

`public Lanczos()`
• ### Method Detail

• #### eigen

```public static Matrix.EVD eigen(DMatrix A,
int k)```
Find k largest approximate eigen pairs of a symmetric matrix by the Lanczos algorithm.
Parameters:
`A` - the matrix supporting matrix vector multiplication operation.
`k` - the number of eigenvalues we wish to compute for the input matrix. This number cannot exceed the size of A.
• #### eigen

```public static Matrix.EVD eigen(DMatrix A,
int k,
double kappa,
int maxIter)```
Find k largest approximate eigen pairs of a symmetric matrix by the Lanczos algorithm.
Parameters:
`A` - the matrix supporting matrix vector multiplication operation.
`k` - the number of eigenvalues we wish to compute for the input matrix. This number cannot exceed the size of A.
`kappa` - relative accuracy of ritz values acceptable as eigenvalues.
`maxIter` - Maximum number of iterations.