mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-29 16:40:38 +08:00
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:
committed by
Sameer Agarwal
parent
46b3495a4f
commit
c8658c8992
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user