Lint and other fixes from William Rucklidge Change-Id: Ic18561a5cdadccc75e97818fa4422bb5d9d43df9
diff --git a/docs/source/modeling.rst b/docs/source/modeling.rst index 93098f1..95832b1 100644 --- a/docs/source/modeling.rst +++ b/docs/source/modeling.rst
@@ -350,10 +350,10 @@ : public SizedCostFunction<M, N0, N1, N2, N3, N4, N5, N6, N7, N8, N9> { }; - To get an numerically differentiated :class:`CostFunction`, you - must define a class with a ``operator()`` (a functor) that computes - the residuals. The functor must write the computed value in the - last argument (the only non-``const`` one) and return ``true`` to + To get a numerically differentiated :class:`CostFunction`, you must + define a class with a ``operator()`` (a functor) that computes the + residuals. The functor must write the computed value in the last + argument (the only non-``const`` one) and return ``true`` to indicate success. Please see :class:`CostFunction` for details on how the return value may be used to impose simple constraints on the parameter block. e.g., an object of the form
diff --git a/docs/source/solving.rst b/docs/source/solving.rst index c992c5b..9b26166 100644 --- a/docs/source/solving.rst +++ b/docs/source/solving.rst
@@ -1022,7 +1022,7 @@ 1. Compute the Jacobian matrix in some order and then have the factorization algorithm permute the columns of the Jacobian. - 2. Compute the Jacobian with it's columns already permuted. + 2. Compute the Jacobian with its columns already permuted. The first option incurs a significant memory penalty. The factorization algorithm has to make a copy of the permuted Jacobian @@ -1314,7 +1314,8 @@ .. class:: IterationSummary :class:`IterationSummary` describes the state of the optimizer - after each iteration of the minimization. + after each iteration of the minimization. Note that all times are + wall times. .. code-block:: c++ @@ -1524,6 +1525,8 @@ .. class:: Solver::Summary + Note that all times reported in this struct are wall times. + .. code-block:: c++ struct Summary {
diff --git a/docs/source/tutorial.rst b/docs/source/tutorial.rst index 3329927..da63e9e 100644 --- a/docs/source/tutorial.rst +++ b/docs/source/tutorial.rst
@@ -244,7 +244,7 @@ residuals[0] = 10 - x; // Compute the Jacobian if asked for. - if (jacobians != NULL) { + if (jacobians != NULL && jacobians[0] != NULL) { jacobians[0][0] = -1; } return true;
diff --git a/docs/source/version_history.rst b/docs/source/version_history.rst index a83d098..11e1e46 100644 --- a/docs/source/version_history.rst +++ b/docs/source/version_history.rst
@@ -31,7 +31,7 @@ #. Enabling -O4 (link-time optimization) only if compiler/linker support it. (Alex Stewart) #. Consistent glog path across files. #. ceres-solver.spec: Use cleaner, more conventional Release string (Taylor Braun-Jones) -#. Fix compile bug on RHEL6 due to missing header (Taylor Braun-Jones 3 weeks ago) +#. Fix compile bug on RHEL6 due to missing header (Taylor Braun-Jones) 1.6.0
diff --git a/include/ceres/iteration_callback.h b/include/ceres/iteration_callback.h index 0dc4c96..13140c2 100644 --- a/include/ceres/iteration_callback.h +++ b/include/ceres/iteration_callback.h
@@ -128,6 +128,8 @@ // Newton step. int linear_solver_iterations; + // All times reported below are wall times. + // Time (in seconds) spent inside the minimizer loop in the current // iteration. double iteration_time_in_seconds;
diff --git a/include/ceres/jet.h b/include/ceres/jet.h index 7299a48..4d2a857 100644 --- a/include/ceres/jet.h +++ b/include/ceres/jet.h
@@ -545,8 +545,8 @@ Jet<T, N> tanh(const Jet<T, N>& f) { Jet<T, N> g; g.a = tanh(f.a); - double tanh_fa = tanh(f.a); - const T tmp = 1 - tanh_fa * tanh_fa; + double tanh_a = tanh(f.a); + const T tmp = T(1.0) - tanh_a * tanh_a; g.v = tmp * f.v; return g; }
diff --git a/include/ceres/solver.h b/include/ceres/solver.h index 854df2a..8bf87f9 100644 --- a/include/ceres/solver.h +++ b/include/ceres/solver.h
@@ -603,6 +603,8 @@ int num_unsuccessful_steps; int num_inner_iteration_steps; + // All times reported below are wall times. + // When the user calls Solve, before the actual optimization // occurs, Ceres performs a number of preprocessing steps. These // include error checks, memory allocations, and reorderings. This
diff --git a/internal/ceres/solver.cc b/internal/ceres/solver.cc index 5acbbfd..9ff2d15 100644 --- a/internal/ceres/solver.cc +++ b/internal/ceres/solver.cc
@@ -283,7 +283,6 @@ StringAppendF(&report, "%45s %21s\n", "Given", "Used"); StringAppendF(&report, "Threads % 25d% 25d\n", num_threads_given, num_threads_used); - } if (termination_type == DID_NOT_RUN) {