Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Types | List of all members
Eigen::DGMRES< _MatrixType, _Preconditioner > Class Template Reference

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>

Inheritance diagram for Eigen::DGMRES< _MatrixType, _Preconditioner >:
Inheritance graph
[legend]

Public Types

typedef Matrix< std::complex< RealScalar >, Dynamic, 1 > ComplexVector
 
typedef Matrix< Scalar, Dynamic, DynamicDenseMatrix
 
typedef Matrix< RealScalar, Dynamic, DynamicDenseRealMatrix
 
typedef Matrix< RealScalar, Dynamic, 1 > DenseRealVector
 
typedef Matrix< Scalar, Dynamic, 1 > DenseVector
 
typedef _MatrixType MatrixType
 
typedef _Preconditioner Preconditioner
 
typedef MatrixType::RealScalar RealScalar
 
typedef MatrixType::Scalar Scalar
 
typedef MatrixType::StorageIndex StorageIndex
 
- Public Types inherited from Eigen::IterativeSolverBase< DGMRES< _MatrixType, _Preconditioner > >
enum  
 
typedef internal::traits< DGMRES< _MatrixType, _Preconditioner > >::MatrixType MatrixType
 
typedef internal::traits< DGMRES< _MatrixType, _Preconditioner > >::Preconditioner Preconditioner
 
typedef MatrixType::RealScalar RealScalar
 
typedef MatrixType::Scalar Scalar
 
typedef MatrixType::StorageIndex StorageIndex
 

Public Member Functions

template<typename Rhs , typename Dest >
void _solve_vector_with_guess_impl (const Rhs &b, Dest &x) const
 
Index deflSize ()
 
 DGMRES ()
 
template<typename MatrixDerived >
 DGMRES (const EigenBase< MatrixDerived > &A)
 
Index restart ()
 
void set_restart (const Index restart)
 
void setEigenv (const Index neig)
 
void setMaxEigenv (const Index maxNeig)
 
 ~DGMRES ()
 
- Public Member Functions inherited from Eigen::IterativeSolverBase< DGMRES< _MatrixType, _Preconditioner > >
void _solve_impl (const Rhs &b, Dest &x) const
 
void _solve_with_guess_impl (const Rhs &b, SparseMatrixBase< DestDerived > &aDest) const
 
internal::enable_if< Rhs::ColsAtCompileTime!=1 &&DestDerived::ColsAtCompileTime!=1 >::type _solve_with_guess_impl (const Rhs &b, MatrixBase< DestDerived > &aDest) const
 
internal::enable_if< Rhs::ColsAtCompileTime==1||DestDerived::ColsAtCompileTime==1 >::type _solve_with_guess_impl (const Rhs &b, MatrixBase< DestDerived > &dest) const
 
DGMRES< _MatrixType, _Preconditioner > & analyzePattern (const EigenBase< MatrixDerived > &A)
 
EIGEN_CONSTEXPR Index cols () const EIGEN_NOEXCEPT
 
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
 
Preconditionerpreconditioner ()
 
const Preconditionerpreconditioner () const
 
EIGEN_CONSTEXPR Index rows () const EIGEN_NOEXCEPT
 
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
 
RealScalar tolerance () const
 
 ~IterativeSolverBase ()
 
- Public Member Functions inherited from Eigen::SparseSolverBase< DGMRES< _MatrixType, _Preconditioner > >
void _solve_impl (const SparseMatrixBase< Rhs > &b, SparseMatrixBase< Dest > &dest) const
 
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
 
 SparseSolverBase ()
 
 ~SparseSolverBase ()
 

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 RhsType , typename DestType >
Index dgmresApplyDeflation (const RhsType &In, DestType &Out) const
 
Index dgmresComputeDeflationData (const MatrixType &mat, const Preconditioner &precond, const Index &it, StorageIndex &neig) const
 
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. More...
 
void dgmresInitDeflation (Index &rows) const
 
ComplexVector schurValues (const ComplexSchur< DenseMatrix > &schurofH) const
 
ComplexVector schurValues (const RealSchur< DenseMatrix > &schurofH) const
 
