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/vision/ceres/pose_graph_3d_error_term.h b/frc971/vision/ceres/pose_graph_3d_error_term.h
index c2ebde7..4dd5fbd 100644
--- a/frc971/vision/ceres/pose_graph_3d_error_term.h
+++ b/frc971/vision/ceres/pose_graph_3d_error_term.h
@@ -33,6 +33,7 @@
#include "Eigen/Core"
#include "ceres/autodiff_cost_function.h"
+
#include "types.h"
namespace ceres {
diff --git a/frc971/vision/ceres/read_g2o.h b/frc971/vision/ceres/read_g2o.h
index fea32e9..69fa16a 100644
--- a/frc971/vision/ceres/read_g2o.h
+++ b/frc971/vision/ceres/read_g2o.h
@@ -44,8 +44,8 @@
// Reads a single pose from the input and inserts it into the map. Returns false
// if there is a duplicate entry.
template <typename Pose, typename Allocator>
-bool ReadVertex(std::ifstream* infile,
- std::map<int, Pose, std::less<int>, Allocator>* poses) {
+bool ReadVertex(std::ifstream *infile,
+ std::map<int, Pose, std::less<int>, Allocator> *poses) {
int id;
Pose pose;
*infile >> id >> pose;
@@ -62,8 +62,8 @@
// Reads the contraints between two vertices in the pose graph
template <typename Constraint, typename Allocator>
-void ReadConstraint(std::ifstream* infile,
- std::vector<Constraint, Allocator>* constraints) {
+void ReadConstraint(std::ifstream *infile,
+ std::vector<Constraint, Allocator> *constraints) {
Constraint constraint;
*infile >> constraint;
@@ -92,18 +92,17 @@
// where the quaternion is in Hamilton form.
// A constraint is defined as follows:
//
-// EDGE_SE3:QUAT ID_a ID_b x_ab y_ab z_ab q_x_ab q_y_ab q_z_ab q_w_ab I_11 I_12 I_13 ... I_16 I_22 I_23 ... I_26 ... I_66 // NOLINT
+// EDGE_SE3:QUAT ID_a ID_b x_ab y_ab z_ab q_x_ab q_y_ab q_z_ab q_w_ab I_11 I_12
+// I_13 ... I_16 I_22 I_23 ... I_26 ... I_66 // NOLINT
//
// where I_ij is the (i, j)-th entry of the information matrix for the
// measurement. Only the upper-triangular part is stored. The measurement order
// is the delta position followed by the delta orientation.
-template <typename Pose,
- typename Constraint,
- typename MapAllocator,
+template <typename Pose, typename Constraint, typename MapAllocator,
typename VectorAllocator>
-bool ReadG2oFile(const std::string& filename,
- std::map<int, Pose, std::less<int>, MapAllocator>* poses,
- std::vector<Constraint, VectorAllocator>* constraints) {
+bool ReadG2oFile(const std::string &filename,
+ std::map<int, Pose, std::less<int>, MapAllocator> *poses,
+ std::vector<Constraint, VectorAllocator> *constraints) {
CHECK(poses != NULL);
CHECK(constraints != NULL);
diff --git a/frc971/vision/ceres/types.h b/frc971/vision/ceres/types.h
index d3f19ed..17e9bd3 100644
--- a/frc971/vision/ceres/types.h
+++ b/frc971/vision/ceres/types.h
@@ -52,7 +52,7 @@
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
};
-inline std::istream& operator>>(std::istream& input, Pose3d& pose) {
+inline std::istream &operator>>(std::istream &input, Pose3d &pose) {
input >> pose.p.x() >> pose.p.y() >> pose.p.z() >> pose.q.x() >> pose.q.y() >>
pose.q.z() >> pose.q.w();
// Normalize the quaternion to account for precision loss due to
@@ -61,9 +61,7 @@
return input;
}
-typedef std::map<int,
- Pose3d,
- std::less<int>,
+typedef std::map<int, Pose3d, std::less<int>,
Eigen::aligned_allocator<std::pair<const int, Pose3d>>>
MapOfPoses;
@@ -88,8 +86,8 @@
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
};
-inline std::istream& operator>>(std::istream& input, Constraint3d& constraint) {
- Pose3d& t_be = constraint.t_be;
+inline std::istream &operator>>(std::istream &input, Constraint3d &constraint) {
+ Pose3d &t_be = constraint.t_be;
input >> constraint.id_begin >> constraint.id_end >> t_be;
for (int i = 0; i < 6 && input.good(); ++i) {