A Restarted GMRES with deflation. This class implements a modification of the GMRES solver for sparse linear systems. The basis is built with modified Gram-Schmidt. At each restart, a few approximated eigenvectors corresponding to the smallest eigenvalues are used to build a preconditioner for the next cycle. This preconditioner for deflation can be combined with any other preconditioner, the IncompleteLUT for instance. The preconditioner is applied at right of the matrix and the combination is multiplicative. More...
#include <DGMRES.h>
Public Types | |
typedef Matrix< std::complex < RealScalar >, Dynamic, 1 > | ComplexVector |
typedef Matrix< Scalar, Dynamic, Dynamic > | DenseMatrix |
typedef Matrix< RealScalar, Dynamic, Dynamic > | DenseRealMatrix |
typedef Matrix< RealScalar, Dynamic, 1 > | DenseRealVector |
typedef Matrix< Scalar, Dynamic, 1 > | DenseVector |
typedef MatrixType::Index | Index |
typedef _MatrixType | MatrixType |
typedef _Preconditioner | Preconditioner |
typedef MatrixType::RealScalar | RealScalar |
typedef MatrixType::Scalar | Scalar |
Public Member Functions | |
template<typename Rhs , typename Dest > | |
void | _solve (const Rhs &b, Dest &x) const |
template<typename Rhs , typename Dest > | |
void | _solveWithGuess (const Rhs &b, Dest &x) const |
int | deflSize () |
DGMRES () | |
DGMRES (const MatrixType &A) | |
int | restart () |
void | set_restart (const int restart) |
void | setEigenv (const int neig) |
void | setMaxEigenv (const int maxNeig) |
template<typename Rhs , typename Guess > | |
const internal::solve_retval_with_guess < DGMRES, Rhs, Guess > | solveWithGuess (const MatrixBase< Rhs > &b, const Guess &x0) const |
~DGMRES () | |
Protected Member Functions | |
template<typename Rhs , typename Dest > | |
void | dgmres (const MatrixType &mat, const Rhs &rhs, Dest &x, const Preconditioner &precond) const |
Perform several cycles of restarted GMRES with modified Gram Schmidt,. | |
template<typename RhsType , typename DestType > | |
int | dgmresApplyDeflation (const RhsType &In, DestType &Out) const |
int | dgmresComputeDeflationData (const MatrixType &mat, const Preconditioner &precond, const Index &it, Index &neig) const |
template<typename Dest > | |
int | dgmresCycle (const MatrixType &mat, const Preconditioner &precond, Dest &x, DenseVector &r0, RealScalar &beta, const RealScalar &normRhs, int &nbIts) const |
Perform one restart cycle of DGMRES. | |
void | dgmresInitDeflation (Index &rows) const |
ComplexVector | schurValues (const ComplexSchur< DenseMatrix > &schurofH) const |
ComplexVector | schurValues (const RealSchur< DenseMatrix > &schurofH) const |
Protected Attributes | |
bool | m_force |
DenseMatrix | m_H |
DenseMatrix | m_Hes |
bool | m_isDeflAllocated |
bool | m_isDeflInitialized |
RealScalar | m_lambdaN |
PartialPivLU< DenseMatrix > | m_luT |
int | m_maxNeig |
DenseMatrix | m_MU |
int | m_neig |
int | m_r |
Index | m_restart |
RealScalar | m_smv |
DenseMatrix | m_T |
DenseMatrix | m_U |
DenseMatrix | m_V |
Private Types | |
typedef IterativeSolverBase < DGMRES > | Base |
A Restarted GMRES with deflation. This class implements a modification of the GMRES solver for sparse linear systems. The basis is built with modified Gram-Schmidt. At each restart, a few approximated eigenvectors corresponding to the smallest eigenvalues are used to build a preconditioner for the next cycle. This preconditioner for deflation can be combined with any other preconditioner, the IncompleteLUT for instance. The preconditioner is applied at right of the matrix and the combination is multiplicative.
_MatrixType | the type of the sparse matrix A, can be a dense or a sparse matrix. |
_Preconditioner | the type of the preconditioner. Default is DiagonalPreconditioner Typical usage : SparseMatrix<double> A; VectorXd x, b; //Fill A and b ... DGMRES<SparseMatrix<double> > solver; solver.set_restart(30); // Set restarting value solver.setEigenv(1); // Set the number of eigenvalues to deflate solver.compute(A); x = solver.solve(b); |
References : [1] D. NUENTSA WAKAM and F. PACULL, Memory Efficient Hybrid Algebraic Solvers for Linear Systems Arising from Compressible Flows, Computers and Fluids, In Press, http://dx.doi.org/10.1016/j.compfluid.2012.03.023 [2] K. Burrage and J. Erhel, On the performance of various adaptive preconditioned GMRES strategies, 5(1998), 101-121. [3] J. Erhel, K. Burrage and B. Pohl, Restarted GMRES preconditioned by deflation,J. Computational and Applied Mathematics, 69(1996), 303-318.
typedef IterativeSolverBase<DGMRES> Eigen::DGMRES< _MatrixType, _Preconditioner >::Base [private] |
typedef Matrix<std::complex<RealScalar>, Dynamic, 1> Eigen::DGMRES< _MatrixType, _Preconditioner >::ComplexVector |
typedef Matrix<Scalar,Dynamic,Dynamic> Eigen::DGMRES< _MatrixType, _Preconditioner >::DenseMatrix |
typedef Matrix<RealScalar,Dynamic,Dynamic> Eigen::DGMRES< _MatrixType, _Preconditioner >::DenseRealMatrix |
typedef Matrix<RealScalar,Dynamic,1> Eigen::DGMRES< _MatrixType, _Preconditioner >::DenseRealVector |
typedef Matrix<Scalar,Dynamic,1> Eigen::DGMRES< _MatrixType, _Preconditioner >::DenseVector |
typedef MatrixType::Index Eigen::DGMRES< _MatrixType, _Preconditioner >::Index |
Reimplemented from Eigen::IterativeSolverBase< DGMRES< _MatrixType, _Preconditioner > >.
typedef _MatrixType Eigen::DGMRES< _MatrixType, _Preconditioner >::MatrixType |
Reimplemented from Eigen::IterativeSolverBase< DGMRES< _MatrixType, _Preconditioner > >.
typedef _Preconditioner Eigen::DGMRES< _MatrixType, _Preconditioner >::Preconditioner |
Reimplemented from Eigen::IterativeSolverBase< DGMRES< _MatrixType, _Preconditioner > >.
typedef MatrixType::RealScalar Eigen::DGMRES< _MatrixType, _Preconditioner >::RealScalar |
Reimplemented from Eigen::IterativeSolverBase< DGMRES< _MatrixType, _Preconditioner > >.
typedef MatrixType::Scalar Eigen::DGMRES< _MatrixType, _Preconditioner >::Scalar |
Reimplemented from Eigen::IterativeSolverBase< DGMRES< _MatrixType, _Preconditioner > >.
Eigen::DGMRES< _MatrixType, _Preconditioner >::DGMRES | ( | ) | [inline] |
Eigen::DGMRES< _MatrixType, _Preconditioner >::DGMRES | ( | const MatrixType & | A | ) | [inline] |
Initialize the solver with matrix A for further Ax=b
solving.
This constructor is a shortcut for the default constructor followed by a call to compute().
Eigen::DGMRES< _MatrixType, _Preconditioner >::~DGMRES | ( | ) | [inline] |
void Eigen::DGMRES< _MatrixType, _Preconditioner >::_solve | ( | const Rhs & | b, |
Dest & | x | ||
) | const [inline] |
void Eigen::DGMRES< _MatrixType, _Preconditioner >::_solveWithGuess | ( | const Rhs & | b, |
Dest & | x | ||
) | const [inline] |
int Eigen::DGMRES< _MatrixType, _Preconditioner >::deflSize | ( | ) | [inline] |
void Eigen::DGMRES< _MatrixType, _Preconditioner >::dgmres | ( | const MatrixType & | mat, |
const Rhs & | rhs, | ||
Dest & | x, | ||
const Preconditioner & | precond | ||
) | const [protected] |
int Eigen::DGMRES< _MatrixType, _Preconditioner >::dgmresApplyDeflation | ( | const RhsType & | In, |
DestType & | Out | ||
) | const [protected] |
int Eigen::DGMRES< _MatrixType, _Preconditioner >::dgmresComputeDeflationData | ( | const MatrixType & | mat, |
const Preconditioner & | precond, | ||
const Index & | it, | ||
Index & | neig | ||
) | const [protected] |
int Eigen::DGMRES< _MatrixType, _Preconditioner >::dgmresCycle | ( | const MatrixType & | mat, |
const Preconditioner & | precond, | ||
Dest & | x, | ||
DenseVector & | r0, | ||
RealScalar & | beta, | ||
const RealScalar & | normRhs, | ||
int & | nbIts | ||
) | const [protected] |
Perform one restart cycle of DGMRES.
mat | The coefficient matrix |
precond | The preconditioner |
x | the new approximated solution |
r0 | The initial residual vector |
beta | The norm of the residual computed so far |
normRhs | The norm of the right hand side vector |
nbIts | The number of iterations |
void Eigen::DGMRES< _MatrixType, _Preconditioner >::dgmresInitDeflation | ( | Index & | rows | ) | const [protected] |
int Eigen::DGMRES< _MatrixType, _Preconditioner >::restart | ( | ) | [inline] |
DGMRES< _MatrixType, _Preconditioner >::ComplexVector Eigen::DGMRES< _MatrixType, _Preconditioner >::schurValues | ( | const ComplexSchur< DenseMatrix > & | schurofH | ) | const [inline, protected] |
DGMRES< _MatrixType, _Preconditioner >::ComplexVector Eigen::DGMRES< _MatrixType, _Preconditioner >::schurValues | ( | const RealSchur< DenseMatrix > & | schurofH | ) | const [inline, protected] |
void Eigen::DGMRES< _MatrixType, _Preconditioner >::set_restart | ( | const int | restart | ) | [inline] |
void Eigen::DGMRES< _MatrixType, _Preconditioner >::setEigenv | ( | const int | neig | ) | [inline] |
void Eigen::DGMRES< _MatrixType, _Preconditioner >::setMaxEigenv | ( | const int | maxNeig | ) | [inline] |
const internal::solve_retval_with_guess<DGMRES, Rhs, Guess> Eigen::DGMRES< _MatrixType, _Preconditioner >::solveWithGuess | ( | const MatrixBase< Rhs > & | b, |
const Guess & | x0 | ||
) | const [inline] |
bool Eigen::DGMRES< _MatrixType, _Preconditioner >::m_force [mutable, protected] |
DenseMatrix Eigen::DGMRES< _MatrixType, _Preconditioner >::m_H [mutable, protected] |
DenseMatrix Eigen::DGMRES< _MatrixType, _Preconditioner >::m_Hes [mutable, protected] |
bool Eigen::DGMRES< _MatrixType, _Preconditioner >::m_isDeflAllocated [mutable, protected] |
bool Eigen::DGMRES< _MatrixType, _Preconditioner >::m_isDeflInitialized [mutable, protected] |
RealScalar Eigen::DGMRES< _MatrixType, _Preconditioner >::m_lambdaN [mutable, protected] |
PartialPivLU<DenseMatrix> Eigen::DGMRES< _MatrixType, _Preconditioner >::m_luT [mutable, protected] |
int Eigen::DGMRES< _MatrixType, _Preconditioner >::m_maxNeig [mutable, protected] |
DenseMatrix Eigen::DGMRES< _MatrixType, _Preconditioner >::m_MU [mutable, protected] |
int Eigen::DGMRES< _MatrixType, _Preconditioner >::m_neig [mutable, protected] |
int Eigen::DGMRES< _MatrixType, _Preconditioner >::m_r [mutable, protected] |
Index Eigen::DGMRES< _MatrixType, _Preconditioner >::m_restart [mutable, protected] |
RealScalar Eigen::DGMRES< _MatrixType, _Preconditioner >::m_smv [mutable, protected] |
DenseMatrix Eigen::DGMRES< _MatrixType, _Preconditioner >::m_T [mutable, protected] |
DenseMatrix Eigen::DGMRES< _MatrixType, _Preconditioner >::m_U [mutable, protected] |
DenseMatrix Eigen::DGMRES< _MatrixType, _Preconditioner >::m_V [mutable, protected] |