diff --git a/GeoLib/Point.h b/GeoLib/Point.h index 056a52b94f0bfae3992852d2224bd5a7d0066f2b..6641bff407881cad689b456b3ef9144c73ea9288 100644 --- a/GeoLib/Point.h +++ b/GeoLib/Point.h @@ -54,23 +54,7 @@ public: }; static const Point ORIGIN(0, 0, 0); - -/** - * lexicographic comparison of points - */ -bool operator<= (GeoLib::Point const & p0, GeoLib::Point const & p1); - -/** - * lexicographical comparison of points taking an epsilon into account - * @param p0 first input Point - * @param p1 first input Point - * @param tol tolerance (if in the comparison operation the property fabs(p0[k] - p1[k]) < tol - * holds for the k-th coordinate the points are assumed the be equal in this coordinate) - * @return true, if p0 is lexicographically smaller than p1 - */ -bool lessEq(const GeoLib::Point& p0, - const GeoLib::Point& p1, - double tol = std::numeric_limits<double>::epsilon()); } #endif /* POINT_H_ */ + diff --git a/GeoLib/Point.cpp b/MathLib/MathPoint.cpp similarity index 80% rename from GeoLib/Point.cpp rename to MathLib/MathPoint.cpp index 17eed3c8901a1834da301dd2f0609b059e9e6923..261cc81832690088b71fceb8d7db829502bf15c7 100644 --- a/GeoLib/Point.cpp +++ b/MathLib/MathPoint.cpp @@ -1,8 +1,7 @@ /** * \file - * \author Thomas Fischer - * \date 2010-06-22 - * \brief Implementation of the Point class. + * \date 2015-01-16 + * \brief Implementation of the MathPoint class. * * \copyright * Copyright (c) 2012-2015, OpenGeoSys Community (http://www.opengeosys.org) @@ -12,14 +11,11 @@ * */ - #include <cmath> -#include "Point.h" - -namespace GeoLib { +#include "MathPoint.h" -bool operator<= (const GeoLib::Point& p0, const GeoLib::Point& p1) +bool operator<= (const MathLib::MathPoint& p0, const MathLib::MathPoint& p1) { if (p0[0] > p1[0]) { return false; @@ -46,7 +42,7 @@ bool operator<= (const GeoLib::Point& p0, const GeoLib::Point& p1) } } -bool lessEq(const GeoLib::Point& p0, const GeoLib::Point& p1, double tol) +bool lessEq(const MathLib::MathPoint& p0, const MathLib::MathPoint& p1, double tol) { // test a relative and an absolute criterion if (fabs(p0[0]-p1[0]) > tol * std::min(fabs(p1[0]), fabs(p0[0])) && fabs(p0[0]-p1[0]) > tol) { @@ -75,4 +71,3 @@ bool lessEq(const GeoLib::Point& p0, const GeoLib::Point& p1, double tol) } } -} // end namespace GeoLib diff --git a/MathLib/MathPoint.h b/MathLib/MathPoint.h index c91de6d04bddf6de51a3917cdd537062b81a4220..807f64dc015971dfd8d9cf3c7a23d9c0081f4393 100644 --- a/MathLib/MathPoint.h +++ b/MathLib/MathPoint.h @@ -14,6 +14,8 @@ #ifndef MATHPOINT_H_ #define MATHPOINT_H_ +#include <cmath> + #include "TemplatePoint.h" namespace MathLib @@ -21,5 +23,22 @@ namespace MathLib typedef MathLib::TemplatePoint<double,3> MathPoint; } // end namespace MathLib +/** + * lexicographic comparison of points + */ +bool operator<= (MathLib::MathPoint const & p0, MathLib::MathPoint const & p1); + +/** + * lexicographical comparison of points taking an epsilon into account + * @param p0 first input MathPoint + * @param p1 first input MathPoint + * @param tol tolerance (if in the comparison operation the property fabs(p0[k] - p1[k]) < tol + * holds for the k-th coordinate the points are assumed the be equal in this coordinate) + * @return true, if p0 is lexicographically smaller than p1 + */ +bool lessEq(const MathLib::MathPoint& p0, + const MathLib::MathPoint& p1, + double tol = std::numeric_limits<double>::epsilon()); + #endif /* MATHPOINT_H_ */