- Protected Member Functions inherited from Eigen::IterativeSolverBase< DGMRES< _MatrixType, _Preconditioner > >
void grab (const InputType &A)
 
void init ()
 
const ActualMatrixTypematrix () const
 

Protected Attributes

bool m_force
 
DenseMatrix m_H
 
DenseMatrix m_Hes
 
bool m_isDeflAllocated
 
bool m_isDeflInitialized
 
RealScalar m_lambdaN
 
PartialPivLU< DenseMatrixm_luT
 
Index m_maxNeig
 
DenseMatrix m_MU
 
StorageIndex m_neig
 
Index m_r
 
Index m_restart
 
RealScalar m_smv
 
DenseMatrix m_T
 
DenseMatrix m_U
 
DenseMatrix m_V
 
- Protected Attributes inherited from Eigen::IterativeSolverBase< DGMRES< _MatrixType, _Preconditioner > >
bool m_analysisIsOk
 
RealScalar m_error
 
bool m_factorizationIsOk
 
ComputationInfo m_info
 
Index m_iterations
 
MatrixWrapper m_matrixWrapper
 
Index m_maxIterations
 
Preconditioner m_preconditioner
 
RealScalar m_tolerance
 
- Protected Attributes inherited from Eigen::SparseSolverBase< DGMRES< _MatrixType, _Preconditioner > >
bool m_isInitialized
 

Private Types

typedef IterativeSolverBase< DGMRESBase
 

Additional Inherited Members

- Protected Types inherited from Eigen::IterativeSolverBase< DGMRES< _MatrixType, _Preconditioner > >
typedef MatrixWrapper::ActualMatrixType ActualMatrixType
 
typedef SparseSolverBase< DGMRES< _MatrixType, _Preconditioner > > Base
 
typedef internal::generic_matrix_wrapper< MatrixTypeMatrixWrapper
 

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
_MatrixTypethe type of the sparse matrix A, can be a dense or a sparse matrix.
_Preconditionerthe 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, 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.

Definition at line 19 of file DGMRES.h.

Member Typedef Documentation

◆ Base

template<typename _MatrixType, typename _Preconditioner>
typedef IterativeSolverBase<DGMRES> Eigen::DGMRES< _MatrixType, _Preconditioner >::Base
private

Definition at line 103 of file DGMRES.h.

◆ ComplexVector

template<typename _MatrixType, typename _Preconditioner>
typedef Matrix<std::complex<RealScalar>, Dynamic, 1> Eigen::DGMRES< _MatrixType, _Preconditioner >::ComplexVector

Definition at line 122 of file DGMRES.h.

◆ DenseMatrix

template<typename _MatrixType, typename _Preconditioner>
typedef Matrix<Scalar,Dynamic,Dynamic> Eigen::DGMRES< _MatrixType, _Preconditioner >::DenseMatrix

Definition at line 118 of file DGMRES.h.

◆ DenseRealMatrix

template<typename _MatrixType, typename _Preconditioner>
typedef Matrix<RealScalar,Dynamic,Dynamic> Eigen::DGMRES< _MatrixType, _Preconditioner >::DenseRealMatrix

Definition at line 119 of file DGMRES.h.

◆ DenseRealVector

template<typename _MatrixType, typename _Preconditioner>
typedef Matrix<RealScalar,Dynamic,1> Eigen::DGMRES< _MatrixType, _Preconditioner >::DenseRealVector

Definition at line 121 of file DGMRES.h.

◆ DenseVector

template<typename _MatrixType, typename _Preconditioner>
typedef Matrix<Scalar,Dynamic,1> Eigen::DGMRES< _MatrixType, _Preconditioner >::DenseVector

Definition at line 120 of file DGMRES.h.

◆ MatrixType

template<typename _MatrixType, typename _Preconditioner>
typedef _MatrixType Eigen::DGMRES< _MatrixType, _Preconditioner >::MatrixType

Definition at line 113 of file DGMRES.h.

◆ Preconditioner

template<typename _MatrixType, typename _Preconditioner>
typedef _Preconditioner Eigen::DGMRES< _MatrixType, _Preconditioner >::Preconditioner

