mirror of
https://gitlab.com/libeigen/eigen.git
synced 2024-12-21 07:19:46 +08:00
Clarify documentation of the tolerance and error returned in iterative solvers
This commit is contained in:
parent
84264ceebc
commit
973b0a90db
@ -136,6 +136,8 @@ struct traits<BiCGSTAB<_MatrixType,_Preconditioner> >
|
|||||||
* and setTolerance() methods. The defaults are the size of the problem for the maximal number of iterations
|
* and setTolerance() methods. The defaults are the size of the problem for the maximal number of iterations
|
||||||
* and NumTraits<Scalar>::epsilon() for the tolerance.
|
* and NumTraits<Scalar>::epsilon() for the tolerance.
|
||||||
*
|
*
|
||||||
|
* The tolerance is the relative residual error: |Ax-b|/|b|
|
||||||
|
*
|
||||||
* This class can be used as the direct solver classes. Here is a typical usage example:
|
* This class can be used as the direct solver classes. Here is a typical usage example:
|
||||||
* \include BiCGSTAB_simple.cpp
|
* \include BiCGSTAB_simple.cpp
|
||||||
*
|
*
|
||||||
|
@ -121,6 +121,8 @@ struct traits<ConjugateGradient<_MatrixType,_UpLo,_Preconditioner> >
|
|||||||
* and setTolerance() methods. The defaults are the size of the problem for the maximal number of iterations
|
* and setTolerance() methods. The defaults are the size of the problem for the maximal number of iterations
|
||||||
* and NumTraits<Scalar>::epsilon() for the tolerance.
|
* and NumTraits<Scalar>::epsilon() for the tolerance.
|
||||||
*
|
*
|
||||||
|
* The tolerance is the relative residual error: |Ax-b|/|b|
|
||||||
|
*
|
||||||
* This class can be used as the direct solver classes. Here is a typical usage example:
|
* This class can be used as the direct solver classes. Here is a typical usage example:
|
||||||
\code
|
\code
|
||||||
int n = 10000;
|
int n = 10000;
|
||||||
|
@ -126,10 +126,16 @@ public:
|
|||||||
/** \internal */
|
/** \internal */
|
||||||
Index cols() const { return mp_matrix.cols(); }
|
Index cols() const { return mp_matrix.cols(); }
|
||||||
|
|
||||||
/** \returns the tolerance threshold used by the stopping criteria */
|
/** \returns the tolerance threshold used by the stopping criteria.
|
||||||
|
* \sa setTolerance()
|
||||||
|
*/
|
||||||
RealScalar tolerance() const { return m_tolerance; }
|
RealScalar tolerance() const { return m_tolerance; }
|
||||||
|
|
||||||
/** Sets the tolerance threshold used by the stopping criteria */
|
/** Sets the tolerance threshold used by the stopping criteria.
|
||||||
|
*
|
||||||
|
* This value is used as an upper bound to the relative residual error: |Ax-b|/|b|.
|
||||||
|
* The default value is the machine precision given by NumTraits<Scalar>::epsilon()
|
||||||
|
*/
|
||||||
Derived& setTolerance(const RealScalar& tolerance)
|
Derived& setTolerance(const RealScalar& tolerance)
|
||||||
{
|
{
|
||||||
m_tolerance = tolerance;
|
m_tolerance = tolerance;
|
||||||
@ -167,7 +173,9 @@ public:
|
|||||||
return m_iterations;
|
return m_iterations;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** \returns the tolerance error reached during the last solve */
|
/** \returns the tolerance error reached during the last solve.
|
||||||
|
* It is a close approximation of the true relative residual error |Ax-b|/|b|.
|
||||||
|
*/
|
||||||
RealScalar error() const
|
RealScalar error() const
|
||||||
{
|
{
|
||||||
eigen_assert(m_isInitialized && "ConjugateGradient is not initialized.");
|
eigen_assert(m_isInitialized && "ConjugateGradient is not initialized.");
|
||||||
|
Loading…
Reference in New Issue
Block a user