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
@@ -1,5 +1,5 @@
// Ceres Solver - A fast non-linear least squares minimizer
// Copyright 2015 Google Inc. All rights reserved.
// Copyright 2022 Google Inc. All rights reserved.
// http://ceres-solver.org/
//
// Redistribution and use in source and binary forms, with or without
@@ -149,8 +149,8 @@ TEST(DynamicNumericdiffCostFunctionTest, TestJacobian) {
EXPECT_NEAR(4 * p - 8, jacobian_vect[0][20 * 10 + p], kTolerance);
jacobian_vect[0][20 * 10 + p] = 0.0;
}
for (int i = 0; i < jacobian_vect[0].size(); ++i) {
EXPECT_NEAR(0.0, jacobian_vect[0][i], kTolerance);
for (double entry : jacobian_vect[0]) {
EXPECT_NEAR(0.0, entry, kTolerance);
}
// Check "C" Jacobian for second parameter block.
@@ -158,8 +158,8 @@ TEST(DynamicNumericdiffCostFunctionTest, TestJacobian) {
EXPECT_NEAR(1.0, jacobian_vect[1][20 * 5 + p], kTolerance);
jacobian_vect[1][20 * 5 + p] = 0.0;
}
for (int i = 0; i < jacobian_vect[1].size(); ++i) {
EXPECT_NEAR(0.0, jacobian_vect[1][i], kTolerance);
for (double entry : jacobian_vect[1]) {
EXPECT_NEAR(0.0, entry, kTolerance);
}
}
@@ -208,8 +208,8 @@ TEST(DynamicNumericdiffCostFunctionTest,
EXPECT_NEAR(1.0, jacobian_vect[1][20 * 5 + p], kTolerance);
jacobian_vect[1][20 * 5 + p] = 0.0;
}
for (int i = 0; i < jacobian_vect[1].size(); ++i) {
EXPECT_EQ(0.0, jacobian_vect[1][i]);
for (double& i : jacobian_vect[1]) {
EXPECT_EQ(0.0, i);
}
}
@@ -266,8 +266,8 @@ TEST(DynamicNumericdiffCostFunctionTest,
EXPECT_NEAR(4 * p - 8, jacobian_vect[0][20 * 10 + p], kTolerance);
jacobian_vect[0][20 * 10 + p] = 0.0;
}
for (int i = 0; i < jacobian_vect[0].size(); ++i) {
EXPECT_EQ(0.0, jacobian_vect[0][i]);
for (double& i : jacobian_vect[0]) {
EXPECT_EQ(0.0, i);
}
}
@@ -328,8 +328,8 @@ class ThreeParameterCostFunctorTest : public ::testing::Test {
parameter_blocks_[2] = &z_[0];
// Prepare the cost function.
typedef DynamicNumericDiffCostFunction<MyThreeParameterCostFunctor>
DynamicMyThreeParameterCostFunction;
using DynamicMyThreeParameterCostFunction =
DynamicNumericDiffCostFunction<MyThreeParameterCostFunctor>;
auto cost_function = std::make_unique<DynamicMyThreeParameterCostFunction>(
new MyThreeParameterCostFunctor());
cost_function->AddParameterBlock(1);