fix formatting for examples

This is mostly just applying the existing clang format config, except:
- Use NOLINT on overlong comment lines.
- Wrap some sections in 'clang-format off' / 'clang format on'.
- Manually split or join some multi-line strings.

Change-Id: Ia1a40eeb92112e12c3a169309afe087af55b2f4f
This commit is contained in:
Nikolaus Demmel
2020-09-08 17:51:32 +02:00
parent 82275d8a4e
commit 7b6b2491cc
35 changed files with 743 additions and 717 deletions
+4 -5
View File
@@ -34,12 +34,12 @@
#include "ceres/ceres.h"
#include "glog/logging.h"
using ceres::NumericDiffCostFunction;
using ceres::CENTRAL;
using ceres::CostFunction;
using ceres::NumericDiffCostFunction;
using ceres::Problem;
using ceres::Solver;
using ceres::Solve;
using ceres::Solver;
// A cost functor that implements the residual r = 10 - x.
struct CostFunctor {
@@ -63,7 +63,7 @@ int main(int argc, char** argv) {
// Set up the only cost function (also known as residual). This uses
// numeric differentiation to obtain the derivative (jacobian).
CostFunction* cost_function =
new NumericDiffCostFunction<CostFunctor, CENTRAL, 1, 1> (new CostFunctor);
new NumericDiffCostFunction<CostFunctor, CENTRAL, 1, 1>(new CostFunctor);
problem.AddResidualBlock(cost_function, NULL, &x);
// Run the solver!
@@ -73,7 +73,6 @@ int main(int argc, char** argv) {
Solve(options, &problem, &summary);
std::cout << summary.BriefReport() << "\n";
std::cout << "x : " << initial_x
<< " -> " << x << "\n";
std::cout << "x : " << initial_x << " -> " << x << "\n";
return 0;
}