Run clang-format on the entire repo
This patch clang-formats the entire repo. Third-party code is
excluded.
I needed to fix up the .clang-format file so that all the header
includes are ordered properly. I could have sworn that it used to work
without the extra modification, but I guess not.
Signed-off-by: Philipp Schrader <philipp.schrader@gmail.com>
Change-Id: I64bb9f2c795401393f9dfe2fefc4f04cb36b52f6
diff --git a/frc971/control_loops/fixed_quadrature.h b/frc971/control_loops/fixed_quadrature.h
index 22d4984..53bb0dc 100644
--- a/frc971/control_loops/fixed_quadrature.h
+++ b/frc971/control_loops/fixed_quadrature.h
@@ -1,28 +1,29 @@
#ifndef FRC971_CONTROL_LOOPS_FIXED_QUADRATURE_H_
#define FRC971_CONTROL_LOOPS_FIXED_QUADRATURE_H_
-#include <Eigen/Dense>
#include <array>
+#include <Eigen/Dense>
+
namespace frc971 {
namespace control_loops {
-// Implements Gaussian Quadrature integration (5th order). fn is the function to
-// integrate. It must take 1 argument of type T. The integration is between a
-// and b.
+// Implements Gaussian Quadrature integration (5th order). fn is the function
+// to integrate. It must take 1 argument of type T. The integration is between
+// a and b.
template <typename T, typename F>
double GaussianQuadrature5(const F &fn, T a, T b) {
// Pulled from Python.
// numpy.set_printoptions(precision=20)
// scipy.special.p_roots(5)
- const ::std::array<double, 5> x{{
- -9.06179845938663630633e-01, -5.38469310105682885670e-01,
- 3.24607628916367383789e-17, 5.38469310105683218737e-01,
- 9.06179845938663408589e-01}};
+ const ::std::array<double, 5> x{
+ {-9.06179845938663630633e-01, -5.38469310105682885670e-01,
+ 3.24607628916367383789e-17, 5.38469310105683218737e-01,
+ 9.06179845938663408589e-01}};
- const ::std::array<double, 5> w{{
- 0.23692688505618844652, 0.4786286704993669705, 0.56888888888888811124,
- 0.47862867049936674846, 0.23692688505618875183}};
+ const ::std::array<double, 5> w{
+ {0.23692688505618844652, 0.4786286704993669705, 0.56888888888888811124,
+ 0.47862867049936674846, 0.23692688505618875183}};
double answer = 0.0;
for (int i = 0; i < 5; ++i) {
@@ -38,14 +39,14 @@
// Pulled from Python.
// numpy.set_printoptions(precision=20)
// scipy.special.p_roots(5)
- const ::std::array<double, 5> x{{
- -9.06179845938663630633e-01, -5.38469310105682885670e-01,
- 3.24607628916367383789e-17, 5.38469310105683218737e-01,
- 9.06179845938663408589e-01}};
+ const ::std::array<double, 5> x{
+ {-9.06179845938663630633e-01, -5.38469310105682885670e-01,
+ 3.24607628916367383789e-17, 5.38469310105683218737e-01,
+ 9.06179845938663408589e-01}};
- const ::std::array<double, 5> w{{
- 0.23692688505618844652, 0.4786286704993669705, 0.56888888888888811124,
- 0.47862867049936674846, 0.23692688505618875183}};
+ const ::std::array<double, 5> w{
+ {0.23692688505618844652, 0.4786286704993669705, 0.56888888888888811124,
+ 0.47862867049936674846, 0.23692688505618875183}};
Eigen::Matrix<double, N, 1> answer;
answer.setZero();