Homogenize convergence operators in docs and code
Change-Id: Iec7c12e971b331d1847f9aa91349317eb6524856
diff --git a/docs/source/gradient_solver.rst b/docs/source/gradient_solver.rst
index cf06530..1ef1515 100644
--- a/docs/source/gradient_solver.rst
+++ b/docs/source/gradient_solver.rst
@@ -327,11 +327,10 @@
Solver terminates if
- .. math:: \frac{|\Delta \text{cost}|}{\text{cost}} < \text{function_tolerance}
+ .. math:: \frac{|\Delta \text{cost}|}{\text{cost}} <= \text{function_tolerance}
where, :math:`\Delta \text{cost}` is the change in objective
- function value (up or down) in the current iteration of
- Levenberg-Marquardt.
+ function value (up or down) in the current iteration of the line search.
.. member:: double GradientProblemSolver::Options::gradient_tolerance
@@ -339,13 +338,24 @@
Solver terminates if
- .. math:: \|x - \Pi \boxplus(x, -g(x))\|_\infty < \text{gradient_tolerance}
+ .. math:: \|x - \Pi \boxplus(x, -g(x))\|_\infty <= \text{gradient_tolerance}
where :math:`\|\cdot\|_\infty` refers to the max norm, :math:`\Pi`
is projection onto the bounds constraints and :math:`\boxplus` is
Plus operation for the overall local parameterization associated
with the parameter vector.
+.. member:: double GradientProblemSolver::Options::parameter_tolerance
+
+ Default: ``1e-8``
+
+ Solver terminates if
+
+ .. math:: \|\Delta x\| <= (\|x\| + \text{parameter_tolerance}) * \text{parameter_tolerance}
+
+ where :math:`\Delta x` is the step computed by the linear solver in
+ the current iteration of the line search.
+
.. member:: LoggingType GradientProblemSolver::Options::logging_type
Default: ``PER_MINIMIZER_ITERATION``
diff --git a/docs/source/nnls_solving.rst b/docs/source/nnls_solving.rst
index 95f1a36..d3a6479 100644
--- a/docs/source/nnls_solving.rst
+++ b/docs/source/nnls_solving.rst
@@ -1156,7 +1156,7 @@
Solver terminates if
- .. math:: \frac{|\Delta \text{cost}|}{\text{cost}} < \text{function_tolerance}
+ .. math:: \frac{|\Delta \text{cost}|}{\text{cost}} <= \text{function_tolerance}
where, :math:`\Delta \text{cost}` is the change in objective
function value (up or down) in the current iteration of
@@ -1168,7 +1168,7 @@
Solver terminates if
- .. math:: \|x - \Pi \boxplus(x, -g(x))\|_\infty < \text{gradient_tolerance}
+ .. math:: \|x - \Pi \boxplus(x, -g(x))\|_\infty <= \text{gradient_tolerance}
where :math:`\|\cdot\|_\infty` refers to the max norm, :math:`\Pi`
is projection onto the bounds constraints and :math:`\boxplus` is
@@ -1181,10 +1181,10 @@
Solver terminates if
- .. math:: \|\Delta x\| < (\|x\| + \text{parameter_tolerance}) * \text{parameter_tolerance}
+ .. math:: \|\Delta x\| <= (\|x\| + \text{parameter_tolerance}) * \text{parameter_tolerance}
where :math:`\Delta x` is the step computed by the linear solver in
- the current iteration of Levenberg-Marquardt.
+ the current iteration.
.. member:: LinearSolverType Solver::Options::linear_solver_type
diff --git a/internal/ceres/line_search_minimizer.cc b/internal/ceres/line_search_minimizer.cc
index 0d29b3e..62264fb 100644
--- a/internal/ceres/line_search_minimizer.cc
+++ b/internal/ceres/line_search_minimizer.cc
@@ -412,7 +412,7 @@
const double absolute_function_tolerance =
options.function_tolerance * previous_state.cost;
- if (fabs(iteration_summary.cost_change) < absolute_function_tolerance) {
+ if (fabs(iteration_summary.cost_change) <= absolute_function_tolerance) {
summary->message =
StringPrintf("Function tolerance reached. "
"|cost_change|/cost: %e <= %e",
diff --git a/internal/ceres/trust_region_minimizer.cc b/internal/ceres/trust_region_minimizer.cc
index e490768..d654d08 100644
--- a/internal/ceres/trust_region_minimizer.cc
+++ b/internal/ceres/trust_region_minimizer.cc
@@ -489,7 +489,7 @@
iteration_summary.cost_change = cost - new_cost;
const double absolute_function_tolerance =
options_.function_tolerance * cost;
- if (fabs(iteration_summary.cost_change) < absolute_function_tolerance) {
+ if (fabs(iteration_summary.cost_change) <= absolute_function_tolerance) {
summary->message =
StringPrintf("Function tolerance reached. "
"|cost_change|/cost: %e <= %e",