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
diff --git a/examples/sampled_function/sampled_function.cc b/examples/sampled_function/sampled_function.cc
index 093276a..7dec42b 100644
--- a/examples/sampled_function/sampled_function.cc
+++ b/examples/sampled_function/sampled_function.cc
@@ -35,23 +35,23 @@
#include "ceres/cubic_interpolation.h"
#include "glog/logging.h"
-using ceres::Grid1D;
-using ceres::CubicInterpolator;
using ceres::AutoDiffCostFunction;
using ceres::CostFunction;
+using ceres::CubicInterpolator;
+using ceres::Grid1D;
using ceres::Problem;
-using ceres::Solver;
using ceres::Solve;
+using ceres::Solver;
// A simple cost functor that interfaces an interpolated table of
// values with automatic differentiation.
struct InterpolatedCostFunctor {
explicit InterpolatedCostFunctor(
const CubicInterpolator<Grid1D<double> >& interpolator)
- : interpolator_(interpolator) {
- }
+ : interpolator_(interpolator) {}
- template<typename T> bool operator()(const T* x, T* residuals) const {
+ template <typename T>
+ bool operator()(const T* x, T* residuals) const {
interpolator_.Evaluate(*x, residuals);
return true;
}