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
+6 -6
View File
@@ -33,20 +33,21 @@
// Minimize 0.5 (10 - x)^2 using analytic jacobian matrix.
#include <vector>
#include "ceres/ceres.h"
#include "glog/logging.h"
using ceres::CostFunction;
using ceres::SizedCostFunction;
using ceres::Problem;
using ceres::Solver;
using ceres::SizedCostFunction;
using ceres::Solve;
using ceres::Solver;
// A CostFunction implementing analytically derivatives for the
// function f(x) = 10 - x.
class QuadraticCostFunction
: public SizedCostFunction<1 /* number of residuals */,
1 /* size of first parameter */> {
: public SizedCostFunction<1 /* number of residuals */,
1 /* size of first parameter */> {
public:
virtual ~QuadraticCostFunction() {}
@@ -100,8 +101,7 @@ 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;
}