diff --git a/src/point.hpp b/src/point.hpp
index faa9d1548686f75d1c2e64a6c7ee2ef091de7f6a..feedccc9bb0b6ef802b2fbf91a8e0603874e7d7e 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 << "]";
}