diff options
author | Gael Guennebaud <g.gael@free.fr> | 2011-07-26 09:22:18 +0200 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2011-07-26 09:22:18 +0200 |
commit | 51f706b91616689a6edbd278be5dd9ea9d726dbe (patch) | |
tree | 90df3a5eb49838ae86049d4ac88041e7d0efa9b0 /unsupported | |
parent | 66fa6f39a29b1b444d3719b42ec45ad94769aa9d (diff) |
add the possibility to configure the preconditioner
Diffstat (limited to 'unsupported')
-rw-r--r-- | unsupported/Eigen/src/IterativeSolvers/ConjugateGradient.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/unsupported/Eigen/src/IterativeSolvers/ConjugateGradient.h b/unsupported/Eigen/src/IterativeSolvers/ConjugateGradient.h index 9054e55a7..c8b276dcf 100644 --- a/unsupported/Eigen/src/IterativeSolvers/ConjugateGradient.h +++ b/unsupported/Eigen/src/IterativeSolvers/ConjugateGradient.h @@ -135,6 +135,7 @@ class conjugate_gradient_solve_retval_with_guess; * \endcode * Note that such a step by step excution is slightly slower. * + * \sa class SimplicialCholesky, DiagonalPreconditioner, IdentityPreconditioner */ template< typename _MatrixType, int _UpLo=Lower, typename _Preconditioner = DiagonalPreconditioner<typename _MatrixType::Scalar> > @@ -162,6 +163,9 @@ public: /** Initialize the solver with matrix \a A for further \c 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 A is changed * this class becomes invalid. Call compute() to update it with the new @@ -177,6 +181,9 @@ public: /** Initializes the iterative solver with the matrix \a A for further solving \c Ax=b problems. * + * Currently, this function mostly initialized/compute the preconditioner. In the future + * we might, for instance, implement column reodering for faster matrix vector products. + * * \warning this class stores a reference to the matrix A as well as some * precomputed values that depend on it. Therefore, if \a A is changed * this class becomes invalid. Call compute() to update it with the new @@ -205,6 +212,12 @@ public: return *this; } + /** \returns a read-write reference to the preconditioner for custom configuration. */ + Preconditioner& preconditioner() { return m_preconditioner; } + + /** \returns a read-only reference to the preconditioner. */ + const Preconditioner& preconditioner() const { return m_preconditioner; } + /** \returns the max number of iterations */ int maxIterations() const { return m_maxIterations; } |