ClangTidy fixes #2

Change-Id: Ib3baa62248342276d63b900b45561323fd81402d
This commit is contained in:
Sameer Agarwal
2024-07-21 20:31:32 -07:00
parent 0ca2db57c7
commit 3c4f012606
21 changed files with 47 additions and 34 deletions
-1
View File
@@ -53,7 +53,6 @@
#include <cmath>
#include <cstdio>
#include <iostream>
#include <vector>
#include "absl/flags/flag.h"
#include "absl/flags/parse.h"
+3
View File
@@ -34,8 +34,11 @@
#define EXAMPLES_CERES_READ_G2O_H_
#include <fstream>
#include <functional>
#include <istream>
#include <map>
#include <string>
#include <vector>
#include "absl/log/check.h"
#include "absl/log/log.h"
+1 -4
View File
@@ -141,14 +141,11 @@
#define CERES_PUBLIC_INTERNAL_AUTODIFF_H_
#include <array>
#include <cstddef>
#include <utility>
#include "Eigen/Core"
#include "absl/log/check.h"
#include "ceres/internal/array_selector.h"
#include "ceres/internal/eigen.h"
#include "ceres/internal/fixed_array.h"
#include "ceres/internal/parameter_dims.h"
#include "ceres/internal/variadic_evaluate.h"
#include "ceres/jet.h"
#include "ceres/types.h"
+3 -1
View File
@@ -32,8 +32,10 @@
#include <Eigen/Core> // For Eigen::aligned_allocator
#include <algorithm>
#include <array>
#include <cstddef>
#include <initializer_list>
#include <iterator>
#include <limits>
#include <memory>
#include <tuple>
#include <type_traits>
+3 -6
View File
@@ -32,9 +32,8 @@
// the generated bundle adjustment test binaries. The reason to split the
// bundle tests into separate binaries is so the tests can get parallelized.
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <memory>
#include <string>
#include "absl/log/log.h"
@@ -44,7 +43,6 @@
#include "ceres/problem.h"
#include "ceres/rotation.h"
#include "ceres/solver.h"
#include "ceres/stringprintf.h"
#include "ceres/test_util.h"
#include "ceres/types.h"
@@ -60,7 +58,7 @@ const bool kUserOrdering = false;
// problem is hard coded in the constructor.
class BundleAdjustmentProblem {
public:
BundleAdjustmentProblem(const std::string input_file) {
explicit BundleAdjustmentProblem(const std::string input_file) {
ReadData(input_file);
BuildProblem();
}
@@ -93,7 +91,7 @@ class BundleAdjustmentProblem {
const Solver::Options& options() const { return options_; }
// clang-format on
static double kResidualTolerance;
static constexpr double kResidualTolerance = 1e-4;
private:
void ReadData(const std::string& filename) {
@@ -242,7 +240,6 @@ class BundleAdjustmentProblem {
double* parameters_;
};
double BundleAdjustmentProblem::kResidualTolerance = 1e-4;
using BundleAdjustmentTest = SystemTest<BundleAdjustmentProblem>;
} // namespace internal
+2
View File
@@ -32,6 +32,7 @@
#include <algorithm>
#include <cstdint>
#include <limits>
#include <map>
#include <memory>
#include <utility>
@@ -47,6 +48,7 @@
#include "ceres/manifold.h"
#include "ceres/map_util.h"
#include "ceres/problem_impl.h"
#include "ceres/types.h"
#include "gtest/gtest.h"
namespace ceres {
+4 -4
View File
@@ -319,10 +319,10 @@ class CERES_NO_EXPORT CudaStreamedBuffer {
// This class only supports cpu memory as a source
CHECK_NE(attributes.type, cudaMemoryTypeDevice);
// If host memory was allocated (or registered) with CUDA API, or is a
// managed memory, then call to cudaMemcpyAsync will be asynchrnous. In case
// of managed memory it might be slightly better to perform a single call of
// user-provided call-back (and hope that page migration will provide a
// similar throughput with zero efforts from our side).
// managed memory, then call to cudaMemcpyAsync will be asynchronous. In
// case of managed memory it might be slightly better to perform a single
// call of user-provided call-back (and hope that page migration will
// provide a similar throughput with zero efforts from our side).
return attributes.type == cudaMemoryTypeUnregistered;
}
+1
View File
@@ -36,6 +36,7 @@
#include <string>
#include <utility>
#include "Eigen/Core"
#include "Eigen/Dense"
#include "ceres/context_impl.h"
#include "ceres/internal/config.h"
+1 -1
View File
@@ -28,8 +28,8 @@
//
// Author: sameeragarwal@google.com (Sameer Agarwal)
#include <cmath>
#include <cstdlib>
#include <limits>
#include "ceres/ceres.h"
#include "gtest/gtest.h"
@@ -30,11 +30,13 @@
#include "ceres/line_search_preprocessor.h"
#include <map>
#include <limits>
#include "ceres/preprocessor.h"
#include "ceres/problem_impl.h"
#include "ceres/sized_cost_function.h"
#include "ceres/solver.h"
#include "ceres/types.h"
#include "gtest/gtest.h"
namespace ceres::internal {
+1 -2
View File
@@ -35,14 +35,13 @@
#include <memory>
#include <utility>
#include "Eigen/Core"
#include "Eigen/Geometry"
#include "ceres/constants.h"
#include "ceres/dynamic_numeric_diff_cost_function.h"
#include "ceres/internal/eigen.h"
#include "ceres/internal/port.h"
#include "ceres/line_manifold.h"
#include "ceres/manifold_test_utils.h"
#include "ceres/numeric_diff_options.h"
#include "ceres/product_manifold.h"
#include "ceres/rotation.h"
#include "ceres/sphere_manifold.h"
+1 -1
View File
@@ -240,7 +240,7 @@ void ParallelInvoke(ContextImpl* context,
// * Total length of preceding blocks of size base_block_size + 1:
// min(block_id, num_base_p1_sized_blocks) * (base_block_size + 1)
//
// * Total length of preceeding blocks of size base_block_size:
// * Total length of preceding blocks of size base_block_size:
// (block_id - min(block_id, num_base_p1_sized_blocks)) *
// base_block_size
//
+3
View File
@@ -30,6 +30,9 @@
#include "ceres/parallel_utils.h"
#include <set>
#include <utility>
#include "ceres/internal/config.h"
#include "gtest/gtest.h"
+1
View File
@@ -24,6 +24,7 @@
#include "ceres/internal/parameter_dims.h"
#include <array>
#include <type_traits>
#include <utility>
+7
View File
@@ -30,15 +30,22 @@
#include "ceres/reorder_program.h"
#include <algorithm>
#include <memory>
#include <random>
#include <string>
#include <unordered_set>
#include <vector>
#include "ceres/internal/config.h"
#include "ceres/ordered_groups.h"
#include "ceres/parameter_block.h"
#include "ceres/problem.h"
#include "ceres/problem_impl.h"
#include "ceres/program.h"
#include "ceres/sized_cost_function.h"
#include "ceres/solver.h"
#include "ceres/types.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
+1
View File
@@ -35,6 +35,7 @@
#ifndef CERES_INTERNAL_SMALL_BLAS_H_
#define CERES_INTERNAL_SMALL_BLAS_H_
#include "Eigen/Core"
#include "absl/log/check.h"
#include "ceres/internal/eigen.h"
#include "ceres/internal/export.h"
+7 -2
View File
@@ -30,13 +30,16 @@
#include "ceres/sparse_cholesky.h"
#include <limits>
#include <memory>
#include <numeric>
#include <random>
#include <sstream>
#include <utility>
#include <vector>
#include "Eigen/Cholesky"
#include "Eigen/Core"
#include "Eigen/Dense"
#include "Eigen/SparseCore"
#include "absl/log/check.h"
#include "ceres/block_sparse_matrix.h"
#include "ceres/compressed_row_sparse_matrix.h"
@@ -45,6 +48,8 @@
#include "ceres/internal/config.h"
#include "ceres/internal/eigen.h"
#include "ceres/iterative_refiner.h"
#include "ceres/linear_solver.h"
#include "ceres/types.h"
#include "gmock/gmock.h"
#include "gtest/gtest.h"
-1
View File
@@ -43,7 +43,6 @@
#include "ceres/fake_bundle_adjustment_jacobian.h"
#include "ceres/internal/config.h"
#include "ceres/internal/eigen.h"
#include "ceres/linear_solver.h"
#ifndef CERES_NO_CUDA
#include "cuda_runtime.h"
+2 -6
View File
@@ -31,11 +31,9 @@
//
// End-to-end tests for Ceres using Powell's function.
#include <cmath>
#include <cstdlib>
#include "ceres/autodiff_cost_function.h"
#include "ceres/internal/config.h"
#include "ceres/jet.h"
#include "ceres/problem.h"
#include "ceres/solver.h"
#include "ceres/test_util.h"
@@ -86,7 +84,7 @@ class PowellsFunction {
Problem* mutable_problem() { return &problem_; }
Solver::Options* mutable_solver_options() { return &options_; }
static double kResidualTolerance;
static constexpr double kResidualTolerance = 1e-8;
private:
// Templated functions used for automatically differentiated cost
@@ -136,8 +134,6 @@ class PowellsFunction {
Solver::Options options_;
};
double PowellsFunction::kResidualTolerance = 1e-8;
using PowellTest = SystemTest<PowellsFunction>;
TEST_F(PowellTest, DenseQR) {
@@ -31,10 +31,9 @@
#include "ceres/tiny_solver_autodiff_function.h"
#include <algorithm>
#include <cmath>
#include <limits>
#include "Eigen/Core"
#include "ceres/tiny_solver.h"
#include "ceres/tiny_solver_test_util.h"
#include "gtest/gtest.h"
@@ -30,10 +30,10 @@
#include "ceres/tiny_solver_cost_function_adapter.h"
#include <algorithm>
#include <cmath>
#include <limits>
#include <memory>
#include "Eigen/Core"
#include "ceres/cost_function.h"
#include "ceres/sized_cost_function.h"
#include "gtest/gtest.h"