FILTLAN  1.0a
Classes | Typedefs | Functions
Lanczos Algorithm for Eigenvalues / Eigenvectors of a Symmetric Matrix

Classes

struct  LanczosOptions
 An instance of this class, taken by LanczosEigenSolver(), is a collection of options for the Lanczos procedure to solve symmetric eigenvalue problems. More...
 
struct  LanczosInfo
 LanczosEigenSolver() returns an instance of this class which gives the information of the Lanczos procedure. More...
 

Typedefs

typedef Vector(* NEXT_VECTOR) (const Vector &)
 

Functions

LanczosInfo LanczosEigenSolver (Vector &eigVal, Matrix &eigVec, NEXT_VECTOR NextKrylovVector, mkIndex n, mkIndex neigWanted, const char eigPart[], LanczosOptions &opts)
 Lanczos eigensolver, the most general form. More...
 
LanczosInfo LanczosEigenSolver (Vector &eigVal, Matrix &eigVec, NEXT_VECTOR NextKrylovVector, mkIndex n, mkIndex neigWanted, const char eigPart[])
 The same as LanczosEigenSolver(), but with the default LanczosOptions.
 
LanczosInfo LanczosEigenSolver (Vector &eigVal, Matrix &eigVec, const SymmetricMatrix &A, mkIndex neigWanted, const char eigPart[], LanczosOptions &opts)
 The same as LanczosEigenSolver(), but with the NextKrylovVector() defined as A*v.
 
LanczosInfo LanczosEigenSolver (Vector &eigVal, Matrix &eigVec, const SymmetricMatrix &A, mkIndex neigWanted, const char eigPart[])
 The same as LanczosEigenSolver(), but with the NextKrylovVector() defined as A*v and with default LanczosOptions.
 
LanczosInfo LanczosEigenSolver (Vector &eigVal, Matrix &eigVec, const SparseMatrix &A, mkIndex neigWanted, const char eigPart[], LanczosOptions &opts)
 The same as LanczosEigenSolver(), but with the NextKrylovVector() defined as A*v.
 
LanczosInfo LanczosEigenSolver (Vector &eigVal, Matrix &eigVec, const SparseMatrix &A, mkIndex neigWanted, const char eigPart[])
 The same as LanczosEigenSolver(), but with the NextKrylovVector() defined as A*v and with default LanczosOptions.
 

Detailed Description

Typedef Documentation

◆ NEXT_VECTOR

typedef Vector(* NEXT_VECTOR) (const Vector &)

The definition of a function / operator with input a vector and output a vector. The operator should be self-adjoint if it is used for the Lanczos or conjugated gradient methods.

  • In a standard Lanczos or conjugate gradient procedure, the input is v and output is A*v.
  • In a filtered Lanczos or conjugate gradient procedure, the input is v and output is p(A)*v, with p a polynomial.

In both cases, A is a symmetric matrix. It can be dense or sparse.

Function Documentation

◆ LanczosEigenSolver()

LanczosInfo LanczosEigenSolver ( Vector &  eigVal,
Matrix &  eigVec,
NEXT_VECTOR  NextKrylovVector,
mkIndex  n,
mkIndex  neigWanted,
const char  eigPart[],
LanczosOptions opts 
)

Lanczos eigensolver, the most general form.

Parameters
NextKrylovVectoris the function which defines a self-adjoint operator, e.g. A*v with A a symmetric matrix.
nis the length of the input/output vectors of NextKrylovVector().
neigWantedis the number of eigenvalues to be sought.
eigPartis a string "LA", "SA", or "BE".
  • "LA" - largest algebraic, for largest eigenvalues;
  • "SA" - smallest algebraic, for smallest eigenvalues;
  • "BE" - both ends, one more from high end if nev is odd.
optsis a collection of Lanczos options.
eigValis the output vector of length neigWanted containing the computed eigenvalues.
eigVecis the output n-by-neigWanted matrix with columns as eigenvectors, in the order as elements in eigVal, if opts.wantEigVec==true.
Returns
An instance of LanczosInfo which gives the information of the Lanczos procedure.