aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/IterativeLinearSolvers
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2015-06-25 13:51:13 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2015-06-25 13:51:13 +0200
commit973b0a90db5e3f506ff7c745cd6d1a6b12cbe00d (patch)
treec7a5f2fb8f51116f267fb5038297b9a0a47c8b7d /Eigen/src/IterativeLinearSolvers
parent84264ceebc8914dccebb0d0dd101239af99434ee (diff)
Clarify documentation of the tolerance and error returned in iterative solvers
Diffstat (limited to 'Eigen/src/IterativeLinearSolvers')
-rw-r--r--Eigen/src/IterativeLinearSolvers/BiCGSTAB.h2
-rw-r--r--Eigen/src/IterativeLinearSolvers/ConjugateGradient.h2
-rw-r--r--Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h14
3 files changed, 15 insertions, 3 deletions
diff --git a/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h b/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h
index be98993f0..f6d54c5e7 100644
--- a/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h
+++ b/Eigen/src/IterativeLinearSolvers/BiCGSTAB.h
@@ -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 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:
* \include BiCGSTAB_simple.cpp
*
diff --git a/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h b/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h
index 9e7dd1404..de576edc9 100644
--- a/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h
+++ b/Eigen/src/IterativeLinearSolvers/ConjugateGradient.h
@@ -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 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:
\code
int n = 10000;
diff --git a/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h b/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h
index 6477b9de2..22c602a91 100644
--- a/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h
+++ b/Eigen/src/IterativeLinearSolvers/IterativeSolverBase.h
@@ -126,10 +126,16 @@ public:
/** \internal */
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; }
- /** 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)
{
m_tolerance = tolerance;
@@ -167,7 +173,9 @@ public:
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
{
eigen_assert(m_isInitialized && "ConjugateGradient is not initialized.");