Spectra 1.2.0
Header-only C++ Library for Large Scale Eigenvalue Problems
|
#include <Spectra/SymGEigsShiftSolver.h>
Public Member Functions | |
SymGEigsShiftSolver (OpType &op, BOpType &Bop, Index nev, Index ncv, const Scalar &sigma) | |
Public Member Functions inherited from Spectra::HermEigsBase< SymGEigsBucklingOp< OpType, BOpType >, BOpType > | |
void | init (const Scalar *init_resid) |
Index | compute (SortRule selection=SortRule::LargestMagn, Index maxit=1000, RealScalar tol=1e-10, SortRule sorting=SortRule::LargestAlge) |
CompInfo | info () const |
Index | num_iterations () const |
Index | num_operations () const |
RealVector | eigenvalues () const |
virtual Matrix | eigenvectors (Index nvec) const |
This class implements the generalized eigen solver for real symmetric matrices in the buckling mode. The original problem is to solve Kx=\lambda K_G x, where K is positive definite and K_G is symmetric. The transformed problem is (K-\sigma K_G)^{-1}Kx=\nu x, where \nu=\lambda/(\lambda-\sigma), and \sigma is a user-specified shift.
This solver requires two matrix operation objects: one to compute y=(K-\sigma K_G)^{-1}x for any vector v, and one for the matrix multiplication Kv.
If K and K_G are stored as Eigen matrices, then the first operation object can be created using the SymShiftInvert class, and the second one can be created using the DenseSymMatProd or SparseSymMatProd classes. If the users need to define their own operation classes, then they should implement all the public member functions as in those built-in classes.
OpType | The type of the first operation object. Users could either use the wrapper class SymShiftInvert, or define their own that implements the type definition Scalar and all the public member functions as in SymShiftInvert. |
BOpType | The name of the matrix operation class for K. Users could either use the wrapper classes such as DenseSymMatProd and SparseSymMatProd, or define their own that implements all the public member functions as in DenseSymMatProd. |
Mode | Mode of the generalized eigen solver. In this solver it is Spectra::GEigsMode::Buckling. |
Below is an example that demonstrates the usage of this class.
Definition at line 307 of file SymGEigsShiftSolver.h.
|
inline |
Constructor to create a solver object.
op | The matrix operation object that computes y=(K-\sigma K_G)^{-1}v for any vector v. Users could either create the object from the wrapper class SymShiftInvert, or define their own that implements all the public members as in SymShiftInvert. |
Bop | The K matrix operation object that implements the matrix-vector multiplication Kv. Users could either create the object from the wrapper classes such as DenseSymMatProd and SparseSymMatProd, or define their own that implements all the public member functions as in DenseSymMatProd. K needs to be positive definite. |
nev | Number of eigenvalues requested. This should satisfy 1\le nev \le n-1, 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 < ncv \le n, and is advised to take ncv \ge 2\cdot nev. |
sigma | The value of the shift. |
Definition at line 363 of file SymGEigsShiftSolver.h.