Blender
V3.3
|
A conjugate gradient solver for sparse self-adjoint problems with additional constraints. More...
#include <ConstrainedConjugateGradient.h>
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 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 197 of file ConstrainedConjugateGradient.h.
typedef _FilterMatrixType Eigen::ConstrainedConjugateGradient< _MatrixType, _UpLo, _FilterMatrixType, _Preconditioner >::FilterMatrixType |
Definition at line 212 of file ConstrainedConjugateGradient.h.
typedef MatrixType::Index Eigen::ConstrainedConjugateGradient< _MatrixType, _UpLo, _FilterMatrixType, _Preconditioner >::Index |
Definition at line 210 of file ConstrainedConjugateGradient.h.
typedef _MatrixType Eigen::ConstrainedConjugateGradient< _MatrixType, _UpLo, _FilterMatrixType, _Preconditioner >::MatrixType |
Definition at line 208 of file ConstrainedConjugateGradient.h.
typedef _Preconditioner Eigen::ConstrainedConjugateGradient< _MatrixType, _UpLo, _FilterMatrixType, _Preconditioner >::Preconditioner |
Definition at line 213 of file ConstrainedConjugateGradient.h.
typedef MatrixType::RealScalar Eigen::ConstrainedConjugateGradient< _MatrixType, _UpLo, _FilterMatrixType, _Preconditioner >::RealScalar |
Definition at line 211 of file ConstrainedConjugateGradient.h.
typedef MatrixType::Scalar Eigen::ConstrainedConjugateGradient< _MatrixType, _UpLo, _FilterMatrixType, _Preconditioner >::Scalar |
Definition at line 209 of file ConstrainedConjugateGradient.h.
anonymous enum |
Enumerator | |
---|---|
UpLo |
Definition at line 215 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 233 of file ConstrainedConjugateGradient.h.
References A.
|
inline |
Definition at line 237 of file ConstrainedConjugateGradient.h.
|
inline |
Definition at line 292 of file ConstrainedConjugateGradient.h.
References Eigen::ConstrainedConjugateGradient< _MatrixType, _UpLo, _FilterMatrixType, _Preconditioner >::_solveWithGuess(), usdtokens::b(), and x.
|
inline |
Definition at line 268 of file ConstrainedConjugateGradient.h.
References usdtokens::b(), 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 241 of file ConstrainedConjugateGradient.h.
References Eigen::ConstrainedConjugateGradient< _MatrixType, _UpLo, _FilterMatrixType, _Preconditioner >::m_filter.
|
inline |
Definition at line 245 of file ConstrainedConjugateGradient.h.
References Eigen::ConstrainedConjugateGradient< _MatrixType, _UpLo, _FilterMatrixType, _Preconditioner >::m_filter.
|
inline |
Definition at line 257 of file ConstrainedConjugateGradient.h.
References usdtokens::b().
|
protected |