ARPACK-Eigen
|
#include <GenEigsSolver.h>
Public Member Functions | |
GenEigsSolver (OpType *op_, int nev_, int ncv_) | |
void | init (const Scalar *init_resid) |
void | init () |
int | compute (int maxit=1000, Scalar tol=1e-10) |
int | num_iterations () |
int | num_operations () |
ComplexVector | eigenvalues () |
ComplexMatrix | eigenvectors () |
This class implements the eigen solver for general real matrices.
Most of the background information documented in the SymEigsSolver class also applies to the GenEigsSolver class here, except that the eigenvalues and eigenvectors of a general matrix can now be complex-valued.
Scalar | The element type of the matrix. Currently supported types are float , double and long double . |
SelectionRule | An enumeration value indicating the selection rule of the requested eigenvalues, for example LARGEST_MAGN to retrieve eigenvalues with the largest magnitude. The full list of enumeration values can be found in SelectionRule.h . |
OpType | The name of the matrix operation class. Users could either use the DenseGenMatProd wrapper class, or define their own that impelemnts all the public member functions as in DenseGenMatProd. |
An example that illustrates the usage of GenEigsSolver is give below:
Definition at line 80 of file GenEigsSolver.h.
|
inline |
Constructor to create a solver object.
op_ | Pointer to the matrix operation object, which should implement the matrix-vector multiplication operation of \(A\): calculating \(Ay\) for any vector \(y\). Users could either create the object from the DenseGenMatProd wrapper class, or define their own that impelemnts all the public member functions as in DenseGenMatProd. |
nev_ | Number of eigenvalues requested. This should satisfy \(1\le nev \le n-2\), where \(n\) is the size of matrix. |
ncv_ | Parameter that controls the convergence speed of the algorithm. Typically a larger ncv_ means faster convergence, but it may also result in greater memory use and more matrix operations in each iteration. This parameter must satisfy \(nev+2 \le ncv \le n\), and is advised to take \(ncv \ge 2\cdot nev + 1\). |
Definition at line 358 of file GenEigsSolver.h.
|
inline |
Providing the initial residual vector for the algorithm.
init_resid | Pointer to the initial residual vector. |
ARPACK-Eigen (and also ARPACK) uses an iterative algorithm to find eigenvalues. This function allows the user to provide the initial residual vector.
Definition at line 383 of file GenEigsSolver.h.
|
inline |
Providing a random initial residual vector.
This overloaded function generates a random initial residual vector for the algorithm. Elements in the vector follow independent Uniform(-0.5, 0.5) distributions.
Definition at line 423 of file GenEigsSolver.h.
|
inline |
Conducting the major computation procedure.
maxit | Maximum number of iterations allowed in the algorithm. |
tol | Precision parameter for the calculated eigenvalues. |
Definition at line 438 of file GenEigsSolver.h.
|
inline |
Returning the number of iterations used in the computation.
Definition at line 465 of file GenEigsSolver.h.
|
inline |
Returning the number of matrix operations used in the computation.
Definition at line 470 of file GenEigsSolver.h.
|
inline |
Returning the converged eigenvalues.
Eigen::Vector<std::complex<Scalar>, ...>
, depending on the template parameter Scalar
defined. Definition at line 479 of file GenEigsSolver.h.
|
inline |
Returning the eigenvectors associated with the converged eigenvalues.
Eigen::Matrix<std::complex<Scalar>, ...>
, depending on the template parameter Scalar
defined. Definition at line 507 of file GenEigsSolver.h.