Definition at line 117 of file DGMRES.h.

◆ RealScalar

template<typename _MatrixType, typename _Preconditioner>
typedef MatrixType::RealScalar Eigen::DGMRES< _MatrixType, _Preconditioner >::RealScalar

Definition at line 116 of file DGMRES.h.

◆ Scalar

template<typename _MatrixType, typename _Preconditioner>
typedef MatrixType::Scalar Eigen::DGMRES< _MatrixType, _Preconditioner >::Scalar

Definition at line 114 of file DGMRES.h.

◆ StorageIndex

template<typename _MatrixType, typename _Preconditioner>
typedef MatrixType::StorageIndex Eigen::DGMRES< _MatrixType, _Preconditioner >::StorageIndex

Definition at line 115 of file DGMRES.h.

Constructor & Destructor Documentation

◆ DGMRES() [1/2]

template<typename _MatrixType, typename _Preconditioner>
Eigen::DGMRES< _MatrixType, _Preconditioner >::DGMRES ( )
inline

Default constructor.

Definition at line 126 of file DGMRES.h.

◆ 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.

Definition at line 139 of file DGMRES.h.

◆ ~DGMRES()

template<typename _MatrixType, typename _Preconditioner>
Eigen::DGMRES< _MatrixType, _Preconditioner >::~DGMRES ( )
inline

Definition at line 141 of file DGMRES.h.

Member Function Documentation

◆ _solve_vector_with_guess_impl()

template<typename _MatrixType, typename _Preconditioner>
template<typename Rhs , typename Dest >
void Eigen::DGMRES< _MatrixType, _Preconditioner >::_solve_vector_with_guess_impl ( const Rhs &  b,
Dest &  x 
) const
inline

Definition at line 145 of file DGMRES.h.

◆ deflSize()

template<typename _MatrixType, typename _Preconditioner>
Index Eigen::DGMRES< _MatrixType, _Preconditioner >::deflSize ( )
inline

Get the size of the deflation subspace size

Definition at line 177 of file DGMRES.h.

◆ 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.

Definition at line 228 of file DGMRES.h.

◆ dgmresApplyDeflation()

template<typename _MatrixType , typename _Preconditioner >
template<typename RhsType , typename DestType >
Index Eigen::DGMRES< _MatrixType, _Preconditioner >::dgmresApplyDeflation ( const RhsType &  In,
DestType &  Out 
) const
protected

Definition at line 503 of file DGMRES.h.

◆ dgmresComputeDeflationData()

template<typename _MatrixType , typename _Preconditioner >
Index Eigen::DGMRES< _MatrixType, _Preconditioner >::dgmresComputeDeflationData ( const MatrixType mat,
const Preconditioner precond,
const Index it,
StorageIndex neig 
) const
protected

Definition at line 419 of file DGMRES.h.

◆ 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

Definition at line 286 of file DGMRES.h.

◆ dgmresInitDeflation()

template<typename _MatrixType , typename _Preconditioner >
void Eigen::DGMRES< _MatrixType, _Preconditioner >::dgmresInitDeflation ( Index rows) const
protected

Definition at line 378 of file DGMRES.h.

◆ restart()

template<typename _MatrixType, typename _Preconditioner>
Index Eigen::DGMRES< _MatrixType, _Preconditioner >::restart ( )
inline

Get the restart value

Definition at line 158 of file DGMRES.h.

◆ schurValues() [1/2]

template<typename _MatrixType , typename _Preconditioner >
DGMRES< _MatrixType, _Preconditioner >::ComplexVector Eigen::DGMRES< _MatrixType, _Preconditioner >::schurValues ( const ComplexSchur< DenseMatrix > &  schurofH) const
inlineprotected

Definition at line 388 of file DGMRES.h.

◆ schurValues() [2/2]

template<typename _MatrixType , typename _Preconditioner >
DGMRES< _MatrixType, _Preconditioner >::ComplexVector Eigen::DGMRES< _MatrixType, _Preconditioner >::schurValues ( const RealSchur< DenseMatrix > &  schurofH) const
inlineprotected

Definition at line 394 of file DGMRES.h.

