|
Blender V5.0
|
A conjugate gradient solver for sparse self-adjoint problems with additional constraints. More...
#include <ConstrainedConjugateGradient.h>
Inherits IterativeSolverBase< ConstrainedConjugateGradient< _MatrixType, _UpLo, _FilterMatrixType, _Preconditioner > >.
Public Types | |
| enum | { UpLo = _UpLo } |
| using | MatrixType = _MatrixType |
| using | Scalar = typename MatrixType::Scalar |
| using | Index = typename MatrixType::Index |
| using | RealScalar = typename MatrixType::RealScalar |
| using | FilterMatrixType = _FilterMatrixType |
| using | Preconditioner = _Preconditioner |
Public Member Functions | |
| ConstrainedConjugateGradient () | |
| ConstrainedConjugateGradient (const MatrixType &A) | |
| ~ConstrainedConjugateGradient ()=default | |
| FilterMatrixType & | filter () |
| const FilterMatrixType & | filter () const |
| template<typename Rhs, typename Guess> | |
| internal::solve_retval_with_guess< ConstrainedConjugateGradient, Rhs, Guess > | solveWithGuess (const MatrixBase< Rhs > &b, const Guess &x0) const |
| template<typename Rhs, typename Dest> | |
| void | _solveWithGuess (const Rhs &b, Dest &x) const |
| template<typename Rhs, typename Dest> | |
| void | _solve (const Rhs &b, Dest &x) const |
Protected Attributes | |
| FilterMatrixType | m_filter |
A conjugate gradient solver for sparse self-adjoint problems with additional constraints.
This class allows to solve for A.x = b sparse linear problems using a conjugate gradient algorithm. The sparse matrix A must be self-adjoint. The vectors x and b can be either dense or sparse.
| _MatrixType | the type of the sparse matrix A, can be a dense or a sparse matrix. |
| _UpLo | the triangular part that will be used for the computations. It can be Lower or Upper. Default is Lower. |
| _Preconditioner | the type of the pre-conditioner. Default is #DiagonalPreconditioner |
The maximal number of iterations and tolerance value can be controlled via the setMaxIterations() and setTolerance() methods. The defaults are the size of the problem for the maximal number of iterations and NumTraits<Scalar>::epsilon() for the tolerance.
This class can be used as the direct solver classes. Here is a typical usage example:
By default the iterations start with x=0 as an initial guess of the solution. One can control the start using the solveWithGuess() method. Here is a step by step execution example starting with a random guess and printing the evolution of the estimated error:
Definition at line 198 of file ConstrainedConjugateGradient.h.
| using Eigen::ConstrainedConjugateGradient< _MatrixType, _UpLo, _FilterMatrixType, _Preconditioner >::FilterMatrixType = _FilterMatrixType |
Definition at line 213 of file ConstrainedConjugateGradient.h.
| using Eigen::ConstrainedConjugateGradient< _MatrixType, _UpLo, _FilterMatrixType, _Preconditioner >::Index = typename MatrixType::Index |
Definition at line 211 of file ConstrainedConjugateGradient.h.
| using Eigen::ConstrainedConjugateGradient< _MatrixType, _UpLo, _FilterMatrixType, _Preconditioner >::MatrixType = _MatrixType |
Definition at line 209 of file ConstrainedConjugateGradient.h.
| using Eigen::ConstrainedConjugateGradient< _MatrixType, _UpLo, _FilterMatrixType, _Preconditioner >::Preconditioner = _Preconditioner |
Definition at line 214 of file ConstrainedConjugateGradient.h.
| using Eigen::ConstrainedConjugateGradient< _MatrixType, _UpLo, _FilterMatrixType, _Preconditioner >::RealScalar = typename MatrixType::RealScalar |
Definition at line 212 of file ConstrainedConjugateGradient.h.
| using Eigen::ConstrainedConjugateGradient< _MatrixType, _UpLo, _FilterMatrixType, _Preconditioner >::Scalar = typename MatrixType::Scalar |
Definition at line 210 of file ConstrainedConjugateGradient.h.
| anonymous enum |
| Enumerator | |
|---|---|
| UpLo | |
Definition at line 216 of file ConstrainedConjugateGradient.h.
|
inline |
Default constructor.
Definition at line 219 of file ConstrainedConjugateGradient.h.
|
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().
Definition at line 232 of file ConstrainedConjugateGradient.h.
|
default |
|
inline |
Definition at line 288 of file ConstrainedConjugateGradient.h.
|
inline |
Definition at line 264 of file ConstrainedConjugateGradient.h.
Referenced by Eigen::ConstrainedConjugateGradient< _MatrixType, _UpLo, _Filter, _Preconditioner >::_solve().
|
inline |
Definition at line 236 of file ConstrainedConjugateGradient.h.
|
inline |
Definition at line 240 of file ConstrainedConjugateGradient.h.
|
inline |

Definition at line 252 of file ConstrainedConjugateGradient.h.
|
protected |
Definition at line 295 of file ConstrainedConjugateGradient.h.