From 8c00741dffa3a8628f91c5f43e0b470d10a290eb Mon Sep 17 00:00:00 2001
From: Ben Cumming <bcumming@cscs.ch>
Date: Thu, 7 Jul 2016 19:50:31 +0200
Subject: [PATCH] coding style fixes

---
 src/point.hpp | 54 ++++++++++++++++-----------------------------------
 1 file changed, 17 insertions(+), 37 deletions(-)

diff --git a/src/point.hpp b/src/point.hpp
index faa9d154..feedccc9 100644
--- a/src/point.hpp
+++ b/src/point.hpp
@@ -14,77 +14,58 @@ struct point {
     value_type y;
     value_type z;
 
-    constexpr point(T a, T b, T c)
-    : x{a}, y{b}, z{c}
+    constexpr point(T a, T b, T c) :
+        x{a}, y{b}, z{c}
     {}
 
     // initialize to NaN by default
-    constexpr point()
-    : x(std::numeric_limits<T>::quiet_NaN()),
-      y(std::numeric_limits<T>::quiet_NaN()),
-      z(std::numeric_limits<T>::quiet_NaN())
+    constexpr point() :
+        x(std::numeric_limits<T>::quiet_NaN()),
+        y(std::numeric_limits<T>::quiet_NaN()),
+        z(std::numeric_limits<T>::quiet_NaN())
     {}
 
-    constexpr bool is_set() const
-    {
+    constexpr bool is_set() const {
         return (x==x && y==y && z==z);
     }
 };
 
 template <typename T>
 constexpr point<T>
-operator+ (
-    point<T> const& lhs,
-    point<T> const& rhs
-) {
+operator+( point<T> const& lhs, point<T> const& rhs) {
     return point<T>(lhs.x + rhs.x, lhs.y + rhs.y, lhs.z + rhs.z);
 }
 
 template <typename T>
 constexpr point<T>
-operator- (
-    point<T> const& lhs,
-    point<T> const& rhs
-) {
+operator-(point<T> const& lhs, point<T> const& rhs) {
     return point<T>(lhs.x - rhs.x, lhs.y - rhs.y, lhs.z - rhs.z);
 }
 
 template <typename T>
 constexpr point<T>
-operator* (
-    T alpha,
-    point<T> const& p
-) {
+operator*(T alpha, point<T> const& p) {
     return point<T>(alpha*p.x, alpha*p.y, alpha*p.z);
 }
 
 template <typename T>
-T
-norm(point<T> const& p)
-{
-    return sqrt(p.x*p.x + p.y*p.y + p.z*p.z);
+T norm(point<T> const& p) {
+    return std::sqrt(p.x*p.x + p.y*p.y + p.z*p.z);
 }
 
 template <typename T>
 constexpr T
-dot(
-    point<T> const& lhs,
-    point<T> const& rhs
-) {
+dot(point<T> const& lhs, point<T> const& rhs) {
     return lhs.x*rhs.x + lhs.y*rhs.y + lhs.z*rhs.z;
 }
 
 template<typename T>
-bool operator==(const point<T> &rhs, const point<T> &lhs)
-{
-    return (rhs.x == lhs.x) &&
-           (rhs.y == lhs.y) &&
-           (rhs.z == lhs.z);
+bool operator==(const point<T> &rhs, const point<T> &lhs) {
+    return (rhs.x==lhs.x) && (rhs.y==lhs.y) && (rhs.z==lhs.z);
 }
 
 template<typename T>
-bool operator!=(const point<T> &rhs, const point<T> &lhs)
-{
+bool operator!=(const point<T> &rhs, const point<T> &lhs) {
     return !(rhs == lhs);
 }
 
@@ -92,7 +73,6 @@ bool operator!=(const point<T> &rhs, const point<T> &lhs)
 } // namespace nest
 
 template <typename T>
-std::ostream& operator << (std::ostream& o, nest::mc::point<T> const& p)
-{
+std::ostream& operator << (std::ostream& o, nest::mc::point<T> const& p) {
     return o << "[" << p.x << ", " << p.y << ", " << p.z << "]";
 }
-- 
GitLab