◆ 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)

Definition at line 163 of file DGMRES.h.

◆ 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

Definition at line 168 of file DGMRES.h.

◆ setMaxEigenv()

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

Set the maximum size of the deflation subspace

Definition at line 182 of file DGMRES.h.

Member Data Documentation

◆ m_force

template<typename _MatrixType, typename _Preconditioner>
bool Eigen::DGMRES< _MatrixType, _Preconditioner >::m_force
mutableprotected

Definition at line 217 of file DGMRES.h.

◆ m_H

template<typename _MatrixType, typename _Preconditioner>
DenseMatrix Eigen::DGMRES< _MatrixType, _Preconditioner >::m_H
mutableprotected

Definition at line 201 of file DGMRES.h.

◆ m_Hes

template<typename _MatrixType, typename _Preconditioner>
DenseMatrix Eigen::DGMRES< _MatrixType, _Preconditioner >::m_Hes
mutableprotected

Definition at line 202 of file DGMRES.h.

◆ m_isDeflAllocated

template<typename _MatrixType, typename _Preconditioner>
bool Eigen::DGMRES< _MatrixType, _Preconditioner >::m_isDeflAllocated
mutableprotected

Definition at line 212 of file DGMRES.h.

◆ m_isDeflInitialized

template<typename _MatrixType, typename _Preconditioner>
bool Eigen::DGMRES< _MatrixType, _Preconditioner >::m_isDeflInitialized
mutableprotected

Definition at line 213 of file DGMRES.h.

◆ m_lambdaN

template<typename _MatrixType, typename _Preconditioner>
RealScalar Eigen::DGMRES< _MatrixType, _Preconditioner >::m_lambdaN
mutableprotected

Definition at line 211 of file DGMRES.h.

◆ m_luT

template<typename _MatrixType, typename _Preconditioner>
PartialPivLU<DenseMatrix> Eigen::DGMRES< _MatrixType, _Preconditioner >::m_luT
mutableprotected

Definition at line 207 of file DGMRES.h.

◆ m_maxNeig

template<typename _MatrixType, typename _Preconditioner>
Index Eigen::DGMRES< _MatrixType, _Preconditioner >::m_maxNeig
mutableprotected

Definition at line 210 of file DGMRES.h.

◆ m_MU

template<typename _MatrixType, typename _Preconditioner>
DenseMatrix Eigen::DGMRES< _MatrixType, _Preconditioner >::m_MU
mutableprotected

Definition at line 205 of file DGMRES.h.

◆ m_neig

template<typename _MatrixType, typename _Preconditioner>
StorageIndex Eigen::DGMRES< _MatrixType, _Preconditioner >::m_neig
mutableprotected

Definition at line 208 of file DGMRES.h.

◆ m_r

template<typename _MatrixType, typename _Preconditioner>
Index Eigen::DGMRES< _MatrixType, _Preconditioner >::m_r
mutableprotected

Definition at line 209 of file DGMRES.h.

◆ m_restart

template<typename _MatrixType, typename _Preconditioner>
Index Eigen::DGMRES< _MatrixType, _Preconditioner >::m_restart
mutableprotected

Definition at line 203 of file DGMRES.h.

◆ m_smv

template<typename _MatrixType, typename _Preconditioner>
RealScalar Eigen::DGMRES< _MatrixType, _Preconditioner >::m_smv
mutableprotected

Definition at line 216 of file DGMRES.h.

◆ m_T

template<typename _MatrixType, typename _Preconditioner>
DenseMatrix Eigen::DGMRES< _MatrixType, _Preconditioner >::m_T
mutableprotected

Definition at line 206 of file DGMRES.h.

◆ m_U

template<typename _MatrixType, typename _Preconditioner>
DenseMatrix Eigen::DGMRES< _MatrixType, _Preconditioner >::m_U
mutableprotected

Definition at line 204 of file DGMRES.h.

◆ m_V

template<typename _MatrixType, typename _Preconditioner>
DenseMatrix Eigen::DGMRES< _MatrixType, _Preconditioner >::m_V
mutableprotected

Definition at line 200 of file DGMRES.h.


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


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:41:37