More ClangTidy fixes Change-Id: If7e056b0d2eddca581d87503340fdaac87adba86
diff --git a/examples/evaluation_callback_example.cc b/examples/evaluation_callback_example.cc index 00c05c1..6dbf932 100644 --- a/examples/evaluation_callback_example.cc +++ b/examples/evaluation_callback_example.cc
@@ -200,7 +200,7 @@ CostAndJacobianCopyingCostFunction( int index, const MyEvaluationCallback& evaluation_callback) : index_(index), evaluation_callback_(evaluation_callback) {} - ~CostAndJacobianCopyingCostFunction() = default; + ~CostAndJacobianCopyingCostFunction() override = default; bool Evaluate(double const* const* parameters, double* residuals,
diff --git a/examples/iteration_callback_example.cc b/examples/iteration_callback_example.cc index 993565d..98e24f1 100644 --- a/examples/iteration_callback_example.cc +++ b/examples/iteration_callback_example.cc
@@ -33,6 +33,8 @@ // the parameter blocks as they evolve over the course of the optimization. This // also requires the use of Solver::Options::update_state_every_iteration. +#include <iostream> + #include "ceres/ceres.h" #include "glog/logging.h" @@ -120,17 +122,17 @@ // clang-format on struct ExponentialResidual { - ExponentialResidual(double x, double y) : x_(x), y_(y) {} + ExponentialResidual(double x, double y) : x(x), y(y) {} template <typename T> bool operator()(const T* const m, const T* const c, T* residual) const { - residual[0] = y_ - exp(m[0] * x_ + c[0]); + residual[0] = y - exp(m[0] * x + c[0]); return true; } private: - const double x_; - const double y_; + const double x; + const double y; }; // MyIterationCallback prints the iteration number, the cost and the value of @@ -139,7 +141,7 @@ public: MyIterationCallback(const double* m, const double* c) : m_(m), c_(c) {} - ~MyIterationCallback() = default; + ~MyIterationCallback() override = default; ceres::CallbackReturnType operator()( const ceres::IterationSummary& summary) final {