summaryrefslogtreecommitdiffhomepage
path: root/eigen/Eigen/src/Core/util/Meta.h
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2018-11-12 06:42:35 +0100
committerStanislaw Halik <sthalik@misaki.pl>2018-11-12 06:42:35 +0100
commit407b6208604d2822b1067ac64949e78a9167572b (patch)
tree8e4371deef2804e77e2fe6e17158be2536de28da /eigen/Eigen/src/Core/util/Meta.h
parentca2e0fcdcfff03747500344e2522ff330ccafa14 (diff)
eigen update
Diffstat (limited to 'eigen/Eigen/src/Core/util/Meta.h')
-rw-r--r--eigen/Eigen/src/Core/util/Meta.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/eigen/Eigen/src/Core/util/Meta.h b/eigen/Eigen/src/Core/util/Meta.h
index 7f63707..1d73f05 100644
--- a/eigen/Eigen/src/Core/util/Meta.h
+++ b/eigen/Eigen/src/Core/util/Meta.h
@@ -485,6 +485,26 @@ T div_ceil(const T &a, const T &b)
return (a+b-1) / b;
}
+// The aim of the following functions is to bypass -Wfloat-equal warnings
+// when we really want a strict equality comparison on floating points.
+template<typename X, typename Y> EIGEN_STRONG_INLINE
+bool equal_strict(const X& x,const Y& y) { return x == y; }
+
+template<> EIGEN_STRONG_INLINE
+bool equal_strict(const float& x,const float& y) { return std::equal_to<float>()(x,y); }
+
+template<> EIGEN_STRONG_INLINE
+bool equal_strict(const double& x,const double& y) { return std::equal_to<double>()(x,y); }
+
+template<typename X, typename Y> EIGEN_STRONG_INLINE
+bool not_equal_strict(const X& x,const Y& y) { return x != y; }
+
+template<> EIGEN_STRONG_INLINE
+bool not_equal_strict(const float& x,const float& y) { return std::not_equal_to<float>()(x,y); }
+
+template<> EIGEN_STRONG_INLINE
+bool not_equal_strict(const double& x,const double& y) { return std::not_equal_to<double>()(x,y); }
+
} // end namespace numext
} // end namespace Eigen