diff --git a/examples/helloworld_analytic_diff.cc b/examples/helloworld_analytic_diff.cc index 273a10282..7cf611191 100644 --- a/examples/helloworld_analytic_diff.cc +++ b/examples/helloworld_analytic_diff.cc @@ -49,7 +49,6 @@ class QuadraticCostFunction : public SizedCostFunction<1 /* number of residuals */, 1 /* size of first parameter */> { public: - bool Evaluate(double const* const* parameters, double* residuals, double** jacobians) const override { diff --git a/examples/rosenbrock_analytic_diff.cc b/examples/rosenbrock_analytic_diff.cc index 96db3482e..7b02d7ae4 100644 --- a/examples/rosenbrock_analytic_diff.cc +++ b/examples/rosenbrock_analytic_diff.cc @@ -34,7 +34,6 @@ // f(x,y) = (1-x)^2 + 100(y - x^2)^2; class Rosenbrock final : public ceres::FirstOrderFunction { public: - bool Evaluate(const double* parameters, double* cost, double* gradient) const override { diff --git a/include/ceres/covariance.h b/include/ceres/covariance.h index b7871875d..60bcc80b8 100644 --- a/include/ceres/covariance.h +++ b/include/ceres/covariance.h @@ -35,8 +35,8 @@ #include #include -#include "ceres/internal/disable_warnings.h" #include "ceres/internal/config.h" +#include "ceres/internal/disable_warnings.h" #include "ceres/internal/export.h" #include "ceres/types.h" diff --git a/include/ceres/dynamic_cost_function.h b/include/ceres/dynamic_cost_function.h index d635b888d..c84a366da 100644 --- a/include/ceres/dynamic_cost_function.h +++ b/include/ceres/dynamic_cost_function.h @@ -41,7 +41,6 @@ namespace ceres { // parameter blocks and set the number of residuals at run time. class CERES_EXPORT DynamicCostFunction : public CostFunction { public: - virtual void AddParameterBlock(int size) { mutable_parameter_block_sizes()->push_back(size); } diff --git a/include/ceres/sized_cost_function.h b/include/ceres/sized_cost_function.h index ad9900218..d76b5c26b 100644 --- a/include/ceres/sized_cost_function.h +++ b/include/ceres/sized_cost_function.h @@ -61,7 +61,6 @@ class SizedCostFunction : public CostFunction { *mutable_parameter_block_sizes() = std::vector{Ns...}; } - // Subclasses must implement Evaluate(). }; diff --git a/include/ceres/sphere_manifold.h b/include/ceres/sphere_manifold.h index c2ad5d333..5d71cbbca 100644 --- a/include/ceres/sphere_manifold.h +++ b/include/ceres/sphere_manifold.h @@ -228,4 +228,4 @@ bool SphereManifold::MinusJacobian( #include "ceres/internal/reenable_warnings.h" // clang-format on -#endif // CERES_PUBLIC_SPHERE_MANIFOLD_H_ +#endif // CERES_PUBLIC_SPHERE_MANIFOLD_H_ diff --git a/include/ceres/version.h b/include/ceres/version.h index 557847e5e..e0d619728 100644 --- a/include/ceres/version.h +++ b/include/ceres/version.h @@ -41,9 +41,9 @@ #define CERES_TO_STRING(x) CERES_TO_STRING_HELPER(x) // The Ceres version as a string; for example "1.9.0". -#define CERES_VERSION_STRING \ - CERES_TO_STRING(CERES_VERSION_MAJOR) "." \ - CERES_TO_STRING(CERES_VERSION_MINOR) "." \ - CERES_TO_STRING(CERES_VERSION_REVISION) +#define CERES_VERSION_STRING \ + CERES_TO_STRING(CERES_VERSION_MAJOR) \ + "." CERES_TO_STRING(CERES_VERSION_MINOR) "." CERES_TO_STRING( \ + CERES_VERSION_REVISION) #endif // CERES_PUBLIC_VERSION_H_ diff --git a/internal/ceres/autodiff_benchmarks/brdf_cost_function.h b/internal/ceres/autodiff_benchmarks/brdf_cost_function.h index 767b42312..87842c050 100644 --- a/internal/ceres/autodiff_benchmarks/brdf_cost_function.h +++ b/internal/ceres/autodiff_benchmarks/brdf_cost_function.h @@ -45,7 +45,6 @@ namespace ceres { // https://github.com/wdas/brdf/blob/master/src/brdfs/disney.brdf struct Brdf { public: - template inline bool operator()(const T* const material, const T* const c_ptr, diff --git a/internal/ceres/canonical_views_clustering.cc b/internal/ceres/canonical_views_clustering.cc index c7565c139..01b8ad38a 100644 --- a/internal/ceres/canonical_views_clustering.cc +++ b/internal/ceres/canonical_views_clustering.cc @@ -49,7 +49,6 @@ using IntSet = std::unordered_set; class CERES_NO_EXPORT CanonicalViewsClustering { public: - // Compute the canonical views clustering of the vertices of the // graph. centers will contain the vertices that are the identified // as the canonical views/cluster centers, and membership is a map diff --git a/internal/ceres/context_impl.cc b/internal/ceres/context_impl.cc index 43a7c1722..a4b3c842d 100644 --- a/internal/ceres/context_impl.cc +++ b/internal/ceres/context_impl.cc @@ -35,8 +35,8 @@ #include "ceres/internal/config.h" #ifndef CERES_NO_CUDA -#include "cuda_runtime.h" #include "cublas_v2.h" +#include "cuda_runtime.h" #include "cusolverDn.h" #endif // CERES_NO_CUDA @@ -73,7 +73,7 @@ bool ContextImpl::InitCUDA(std::string* message) { return false; } if (cusolverDnSetStream(cusolver_handle_, stream_) != - CUSOLVER_STATUS_SUCCESS || + CUSOLVER_STATUS_SUCCESS || cublasSetStream(cublas_handle_, stream_) != CUBLAS_STATUS_SUCCESS) { *message = "cuSolverDN::cusolverDnSetStream or cuBLAS::cublasSetStream failed."; diff --git a/internal/ceres/context_impl.h b/internal/ceres/context_impl.h index ed6bedcba..8e9a03fb4 100644 --- a/internal/ceres/context_impl.h +++ b/internal/ceres/context_impl.h @@ -43,8 +43,8 @@ #include "ceres/internal/export.h" #ifndef CERES_NO_CUDA -#include "cuda_runtime.h" #include "cublas_v2.h" +#include "cuda_runtime.h" #include "cusolverDn.h" #endif // CERES_NO_CUDA @@ -62,7 +62,6 @@ class CERES_NO_EXPORT ContextImpl final : public Context { ContextImpl(const ContextImpl&) = delete; void operator=(const ContextImpl&) = delete; - // When compiled with C++ threading support, resize the thread pool to have // at min(num_thread, num_hardware_threads) where num_hardware_threads is // defined by the hardware. Otherwise this call is a no-op. diff --git a/internal/ceres/covariance_test.cc b/internal/ceres/covariance_test.cc index 33074c097..84afced79 100644 --- a/internal/ceres/covariance_test.cc +++ b/internal/ceres/covariance_test.cc @@ -380,7 +380,6 @@ TEST(CovarianceImpl, ComputeCovarianceSparsityWithFreeParameterBlock) { // x_plus_delta = delta * x; class PolynomialParameterization : public LocalParameterization { public: - bool Plus(const double* x, const double* delta, double* x_plus_delta) const final { @@ -402,7 +401,6 @@ class PolynomialParameterization : public LocalParameterization { // x_plus_delta = delta * x; class PolynomialManifold : public Manifold { public: - bool Plus(const double* x, const double* delta, double* x_plus_delta) const final { diff --git a/internal/ceres/cuda_buffer.h b/internal/ceres/cuda_buffer.h index 61f9752b7..a1cf78420 100644 --- a/internal/ceres/cuda_buffer.h +++ b/internal/ceres/cuda_buffer.h @@ -76,11 +76,8 @@ class CudaBuffer { // provided. void CopyToGpuAsync(const T* data, const size_t size, cudaStream_t stream) { Reserve(size); - CHECK_EQ(cudaMemcpyAsync(data_, - data, - size * sizeof(T), - cudaMemcpyHostToDevice, - stream), + CHECK_EQ(cudaMemcpyAsync( + data_, data, size * sizeof(T), cudaMemcpyHostToDevice, stream), cudaSuccess); } diff --git a/internal/ceres/dense_cholesky.cc b/internal/ceres/dense_cholesky.cc index 2e7b7812c..0e0bba787 100644 --- a/internal/ceres/dense_cholesky.cc +++ b/internal/ceres/dense_cholesky.cc @@ -207,8 +207,9 @@ bool CUDADenseCholesky::Init(ContextImpl* context, std::string* message) { return true; } -LinearSolverTerminationType CUDADenseCholesky::Factorize( - int num_cols, double* lhs, std::string* message) { +LinearSolverTerminationType CUDADenseCholesky::Factorize(int num_cols, + double* lhs, + std::string* message) { factorize_result_ = LinearSolverTerminationType::LINEAR_SOLVER_FATAL_ERROR; lhs_.Reserve(num_cols * num_cols); num_cols_ = num_cols; @@ -264,8 +265,9 @@ LinearSolverTerminationType CUDADenseCholesky::Factorize( return LinearSolverTerminationType::LINEAR_SOLVER_SUCCESS; } -LinearSolverTerminationType CUDADenseCholesky::Solve( - const double* rhs, double* solution, std::string* message) { +LinearSolverTerminationType CUDADenseCholesky::Solve(const double* rhs, + double* solution, + std::string* message) { if (factorize_result_ != LinearSolverTerminationType::LINEAR_SOLVER_SUCCESS) { *message = "Factorize did not complete succesfully previously."; return factorize_result_; diff --git a/internal/ceres/dense_qr.cc b/internal/ceres/dense_qr.cc index ad9b64e5e..4b9c8a4a0 100644 --- a/internal/ceres/dense_qr.cc +++ b/internal/ceres/dense_qr.cc @@ -35,8 +35,8 @@ #include #ifndef CERES_NO_CUDA #include "ceres/context_impl.h" -#include "cusolverDn.h" #include "cublas_v2.h" +#include "cusolverDn.h" #endif // CERES_NO_CUDA #ifndef CERES_NO_LAPACK @@ -323,8 +323,10 @@ bool CUDADenseQR::Init(ContextImpl* context, std::string* message) { return true; } -LinearSolverTerminationType CUDADenseQR::Factorize( - int num_rows, int num_cols, double* lhs, std::string* message) { +LinearSolverTerminationType CUDADenseQR::Factorize(int num_rows, + int num_cols, + double* lhs, + std::string* message) { factorize_result_ = LinearSolverTerminationType::LINEAR_SOLVER_FATAL_ERROR; lhs_.Reserve(num_rows * num_cols); tau_.Reserve(std::min(num_rows, num_cols)); @@ -377,8 +379,9 @@ LinearSolverTerminationType CUDADenseQR::Factorize( return LinearSolverTerminationType::LINEAR_SOLVER_SUCCESS; } -LinearSolverTerminationType CUDADenseQR::Solve( - const double* rhs, double* solution, std::string* message) { +LinearSolverTerminationType CUDADenseQR::Solve(const double* rhs, + double* solution, + std::string* message) { if (factorize_result_ != LinearSolverTerminationType::LINEAR_SOLVER_SUCCESS) { *message = "Factorize did not complete succesfully previously."; return factorize_result_; @@ -459,8 +462,7 @@ std::unique_ptr CUDADenseQR::Create( // The user called the wrong factory method. return nullptr; } - auto cuda_dense_qr = - std::unique_ptr(new CUDADenseQR()); + auto cuda_dense_qr = std::unique_ptr(new CUDADenseQR()); std::string cuda_error; if (cuda_dense_qr->Init(options.context, &cuda_error)) { return cuda_dense_qr; @@ -471,10 +473,9 @@ std::unique_ptr CUDADenseQR::Create( return nullptr; } -CUDADenseQR::CUDADenseQR() = default; +CUDADenseQR::CUDADenseQR() = default; #endif // CERES_NO_CUDA - } // namespace internal } // namespace ceres diff --git a/internal/ceres/dense_qr_test.cc b/internal/ceres/dense_qr_test.cc index 402a7e225..199e033d4 100644 --- a/internal/ceres/dense_qr_test.cc +++ b/internal/ceres/dense_qr_test.cc @@ -107,15 +107,14 @@ namespace { // NOTE: preprocessor directives in a macro are not standard conforming decltype(auto) MakeValues() { - return ::testing::Values( - EIGEN + return ::testing::Values(EIGEN #ifndef CERES_NO_LAPACK - , - LAPACK + , + LAPACK #endif #ifndef CERES_NO_CUDA - , - CUDA + , + CUDA #endif ); } diff --git a/internal/ceres/gradient_problem_solver_test.cc b/internal/ceres/gradient_problem_solver_test.cc index 407fb17cc..ffd827ed2 100644 --- a/internal/ceres/gradient_problem_solver_test.cc +++ b/internal/ceres/gradient_problem_solver_test.cc @@ -39,7 +39,6 @@ namespace internal { // Rosenbrock function; see http://en.wikipedia.org/wiki/Rosenbrock_function . class Rosenbrock : public ceres::FirstOrderFunction { public: - bool Evaluate(const double* parameters, double* cost, double* gradient) const final { diff --git a/internal/ceres/graph.h b/internal/ceres/graph.h index 313474f8a..6a6f8f01c 100644 --- a/internal/ceres/graph.h +++ b/internal/ceres/graph.h @@ -50,7 +50,6 @@ namespace internal { template class CERES_NO_EXPORT Graph { public: - // Add a vertex. void AddVertex(const Vertex& vertex) { if (vertices_.insert(vertex).second) { @@ -106,7 +105,6 @@ class CERES_NO_EXPORT Graph { template class WeightedGraph { public: - // Add a weighted vertex. If the vertex already exists in the graph, // its weight is set to the new weight. void AddVertex(const Vertex& vertex, double weight) { diff --git a/internal/ceres/is_close.h b/internal/ceres/is_close.h index 498e75e39..a1e4e2f67 100644 --- a/internal/ceres/is_close.h +++ b/internal/ceres/is_close.h @@ -40,9 +40,9 @@ namespace ceres { namespace internal { // Returns true if x and y have a relative (unsigned) difference less than // relative_precision and false otherwise. Stores the relative and absolute -// difference in relative/absolute_error if non-nullptr. If one of the two values -// is exactly zero, the absolute difference will be compared, and relative_error -// will be set to the absolute difference. +// difference in relative/absolute_error if non-nullptr. If one of the two +// values is exactly zero, the absolute difference will be compared, and +// relative_error will be set to the absolute difference. CERES_NO_EXPORT bool IsClose(double x, double y, double relative_precision, diff --git a/internal/ceres/levenberg_marquardt_strategy_test.cc b/internal/ceres/levenberg_marquardt_strategy_test.cc index 86d35a254..d79323fb8 100644 --- a/internal/ceres/levenberg_marquardt_strategy_test.cc +++ b/internal/ceres/levenberg_marquardt_strategy_test.cc @@ -58,7 +58,6 @@ class RegularizationCheckingLinearSolver : public DenseSparseMatrixSolver { RegularizationCheckingLinearSolver(const int num_cols, const double* diagonal) : num_cols_(num_cols), diagonal_(diagonal) {} - private: LinearSolver::Summary SolveImpl( DenseSparseMatrix* A, diff --git a/internal/ceres/parameter_block_test.cc b/internal/ceres/parameter_block_test.cc index 53786da81..6fcbf5eab 100644 --- a/internal/ceres/parameter_block_test.cc +++ b/internal/ceres/parameter_block_test.cc @@ -111,7 +111,6 @@ TEST(ParameterBlock, SetManifoldAndNormalOperation) { struct TestManifold : public Manifold { public: - bool Plus(const double* x, const double* delta, double* x_plus_delta) const final { diff --git a/internal/ceres/polynomial.h b/internal/ceres/polynomial.h index 236533f09..3ca753c46 100644 --- a/internal/ceres/polynomial.h +++ b/internal/ceres/polynomial.h @@ -67,7 +67,8 @@ inline double EvaluatePolynomial(const Vector& polynomial, double x) { // that the eigenvalues of the companion matrix could not be computed. // On failure, a more detailed message will be written to LOG(ERROR). // If real is not nullptr, the real parts of the roots will be returned in it. -// Likewise, if imaginary is not nullptr, imaginary parts will be returned in it. +// Likewise, if imaginary is not nullptr, imaginary parts will be returned in +// it. CERES_NO_EXPORT bool FindPolynomialRoots(const Vector& polynomial, Vector* real, Vector* imaginary); diff --git a/internal/ceres/program.cc b/internal/ceres/program.cc index 66dc90b84..1cb9ebcbe 100644 --- a/internal/ceres/program.cc +++ b/internal/ceres/program.cc @@ -54,7 +54,6 @@ namespace ceres { namespace internal { - const std::vector& Program::parameter_blocks() const { return parameter_blocks_; } diff --git a/internal/ceres/program_test.cc b/internal/ceres/program_test.cc index 8f1c422a4..8dc1377b0 100644 --- a/internal/ceres/program_test.cc +++ b/internal/ceres/program_test.cc @@ -331,7 +331,6 @@ class NumParameterBlocksCostFunction : public CostFunction { } } - bool Evaluate(double const* const* parameters, double* residuals, double** jacobians) const final { diff --git a/internal/ceres/residual_block.h b/internal/ceres/residual_block.h index 2de363bbd..978b94640 100644 --- a/internal/ceres/residual_block.h +++ b/internal/ceres/residual_block.h @@ -80,8 +80,8 @@ class CERES_NO_EXPORT ResidualBlock { // components in *residuals, and the jacobians between the parameters and // residuals in jacobians[i], in row-major order. If residuals is nullptr, the // residuals are not computed. If jacobians is nullptr, no jacobians are - // computed. If jacobians[i] is nullptr, then the jacobian for that parameter is - // not computed. + // computed. If jacobians[i] is nullptr, then the jacobian for that parameter + // is not computed. // // cost must not be null. //