Eigen  5.0.1
 
Loading...
Searching...
No Matches
Eigen::DGMRES< MatrixType_, Preconditioner_ > Class Template Reference

#include <Eigen/src/IterativeLinearSolvers/DGMRES.h>

Detailed Description

template<typename MatrixType_, typename Preconditioner_>
class Eigen::DGMRES< MatrixType_, Preconditioner_ >

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.

Template Parameters
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 :
VectorXd x, b;
//Fill A and b ...
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()
Definition DGMRES.h:124
void set_restart(const Index restart)
Definition DGMRES.h:167
void setEigenv(const Index neig)
Definition DGMRES.h:172
Derived & compute(const EigenBase< MatrixDerived > &A)
Definition IterativeSolverBase.h:202
A versatile sparse matrix representation.
Definition SparseMatrix.h:122
Solve< Derived, Rhs > solve(const MatrixBase< Rhs > &b) const
Definition SparseSolverBase.h:88
Matrix< double, Dynamic, 1 > VectorXd
DynamicĂ—1 vector of type double.
Definition Matrix.h:489

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, https://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.

+ Inheritance diagram for Eigen::DGMRES< MatrixType_, Preconditioner_ >:

Public Member Functions

Index deflSize () const
 
 DGMRES ()
 
template<typename MatrixDerived>
 DGMRES (const EigenBase< MatrixDerived > &A)
 
Index restart () const
 
void set_restart (const Index restart)
 
void setEigenv (const Index neig)
 
void setMaxEigenv (const Index maxNeig)
 
- Public Member Functions inherited from Eigen::IterativeSolverBase< DGMRES< MatrixType_, Preconditioner_ > >
DGMRES< MatrixType_, Preconditioner_ > & analyzePattern (const EigenBase< MatrixDerived > &A)
 
DGMRES< MatrixType_, Preconditioner_ > & compute (const EigenBase< MatrixDerived > &A)
 
RealScalar error () const
 
DGMRES< MatrixType_, Preconditioner_ > & factorize (const EigenBase< MatrixDerived > &A)
 
ComputationInfo info () const
 
Index iterations () const
 
 IterativeSolverBase ()
 
 IterativeSolverBase (const EigenBase< MatrixDerived > &A)
 
Index maxIterations () const
 
Preconditioner & preconditioner ()
 
const Preconditioner & preconditioner () const
 
DGMRES< MatrixType_, Preconditioner_ > & setMaxIterations (Index maxIters)
 
DGMRES< MatrixType_, Preconditioner_ > & setTolerance (const RealScalar &tolerance)
 
const SolveWithGuess< DGMRES< MatrixType_, Preconditioner_ >, Rhs, Guess > solveWithGuess (const MatrixBase< Rhs > &b, const Guess &x0) const
 
void solveWithGuessInPlace (const Rhs &b, Dest &x) const
 
RealScalar tolerance () const
 
- Public Member Functions inherited from Eigen::SparseSolverBase< DGMRES< MatrixType_, Preconditioner_ > >
Solve< DGMRES< MatrixType_, Preconditioner_ >, Rhs > solve (const MatrixBase< Rhs > &b) const
 
Solve< DGMRES< MatrixType_, Preconditioner_ >, Rhs > solve (const SparseMatrixBase< Rhs > &b) const
 
 SparseSolverBase ()=default
 

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 Dest>
Index dgmresCycle (const MatrixType &mat, const Preconditioner &precond, Dest &x, DenseVector &r0, RealScalar &beta, const RealScalar &normRhs, Index &nbIts) const
 Perform one restart cycle of DGMRES.
 

Constructor & Destructor Documentation

◆ DGMRES() [1/2]

template<typename MatrixType_, typename Preconditioner_>
Eigen::DGMRES< MatrixType_, Preconditioner_ >::DGMRES ( )
inline

Default constructor.

◆ DGMRES() [2/2]

template<typename MatrixType_, typename Preconditioner_>
template<typename MatrixDerived>
Eigen::DGMRES< MatrixType_, Preconditioner_ >::DGMRES ( const EigenBase< MatrixDerived > & A)
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().

Warning
this class stores a reference to the matrix A as well as some precomputed values that depend on it. Therefore, if A is changed this class becomes invalid. Call compute() to update it with the new matrix A, or modify a copy of A.

Member Function Documentation

◆ deflSize()

template<typename MatrixType_, typename Preconditioner_>
Index Eigen::DGMRES< MatrixType_, Preconditioner_ >::deflSize ( ) const
inline

Get the size of the deflation subspace size

◆ dgmres()

template<typename MatrixType_, typename Preconditioner_>
template<typename Rhs, typename Dest>
void Eigen::DGMRES< MatrixType_, Preconditioner_ >::dgmres ( const MatrixType & mat,
const Rhs & rhs,
Dest & x,
const Preconditioner & precond ) const
protected

Perform several cycles of restarted GMRES with modified Gram Schmidt,.

A right preconditioner is used combined with deflation.

◆ dgmresCycle()

template<typename MatrixType_, typename Preconditioner_>
template<typename Dest>
Index Eigen::DGMRES< MatrixType_, Preconditioner_ >::dgmresCycle ( const MatrixType & mat,
const Preconditioner & precond,
Dest & x,
DenseVector & r0,
RealScalar & beta,
const RealScalar & normRhs,
Index & nbIts ) const
protected

Perform one restart cycle of DGMRES.

Parameters
matThe coefficient matrix
precondThe preconditioner
xthe new approximated solution
r0The initial residual vector
betaThe norm of the residual computed so far
normRhsThe norm of the right hand side vector
nbItsThe number of iterations

◆ restart()

template<typename MatrixType_, typename Preconditioner_>
Index Eigen::DGMRES< MatrixType_, Preconditioner_ >::restart ( ) const
inline

Get the restart value

◆ set_restart()

template<typename MatrixType_, typename Preconditioner_>
void Eigen::DGMRES< MatrixType_, Preconditioner_ >::set_restart ( const Index restart)
inline

Set the restart value (default is 30)

◆ setEigenv()

template<typename MatrixType_, typename Preconditioner_>
void Eigen::DGMRES< MatrixType_, Preconditioner_ >::setEigenv ( const Index neig)
inline

Set the number of eigenvalues to deflate at each restart

◆ setMaxEigenv()

template<typename MatrixType_, typename Preconditioner_>
void Eigen::DGMRES< MatrixType_, Preconditioner_ >::setMaxEigenv ( const Index maxNeig)
inline

Set the maximum size of the deflation subspace


The documentation for this class was generated from the following file: