Modernize more

Apply clang-tidy Google and modernize fixes without trailing return type
using:

$ clang-tidy -p <build-dir> \
  -checks='-*,google-*,modernize-*,-modernize-use-trailing-return-type' {} -fix

Change-Id: I7450cc58ea9abf928f73a467e87876083217fa26
This commit is contained in:
Sergiu Deitsch
2022-02-20 02:22:17 +01:00
committed by Sameer Agarwal
parent 46b3495a4f
commit c8658c8992
172 changed files with 918 additions and 983 deletions
+5 -6
View File
@@ -157,8 +157,8 @@ namespace {
using Eigen::Dynamic;
using Eigen::RowMajor;
typedef Eigen::Matrix<double, Dynamic, 1> Vector;
typedef Eigen::Matrix<double, Dynamic, Dynamic, RowMajor> Matrix;
using Vector = Eigen::Matrix<double, Dynamic, 1>;
using Matrix = Eigen::Matrix<double, Dynamic, Dynamic, RowMajor>;
using std::atof;
using std::atoi;
@@ -528,7 +528,7 @@ template <typename Model, int num_parameters>
CostFunction* CreateCostFunction(const Matrix& predictor,
const Matrix& response,
const int num_observations) {
Model* model = new Model(predictor.data(), response.data(), num_observations);
auto* model = new Model(predictor.data(), response.data(), num_observations);
ceres::CostFunction* cost_function = nullptr;
if (CERES_GET_FLAG(FLAGS_use_numeric_diff)) {
ceres::NumericDiffOptions options;
@@ -620,9 +620,8 @@ int RegressionDriver(const string& filename) {
} else {
ceres::TinySolverCostFunctionAdapter<Eigen::Dynamic, num_parameters> cfa(
*cost_function);
typedef ceres::TinySolver<
ceres::TinySolverCostFunctionAdapter<Eigen::Dynamic, num_parameters>>
Solver;
using Solver = ceres::TinySolver<
ceres::TinySolverCostFunctionAdapter<Eigen::Dynamic, num_parameters>>;
Solver solver;
solver.options.max_num_iterations = CERES_GET_FLAG(FLAGS_num_iterations);
solver.options.gradient_tolerance =