diff options
author | Maxim Pimenov <m@maps.me> | 2016-02-17 20:40:55 +0300 |
---|---|---|
committer | Sergey Yershov <yershov@corp.mail.ru> | 2016-03-23 16:50:46 +0300 |
commit | affc8862624d3a881548d0cb7d510e53faae6ee4 (patch) | |
tree | 25c310f41e812b05e92078758ba2445c85029675 /geometry | |
parent | c47e2b06269638f9d98645f17ef247009cd00091 (diff) |
[search] Added a calculation of address search completeness.
Diffstat (limited to 'geometry')
-rw-r--r-- | geometry/point2d.hpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/geometry/point2d.hpp b/geometry/point2d.hpp index 142a5c0641..a8d5823908 100644 --- a/geometry/point2d.hpp +++ b/geometry/point2d.hpp @@ -254,6 +254,12 @@ namespace m2 } template <typename T> + bool AlmostEqualAbs(m2::Point<T> const & a, m2::Point<T> const & b, double const eps) + { + return my::AlmostEqualAbs(a.x, b.x, eps) && my::AlmostEqualAbs(a.y, b.y, eps); + } + + template <typename T> bool AlmostEqualULPs(m2::Point<T> const & a, m2::Point<T> const & b, unsigned int maxULPs = 256) { return my::AlmostEqualULPs(a.x, b.x, maxULPs) && my::AlmostEqualULPs(a.y, b.y, maxULPs); @@ -318,7 +324,7 @@ namespace m2 typedef Point<uint64_t> PointU64; typedef Point<int32_t> PointI; typedef Point<int64_t> PointI64; -} +} // namespace m2 namespace my { @@ -329,4 +335,10 @@ bool AlmostEqualULPs(m2::Point<T> const & p1, m2::Point<T> const & p2, unsigned return m2::AlmostEqualULPs(p1, p2, maxULPs); } +template <typename T> +bool AlmostEqualAbs(m2::Point<T> const & p1, m2::Point<T> const & p2, double const & eps) +{ + return m2::AlmostEqualAbs(p1, p2, eps); } + +} // namespace my |