|
Blender
V2.93
|
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 } |
| typedef _MatrixType | MatrixType |
| typedef MatrixType::Scalar | Scalar |
| typedef MatrixType::Index | Index |
| typedef MatrixType::RealScalar | RealScalar |
| typedef _FilterMatrixType | FilterMatrixType |
| typedef _Preconditioner | Preconditioner |
Public Member Functions | |
| ConstrainedConjugateGradient () | |
| ConstrainedConjugateGradient (const MatrixType &A) | |
| ~ConstrainedConjugateGradient () | |
| FilterMatrixType & | filter () |
| const FilterMatrixType & | filter () const |
| template<typename Rhs , typename Guess > | |
| const 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 selfadjoint. 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 preconditioner. 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 213 of file ConstrainedConjugateGradient.h.
| typedef _FilterMatrixType Eigen::ConstrainedConjugateGradient< _MatrixType, _UpLo, _FilterMatrixType, _Preconditioner >::FilterMatrixType |
Definition at line 228 of file ConstrainedConjugateGradient.h.
| typedef MatrixType::Index Eigen::ConstrainedConjugateGradient< _MatrixType, _UpLo, _FilterMatrixType, _Preconditioner >::Index |
Definition at line 226 of file ConstrainedConjugateGradient.h.
| typedef _MatrixType Eigen::ConstrainedConjugateGradient< _MatrixType, _UpLo, _FilterMatrixType, _Preconditioner >::MatrixType |
Definition at line 224 of file ConstrainedConjugateGradient.h.
| typedef _Preconditioner Eigen::ConstrainedConjugateGradient< _MatrixType, _UpLo, _FilterMatrixType, _Preconditioner >::Preconditioner |
Definition at line 229 of file ConstrainedConjugateGradient.h.
| typedef MatrixType::RealScalar Eigen::ConstrainedConjugateGradient< _MatrixType, _UpLo, _FilterMatrixType, _Preconditioner >::RealScalar |
Definition at line 227 of file ConstrainedConjugateGradient.h.
| typedef MatrixType::Scalar Eigen::ConstrainedConjugateGradient< _MatrixType, _UpLo, _FilterMatrixType, _Preconditioner >::Scalar |
Definition at line 225 of file ConstrainedConjugateGradient.h.
| anonymous enum |
| Enumerator | |
|---|---|
| UpLo | |
Definition at line 231 of file ConstrainedConjugateGradient.h.
|
inline |
Default constructor.
Definition at line 235 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 249 of file ConstrainedConjugateGradient.h.
References A.
|
inline |
Definition at line 253 of file ConstrainedConjugateGradient.h.
|
inline |
Definition at line 308 of file ConstrainedConjugateGradient.h.
References Eigen::ConstrainedConjugateGradient< _MatrixType, _UpLo, _FilterMatrixType, _Preconditioner >::_solveWithGuess(), and x.
|
inline |
Definition at line 284 of file ConstrainedConjugateGradient.h.
References Eigen::internal::constrained_conjugate_gradient(), Eigen::ConstrainedConjugateGradient< _MatrixType, _UpLo, _FilterMatrixType, _Preconditioner >::m_filter, and x.
Referenced by Eigen::ConstrainedConjugateGradient< _MatrixType, _UpLo, _FilterMatrixType, _Preconditioner >::_solve().
|
inline |
Definition at line 257 of file ConstrainedConjugateGradient.h.
References Eigen::ConstrainedConjugateGradient< _MatrixType, _UpLo, _FilterMatrixType, _Preconditioner >::m_filter.
|
inline |
Definition at line 261 of file ConstrainedConjugateGradient.h.
References Eigen::ConstrainedConjugateGradient< _MatrixType, _UpLo, _FilterMatrixType, _Preconditioner >::m_filter.
|
inline |
using the current decomposition of A x0 as an initial solution.Definition at line 273 of file ConstrainedConjugateGradient.h.
|
protected |