ClangFormat changes
Change-Id: I88c9e38b0450aed26c60e1dd54964ab6571e3eef
diff --git a/examples/libmv_bundle_adjuster.cc b/examples/libmv_bundle_adjuster.cc
index 30ec111..2f68793 100644
--- a/examples/libmv_bundle_adjuster.cc
+++ b/examples/libmv_bundle_adjuster.cc
@@ -635,9 +635,10 @@
}
// Convert cameras rotations fro mangle axis back to rotation matrix.
-void UnpackCamerasRotationAndTranslation(const std::vector<Marker>& all_markers,
- const std::vector<Vec6>& all_cameras_R_t,
- std::vector<EuclideanCamera>* all_cameras) {
+void UnpackCamerasRotationAndTranslation(
+ const std::vector<Marker>& all_markers,
+ const std::vector<Vec6>& all_cameras_R_t,
+ std::vector<EuclideanCamera>* all_cameras) {
int max_image = MaxImage(all_markers);
for (int i = 0; i <= max_image; i++) {
diff --git a/examples/nist.cc b/examples/nist.cc
index 04f1474..d95e12c 100644
--- a/examples/nist.cc
+++ b/examples/nist.cc
@@ -231,7 +231,8 @@
for (int i = 0; i < kNumTries; ++i) {
initial_parameters_(i, parameter_id) = std::atof(pieces[i + 2].c_str());
}
- final_parameters_(0, parameter_id) = std::atof(pieces[2 + kNumTries].c_str());
+ final_parameters_(0, parameter_id) =
+ std::atof(pieces[2 + kNumTries].c_str());
// Parse the remaining parameter lines.
for (int parameter_id = 1; parameter_id < kNumParameters; ++parameter_id) {
@@ -240,7 +241,8 @@
for (int i = 0; i < kNumTries; ++i) {
initial_parameters_(i, parameter_id) = std::atof(pieces[i + 2].c_str());
}
- final_parameters_(0, parameter_id) = std::atof(pieces[2 + kNumTries].c_str());
+ final_parameters_(0, parameter_id) =
+ std::atof(pieces[2 + kNumTries].c_str());
}
// Certified cost
@@ -697,7 +699,7 @@
std::cout << "Medium : " << medium_success << "/22\n";
std::cout << "Hard : " << hard_success << "/16\n";
std::cout << "Total : " << easy_success + medium_success + hard_success
- << "/54\n";
+ << "/54\n";
}
} // namespace
diff --git a/internal/ceres/block_jacobian_writer.cc b/internal/ceres/block_jacobian_writer.cc
index a481626..4f1834a 100644
--- a/internal/ceres/block_jacobian_writer.cc
+++ b/internal/ceres/block_jacobian_writer.cc
@@ -59,7 +59,8 @@
int num_eliminate_blocks,
std::vector<int*>* jacobian_layout,
std::vector<int>* jacobian_layout_storage) {
- const std::vector<ResidualBlock*>& residual_blocks = program.residual_blocks();
+ const std::vector<ResidualBlock*>& residual_blocks =
+ program.residual_blocks();
// Iterate over all the active residual blocks and determine how many E blocks
// are there. This will determine where the F blocks start in the jacobian
@@ -165,7 +166,8 @@
}
// Construct the cells in each row.
- const std::vector<ResidualBlock*>& residual_blocks = program_->residual_blocks();
+ const std::vector<ResidualBlock*>& residual_blocks =
+ program_->residual_blocks();
int row_block_position = 0;
bs->rows.resize(residual_blocks.size());
for (int i = 0; i < residual_blocks.size(); ++i) {
diff --git a/internal/ceres/bundle_adjustment_test_util.h b/internal/ceres/bundle_adjustment_test_util.h
index 68d7a7c..c0f6b92 100644
--- a/internal/ceres/bundle_adjustment_test_util.h
+++ b/internal/ceres/bundle_adjustment_test_util.h
@@ -65,7 +65,8 @@
BuildProblem();
}
BundleAdjustmentProblem() {
- const std::string input_file = TestFileAbsolutePath("problem-16-22106-pre.txt");
+ const std::string input_file =
+ TestFileAbsolutePath("problem-16-22106-pre.txt");
ReadData(input_file);
BuildProblem();
}
diff --git a/internal/ceres/canonical_views_clustering.cc b/internal/ceres/canonical_views_clustering.cc
index 7599f6d..aec2cb1 100644
--- a/internal/ceres/canonical_views_clustering.cc
+++ b/internal/ceres/canonical_views_clustering.cc
@@ -61,8 +61,8 @@
private:
void FindValidViews(IntSet* valid_views) const;
- double ComputeClusteringQualityDifference(const int candidate,
- const std::vector<int>& centers) const;
+ double ComputeClusteringQualityDifference(
+ const int candidate, const std::vector<int>& centers) const;
void UpdateCanonicalViewAssignments(const int canonical_view);
void ComputeClusterMembership(const std::vector<int>& centers,
IntMap* membership) const;
diff --git a/internal/ceres/coordinate_descent_minimizer.cc b/internal/ceres/coordinate_descent_minimizer.cc
index e99075e..8087a58 100644
--- a/internal/ceres/coordinate_descent_minimizer.cc
+++ b/internal/ceres/coordinate_descent_minimizer.cc
@@ -70,7 +70,8 @@
// Serialize the OrderedGroups into a vector of parameter block
// offsets for parallel access.
std::map<ParameterBlock*, int> parameter_block_index;
- std::map<int, std::set<double*>> group_to_elements = ordering.group_to_elements();
+ std::map<int, std::set<double*>> group_to_elements =
+ ordering.group_to_elements();
for (const auto& g_t_e : group_to_elements) {
const auto& elements = g_t_e.second;
for (double* parameter_block : elements) {
@@ -85,7 +86,8 @@
// The ordering does not have to contain all parameter blocks, so
// assign zero offsets/empty independent sets to these parameter
// blocks.
- const std::vector<ParameterBlock*>& parameter_blocks = program.parameter_blocks();
+ const std::vector<ParameterBlock*>& parameter_blocks =
+ program.parameter_blocks();
for (auto* parameter_block : parameter_blocks) {
if (!ordering.IsMember(parameter_block->mutable_user_state())) {
parameter_blocks_.push_back(parameter_block);
@@ -96,7 +98,8 @@
// Compute the set of residual blocks that depend on each parameter
// block.
residual_blocks_.resize(parameter_block_index.size());
- const std::vector<ResidualBlock*>& residual_blocks = program.residual_blocks();
+ const std::vector<ResidualBlock*>& residual_blocks =
+ program.residual_blocks();
for (auto* residual_block : residual_blocks) {
const int num_parameter_blocks = residual_block->NumParameterBlocks();
for (int j = 0; j < num_parameter_blocks; ++j) {
diff --git a/internal/ceres/cost_function_to_functor_test.cc b/internal/ceres/cost_function_to_functor_test.cc
index 3749909..0d1e901 100644
--- a/internal/ceres/cost_function_to_functor_test.cc
+++ b/internal/ceres/cost_function_to_functor_test.cc
@@ -298,19 +298,20 @@
};
// Check that AutoDiff(Functor1) == AutoDiff(CostToFunctor(AutoDiff(Functor1)))
-#define TEST_BODY(Functor1) \
- TEST(CostFunctionToFunctor, Functor1) { \
- using CostFunction1 = AutoDiffCostFunction<Functor1, 2, PARAMETER_BLOCK_SIZES>; \
- using FunctionToFunctor = CostFunctionToFunctor<2, PARAMETER_BLOCK_SIZES>; \
- using CostFunction2 = \
- AutoDiffCostFunction<FunctionToFunctor, 2, PARAMETER_BLOCK_SIZES>; \
- \
- std::unique_ptr<CostFunction> cost_function(new CostFunction2( \
- new FunctionToFunctor(new CostFunction1(new Functor1)))); \
- \
- std::unique_ptr<CostFunction> actual_cost_function( \
- new CostFunction1(new Functor1)); \
- ExpectCostFunctionsAreEqual(*cost_function, *actual_cost_function); \
+#define TEST_BODY(Functor1) \
+ TEST(CostFunctionToFunctor, Functor1) { \
+ using CostFunction1 = \
+ AutoDiffCostFunction<Functor1, 2, PARAMETER_BLOCK_SIZES>; \
+ using FunctionToFunctor = CostFunctionToFunctor<2, PARAMETER_BLOCK_SIZES>; \
+ using CostFunction2 = \
+ AutoDiffCostFunction<FunctionToFunctor, 2, PARAMETER_BLOCK_SIZES>; \
+ \
+ std::unique_ptr<CostFunction> cost_function(new CostFunction2( \
+ new FunctionToFunctor(new CostFunction1(new Functor1)))); \
+ \
+ std::unique_ptr<CostFunction> actual_cost_function( \
+ new CostFunction1(new Functor1)); \
+ ExpectCostFunctionsAreEqual(*cost_function, *actual_cost_function); \
}
#define PARAMETER_BLOCK_SIZES 2
diff --git a/internal/ceres/covariance.cc b/internal/ceres/covariance.cc
index b24999d..6260acd 100644
--- a/internal/ceres/covariance.cc
+++ b/internal/ceres/covariance.cc
@@ -46,7 +46,8 @@
Covariance::~Covariance() = default;
bool Covariance::Compute(
- const std::vector<std::pair<const double*, const double*>>& covariance_blocks,
+ const std::vector<std::pair<const double*, const double*>>&
+ covariance_blocks,
Problem* problem) {
return impl_->Compute(covariance_blocks, problem->mutable_impl());
}
diff --git a/internal/ceres/dynamic_sparse_normal_cholesky_solver.cc b/internal/ceres/dynamic_sparse_normal_cholesky_solver.cc
index ecbc47f..d421bc3 100644
--- a/internal/ceres/dynamic_sparse_normal_cholesky_solver.cc
+++ b/internal/ceres/dynamic_sparse_normal_cholesky_solver.cc
@@ -175,8 +175,8 @@
DynamicSparseNormalCholeskySolver::SolveImplUsingSuiteSparse(
CompressedRowSparseMatrix* A, double* rhs_and_solution) {
#ifdef CERES_NO_SUITESPARSE
- (void) A;
- (void) rhs_and_solution;
+ (void)A;
+ (void)rhs_and_solution;
LinearSolver::Summary summary;
summary.num_iterations = 0;
diff --git a/internal/ceres/file.cc b/internal/ceres/file.cc
index 601964f..5874cd7 100644
--- a/internal/ceres/file.cc
+++ b/internal/ceres/file.cc
@@ -38,7 +38,8 @@
namespace ceres::internal {
-void WriteStringToFileOrDie(const std::string& data, const std::string& filename) {
+void WriteStringToFileOrDie(const std::string& data,
+ const std::string& filename) {
FILE* file_descriptor = fopen(filename.c_str(), "wb");
if (!file_descriptor) {
LOG(FATAL) << "Couldn't write to file: " << filename;
diff --git a/internal/ceres/gradient_checker.cc b/internal/ceres/gradient_checker.cc
index dfd5c6a..e366107 100644
--- a/internal/ceres/gradient_checker.cc
+++ b/internal/ceres/gradient_checker.cc
@@ -176,7 +176,8 @@
// Evaluate the derivative using numeric derivatives.
std::vector<Matrix>& numeric_jacobians = results->numeric_jacobians;
- std::vector<Matrix>& local_numeric_jacobians = results->local_numeric_jacobians;
+ std::vector<Matrix>& local_numeric_jacobians =
+ results->local_numeric_jacobians;
Vector finite_diff_residuals;
if (!EvaluateCostFunction(finite_diff_cost_function_.get(),
parameters,
diff --git a/internal/ceres/gradient_checking_cost_function.cc b/internal/ceres/gradient_checking_cost_function.cc
index ac013fe..428c7bd 100644
--- a/internal/ceres/gradient_checking_cost_function.cc
+++ b/internal/ceres/gradient_checking_cost_function.cc
@@ -99,7 +99,8 @@
MatrixRef(residuals, num_residuals, 1) = results.residuals;
// Copy the original jacobian blocks into the jacobians array.
- const std::vector<int32_t>& block_sizes = function_->parameter_block_sizes();
+ const std::vector<int32_t>& block_sizes =
+ function_->parameter_block_sizes();
for (int k = 0; k < block_sizes.size(); k++) {
if (jacobians[k] != nullptr) {
MatrixRef(jacobians[k],
@@ -192,7 +193,8 @@
// For every ParameterBlock in problem_impl, create a new parameter block with
// the same manifold and constancy.
- const std::vector<ParameterBlock*>& parameter_blocks = program->parameter_blocks();
+ const std::vector<ParameterBlock*>& parameter_blocks =
+ program->parameter_blocks();
for (auto* parameter_block : parameter_blocks) {
gradient_checking_problem_impl->AddParameterBlock(
parameter_block->mutable_user_state(),
@@ -219,7 +221,8 @@
// For every ResidualBlock in problem_impl, create a new
// ResidualBlock by wrapping its CostFunction inside a
// GradientCheckingCostFunction.
- const std::vector<ResidualBlock*>& residual_blocks = program->residual_blocks();
+ const std::vector<ResidualBlock*>& residual_blocks =
+ program->residual_blocks();
for (int i = 0; i < residual_blocks.size(); ++i) {
ResidualBlock* residual_block = residual_blocks[i];
diff --git a/internal/ceres/parallel_for_cxx.cc b/internal/ceres/parallel_for_cxx.cc
index 981f724..3c0671e 100644
--- a/internal/ceres/parallel_for_cxx.cc
+++ b/internal/ceres/parallel_for_cxx.cc
@@ -61,9 +61,7 @@
lock, [&]() { return num_total_jobs_finished_ == num_total_jobs_; });
}
-ThreadPoolState::ThreadPoolState(int start,
- int end,
- int num_work_blocks)
+ThreadPoolState::ThreadPoolState(int start, int end, int num_work_blocks)
: start(start),
end(end),
num_work_blocks(num_work_blocks),
diff --git a/internal/ceres/parameter_block_ordering.cc b/internal/ceres/parameter_block_ordering.cc
index 5f675ab..669d5fd 100644
--- a/internal/ceres/parameter_block_ordering.cc
+++ b/internal/ceres/parameter_block_ordering.cc
@@ -52,7 +52,8 @@
auto graph = CreateHessianGraph(program);
event_logger.AddEvent("CreateHessianGraph");
- const std::vector<ParameterBlock*>& parameter_blocks = program.parameter_blocks();
+ const std::vector<ParameterBlock*>& parameter_blocks =
+ program.parameter_blocks();
const std::unordered_set<ParameterBlock*>& vertices = graph->vertices();
for (auto* parameter_block : parameter_blocks) {
if (vertices.count(parameter_block) > 0) {
@@ -82,7 +83,8 @@
auto graph = CreateHessianGraph(program);
int independent_set_size = IndependentSetOrdering(*graph, ordering);
- const std::vector<ParameterBlock*>& parameter_blocks = program.parameter_blocks();
+ const std::vector<ParameterBlock*>& parameter_blocks =
+ program.parameter_blocks();
// Add the excluded blocks to back of the ordering vector.
for (auto* parameter_block : parameter_blocks) {
@@ -98,7 +100,8 @@
ParameterBlockOrdering* ordering) {
CHECK(ordering != nullptr);
ordering->Clear();
- const std::vector<ParameterBlock*> parameter_blocks = program.parameter_blocks();
+ const std::vector<ParameterBlock*> parameter_blocks =
+ program.parameter_blocks();
auto graph = CreateHessianGraph(program);
int num_covered = 0;
@@ -121,14 +124,16 @@
const Program& program) {
auto graph = std::make_unique<Graph<ParameterBlock*>>();
CHECK(graph != nullptr);
- const std::vector<ParameterBlock*>& parameter_blocks = program.parameter_blocks();
+ const std::vector<ParameterBlock*>& parameter_blocks =
+ program.parameter_blocks();
for (auto* parameter_block : parameter_blocks) {
if (!parameter_block->IsConstant()) {
graph->AddVertex(parameter_block);
}
}
- const std::vector<ResidualBlock*>& residual_blocks = program.residual_blocks();
+ const std::vector<ResidualBlock*>& residual_blocks =
+ program.residual_blocks();
for (auto* residual_block : residual_blocks) {
const int num_parameter_blocks = residual_block->NumParameterBlocks();
ParameterBlock* const* parameter_blocks =
diff --git a/internal/ceres/preconditioner.h b/internal/ceres/preconditioner.h
index 46fd1fa..8a0081c 100644
--- a/internal/ceres/preconditioner.h
+++ b/internal/ceres/preconditioner.h
@@ -147,7 +147,9 @@
public:
IdentityPreconditioner(int num_rows) : num_rows_(num_rows) {}
- bool Update(const LinearOperator& /*A*/, const double* /*D*/) final { return true; }
+ bool Update(const LinearOperator& /*A*/, const double* /*D*/) final {
+ return true;
+ }
void RightMultiplyAndAccumulate(const double* x, double* y) const final {
VectorRef(y, num_rows_) += ConstVectorRef(x, num_rows_);
diff --git a/internal/ceres/reorder_program.cc b/internal/ceres/reorder_program.cc
index 56b0a40..ad9d0d2 100644
--- a/internal/ceres/reorder_program.cc
+++ b/internal/ceres/reorder_program.cc
@@ -114,11 +114,11 @@
int* ordering) {
#ifdef CERES_NO_SUITESPARSE
// "Void"ing values to avoid compiler warnings about unused parameters
- (void) linear_solver_ordering_type;
- (void) tsm_block_jacobian_transpose;
- (void) parameter_blocks;
- (void) parameter_block_ordering;
- (void) ordering;
+ (void)linear_solver_ordering_type;
+ (void)tsm_block_jacobian_transpose;
+ (void)parameter_blocks;
+ (void)parameter_block_ordering;
+ (void)ordering;
LOG(FATAL) << "Congratulations, you found a Ceres bug! "
<< "Please report this error to the developers.";
#else
@@ -256,8 +256,10 @@
// Create a histogram of the number of residuals for each E block. There is an
// extra bucket at the end to catch all non-eliminated F blocks.
- std::vector<int> residual_blocks_per_e_block(size_of_first_elimination_group + 1);
- std::vector<ResidualBlock*>* residual_blocks = program->mutable_residual_blocks();
+ std::vector<int> residual_blocks_per_e_block(size_of_first_elimination_group +
+ 1);
+ std::vector<ResidualBlock*>* residual_blocks =
+ program->mutable_residual_blocks();
std::vector<int> min_position_per_residual(residual_blocks->size());
for (int i = 0; i < residual_blocks->size(); ++i) {
ResidualBlock* residual_block = (*residual_blocks)[i];
@@ -330,12 +332,11 @@
// Pre-order the columns corresponding to the Schur complement if
// possible.
static void ReorderSchurComplementColumnsUsingSuiteSparse(
- const ParameterBlockOrdering& parameter_block_ordering,
- Program* program) {
+ const ParameterBlockOrdering& parameter_block_ordering, Program* program) {
#ifdef CERES_NO_SUITESPARSE
// "Void"ing values to avoid compiler warnings about unused parameters
- (void) parameter_block_ordering;
- (void) program;
+ (void)parameter_block_ordering;
+ (void)program;
#else
SuiteSparse ss;
std::vector<int> constraints;
@@ -414,7 +415,8 @@
#endif
}
- const std::vector<ParameterBlock*>& parameter_blocks = program->parameter_blocks();
+ const std::vector<ParameterBlock*>& parameter_blocks =
+ program->parameter_blocks();
std::vector<ParameterBlock*> ordering(num_cols);
// The ordering of the first size_of_first_elimination_group does
diff --git a/internal/ceres/reorder_program_test.cc b/internal/ceres/reorder_program_test.cc
index 3510171..88f84b6 100644
--- a/internal/ceres/reorder_program_test.cc
+++ b/internal/ceres/reorder_program_test.cc
@@ -154,7 +154,8 @@
EXPECT_TRUE(ApplyOrdering(
problem.parameter_map(), linear_solver_ordering, program, &message));
- const std::vector<ParameterBlock*>& parameter_blocks = program->parameter_blocks();
+ const std::vector<ParameterBlock*>& parameter_blocks =
+ program->parameter_blocks();
EXPECT_EQ(parameter_blocks.size(), 3);
EXPECT_EQ(parameter_blocks[0]->user_state(), &x);
diff --git a/internal/ceres/residual_block_utils.cc b/internal/ceres/residual_block_utils.cc
index 4d03f94..dfb41c0 100644
--- a/internal/ceres/residual_block_utils.cc
+++ b/internal/ceres/residual_block_utils.cc
@@ -62,10 +62,10 @@
}
std::string EvaluationToString(const ResidualBlock& block,
- double const* const* parameters,
- double* cost,
- double* residuals,
- double** jacobians) {
+ double const* const* parameters,
+ double* cost,
+ double* residuals,
+ double** jacobians) {
CHECK(cost != nullptr);
CHECK(residuals != nullptr);
@@ -115,8 +115,8 @@
}
// TODO(sameeragarwal) Check cost value validness here
-// Cost value is a part of evaluation but not checked here since according to residual_block.cc
-// cost is not valid at the time this method is called
+// Cost value is a part of evaluation but not checked here since according to
+// residual_block.cc cost is not valid at the time this method is called
bool IsEvaluationValid(const ResidualBlock& block,
double const* const* /*parameters*/,
double* residuals,
diff --git a/internal/ceres/schur_complement_solver.cc b/internal/ceres/schur_complement_solver.cc
index d79cf46..aedc73a 100644
--- a/internal/ceres/schur_complement_solver.cc
+++ b/internal/ceres/schur_complement_solver.cc
@@ -179,7 +179,8 @@
// BlockRandomAccessDenseMatrix. The linear system is solved using
// Eigen's Cholesky factorization.
LinearSolver::Summary DenseSchurComplementSolver::SolveReducedLinearSystem(
- const LinearSolver::PerSolveOptions& /*per_solve_options*/, double* solution) {
+ const LinearSolver::PerSolveOptions& /*per_solve_options*/,
+ double* solution) {
LinearSolver::Summary summary;
summary.num_iterations = 0;
summary.termination_type = LinearSolverTerminationType::SUCCESS;
diff --git a/internal/ceres/solver.cc b/internal/ceres/solver.cc
index 5ba477e..fa07055 100644
--- a/internal/ceres/solver.cc
+++ b/internal/ceres/solver.cc
@@ -62,28 +62,28 @@
using internal::StringAppendF;
using internal::StringPrintf;
-#define OPTION_OP(x, y, OP) \
- if (!(options.x OP y)) { \
- std::stringstream ss; \
- ss << "Invalid configuration. "; \
+#define OPTION_OP(x, y, OP) \
+ if (!(options.x OP y)) { \
+ std::stringstream ss; \
+ ss << "Invalid configuration. "; \
ss << std::string("Solver::Options::" #x " = ") << options.x << ". "; \
- ss << "Violated constraint: "; \
+ ss << "Violated constraint: "; \
ss << std::string("Solver::Options::" #x " " #OP " " #y); \
- *error = ss.str(); \
- return false; \
+ *error = ss.str(); \
+ return false; \
}
-#define OPTION_OP_OPTION(x, y, OP) \
- if (!(options.x OP options.y)) { \
- std::stringstream ss; \
- ss << "Invalid configuration. "; \
+#define OPTION_OP_OPTION(x, y, OP) \
+ if (!(options.x OP options.y)) { \
+ std::stringstream ss; \
+ ss << "Invalid configuration. "; \
ss << std::string("Solver::Options::" #x " = ") << options.x << ". "; \
ss << std::string("Solver::Options::" #y " = ") << options.y << ". "; \
- ss << "Violated constraint: "; \
+ ss << "Violated constraint: "; \
ss << std::string("Solver::Options::" #x); \
ss << std::string(#OP " Solver::Options::" #y "."); \
- *error = ss.str(); \
- return false; \
+ *error = ss.str(); \
+ return false; \
}
#define OPTION_GE(x, y) OPTION_OP(x, y, >=);
@@ -201,7 +201,8 @@
return OptionsAreValidForDenseSolver(options, error);
}
-bool OptionsAreValidForDenseQr(const Solver::Options& options, std::string* error) {
+bool OptionsAreValidForDenseQr(const Solver::Options& options,
+ std::string* error) {
CHECK_EQ(options.linear_solver_type, DENSE_QR);
if (!OptionsAreValidForDenseSolver(options, error)) {
@@ -302,7 +303,8 @@
return true;
}
-bool OptionsAreValidForCgnr(const Solver::Options& options, std::string* error) {
+bool OptionsAreValidForCgnr(const Solver::Options& options,
+ std::string* error) {
CHECK_EQ(options.linear_solver_type, CGNR);
if (options.preconditioner_type != IDENTITY &&
@@ -383,7 +385,8 @@
return false;
}
-bool TrustRegionOptionsAreValid(const Solver::Options& options, std::string* error) {
+bool TrustRegionOptionsAreValid(const Solver::Options& options,
+ std::string* error) {
OPTION_GT(initial_trust_region_radius, 0.0);
OPTION_GT(min_trust_region_radius, 0.0);
OPTION_GT(max_trust_region_radius, 0.0);
@@ -431,7 +434,8 @@
return true;
}
-bool LineSearchOptionsAreValid(const Solver::Options& options, std::string* error) {
+bool LineSearchOptionsAreValid(const Solver::Options& options,
+ std::string* error) {
OPTION_GT(max_lbfgs_rank, 0);
OPTION_GT(min_line_search_step_size, 0.0);
OPTION_GT(max_line_search_step_contraction, 0.0);
@@ -451,7 +455,8 @@
options.line_search_direction_type == ceres::LBFGS) &&
options.line_search_type != ceres::WOLFE) {
*error =
- std::string("Invalid configuration: Solver::Options::line_search_type = ") +
+ std::string(
+ "Invalid configuration: Solver::Options::line_search_type = ") +
std::string(LineSearchTypeToString(options.line_search_type)) +
std::string(
". When using (L)BFGS, "
diff --git a/internal/ceres/sparse_matrix.h b/internal/ceres/sparse_matrix.h
index b5db4b7..47f5e9c 100644
--- a/internal/ceres/sparse_matrix.h
+++ b/internal/ceres/sparse_matrix.h
@@ -90,7 +90,9 @@
// A = 0. A->num_nonzeros() == 0 is true after this call. The
// sparsity pattern is preserved.
virtual void SetZero() = 0;
- virtual void SetZero(ContextImpl* /*context*/, int /*num_threads*/) { SetZero(); }
+ virtual void SetZero(ContextImpl* /*context*/, int /*num_threads*/) {
+ SetZero();
+ }
// Resize and populate dense_matrix with a dense version of the
// sparse matrix.
diff --git a/internal/ceres/trust_region_preprocessor.cc b/internal/ceres/trust_region_preprocessor.cc
index 31ff288..f2da3ac 100644
--- a/internal/ceres/trust_region_preprocessor.cc
+++ b/internal/ceres/trust_region_preprocessor.cc
@@ -56,7 +56,8 @@
const Program& program) {
std::shared_ptr<ParameterBlockOrdering> ordering =
std::make_shared<ParameterBlockOrdering>();
- const std::vector<ParameterBlock*>& parameter_blocks = program.parameter_blocks();
+ const std::vector<ParameterBlock*>& parameter_blocks =
+ program.parameter_blocks();
for (auto* parameter_block : parameter_blocks) {
ordering->AddElementToGroup(
const_cast<double*>(parameter_block->user_state()), 0);
diff --git a/internal/ceres/types.cc b/internal/ceres/types.cc
index be61476..1bd6cec 100644
--- a/internal/ceres/types.cc
+++ b/internal/ceres/types.cc
@@ -314,7 +314,8 @@
}
}
-bool StringToNumericDiffMethodType(std::string value, NumericDiffMethodType* type) {
+bool StringToNumericDiffMethodType(std::string value,
+ NumericDiffMethodType* type) {
UpperCase(&value);
STRENUM(CENTRAL);
STRENUM(FORWARD);