compbio
|
A Restarted GMRES with deflation. More...
#include <DGMRES.h>
Public Types | |
typedef _MatrixType | MatrixType |
typedef MatrixType::Scalar | Scalar |
typedef MatrixType::Index | Index |
typedef MatrixType::StorageIndex | StorageIndex |
typedef MatrixType::RealScalar | RealScalar |
typedef _Preconditioner | Preconditioner |
typedef Matrix< Scalar, Dynamic, Dynamic > | DenseMatrix |
typedef Matrix< RealScalar, Dynamic, Dynamic > | DenseRealMatrix |
typedef Matrix< Scalar, Dynamic, 1 > | DenseVector |
typedef Matrix< RealScalar, Dynamic, 1 > | DenseRealVector |
typedef Matrix< std::complex< RealScalar >, Dynamic, 1 > | ComplexVector |
![]() | |
enum | |
typedef internal::traits< DGMRES< _MatrixType, _Preconditioner > >::MatrixType | MatrixType |
typedef internal::traits< DGMRES< _MatrixType, _Preconditioner > >::Preconditioner | Preconditioner |
typedef MatrixType::Scalar | Scalar |
typedef MatrixType::StorageIndex | StorageIndex |
typedef MatrixType::RealScalar | RealScalar |
Public Member Functions | |
DGMRES () | |
Default constructor. More... | |
template<typename MatrixDerived > | |
DGMRES (const EigenBase< MatrixDerived > &A) | |
Initialize the solver with matrix A for further Ax=b solving. More... | |
template<typename Rhs , typename Dest > | |
void | _solve_with_guess_impl (const Rhs &b, Dest &x) const |
template<typename Rhs , typename Dest > | |
void | _solve_impl (const Rhs &b, MatrixBase< Dest > &x) const |
int | restart () |
Get the restart value. | |
void | set_restart (const int restart) |
Set the restart value (default is 30) | |
void | setEigenv (const int neig) |
Set the number of eigenvalues to deflate at each restart. | |
int | deflSize () |
Get the size of the deflation subspace size. | |
void | setMaxEigenv (const int maxNeig) |
Set the maximum size of the deflation subspace. | |
![]() | |
IterativeSolverBase () | |
Default constructor. More... | |
IterativeSolverBase (const EigenBase< MatrixDerived > &A) | |
Initialize the solver with matrix A for further Ax=b solving. More... | |
DGMRES< _MatrixType, _Preconditioner > & | analyzePattern (const EigenBase< MatrixDerived > &A) |
Initializes the iterative solver for the sparsity pattern of the matrix A for further solving Ax=b problems. More... | |
DGMRES< _MatrixType, _Preconditioner > & | factorize (const EigenBase< MatrixDerived > &A) |
Initializes the iterative solver with the numerical values of the matrix A for further solving Ax=b problems. More... | |
DGMRES< _MatrixType, _Preconditioner > & | compute (const EigenBase< MatrixDerived > &A) |
Initializes the iterative solver with the matrix A for further solving Ax=b problems. More... | |
Index | rows () const |
Index | cols () const |
RealScalar | tolerance () const |
DGMRES< _MatrixType, _Preconditioner > & | setTolerance (const RealScalar &tolerance) |
Sets the tolerance threshold used by the stopping criteria. More... | |
Preconditioner & | preconditioner () |
const Preconditioner & | preconditioner () const |
Index | maxIterations () const |
DGMRES< _MatrixType, _Preconditioner > & | setMaxIterations (Index maxIters) |
Sets the max number of iterations. More... | |
Index | iterations () const |
RealScalar | error () const |
const SolveWithGuess< DGMRES< _MatrixType, _Preconditioner >, Rhs, Guess > | solveWithGuess (const MatrixBase< Rhs > &b, const Guess &x0) const |
ComputationInfo | info () const |
void | _solve_impl (const Rhs &b, SparseMatrixBase< DestDerived > &aDest) const |
![]() | |
SparseSolverBase () | |
Default constructor. | |
DGMRES< _MatrixType, _Preconditioner > & | derived () |
const DGMRES< _MatrixType, _Preconditioner > & | derived () const |
const Solve< DGMRES< _MatrixType, _Preconditioner >, Rhs > | solve (const MatrixBase< Rhs > &b) const |
const Solve< DGMRES< _MatrixType, _Preconditioner >, Rhs > | solve (const SparseMatrixBase< Rhs > &b) const |
void | _solve_impl (const SparseMatrixBase< Rhs > &b, SparseMatrixBase< Dest > &dest) const |
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,. More... | |
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. More... | |
int | dgmresComputeDeflationData (const MatrixType &mat, const Preconditioner &precond, const Index &it, StorageIndex &neig) const |
template<typename RhsType , typename DestType > | |
int | dgmresApplyDeflation (const RhsType &In, DestType &Out) const |
ComplexVector | schurValues (const ComplexSchur< DenseMatrix > &schurofH) const |
ComplexVector | schurValues (const RealSchur< DenseMatrix > &schurofH) const |
void | dgmresInitDeflation (Index &rows) const |
![]() | |
void | init () |
const ActualMatrixType & | matrix () const |
void | grab (const InputType &A) |
Protected Attributes | |
DenseMatrix | m_V |
DenseMatrix | m_H |
DenseMatrix | m_Hes |
Index | m_restart |
DenseMatrix | m_U |
DenseMatrix | m_MU |
DenseMatrix | m_T |
PartialPivLU< DenseMatrix > | m_luT |
StorageIndex | m_neig |
int | m_r |
int | m_maxNeig |
RealScalar | m_lambdaN |
bool | m_isDeflAllocated |
bool | m_isDeflInitialized |
RealScalar | m_smv |
bool | m_force |
![]() | |
MatrixWrapper | m_matrixWrapper |
Preconditioner | m_preconditioner |
Index | m_maxIterations |
RealScalar | m_tolerance |
RealScalar | m_error |
Index | m_iterations |
ComputationInfo | m_info |
bool | m_analysisIsOk |
bool | m_factorizationIsOk |
![]() | |
bool | m_isInitialized |
Additional Inherited Members | |
![]() | |
typedef SparseSolverBase< DGMRES< _MatrixType, _Preconditioner > > | Base |
typedef internal::generic_matrix_wrapper< MatrixType > | MatrixWrapper |
typedef MatrixWrapper::ActualMatrixType | ActualMatrixType |
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); |
DGMRES can also be used in a matrix-free context, see the following example .
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.
|
inline |
Default constructor.
|
inlineexplicit |
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().
|
protected |
Perform several cycles of restarted GMRES with modified Gram Schmidt,.
A right preconditioner is used combined with deflation.
|
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 |