diff --git a/reco/L1/L1Algo/L1NaN.h b/reco/L1/L1Algo/L1NaN.h index 667ce9d4c474fbe2b40a7409dccdd0ffc1255612..55cf40a52780a3b6d6522b9c094515efafe0a2c6 100644 --- a/reco/L1/L1Algo/L1NaN.h +++ b/reco/L1/L1Algo/L1NaN.h @@ -64,7 +64,7 @@ namespace L1NaN template<typename T, typename std::enable_if<std::is_same<T, fvec>::value, T>::type* = nullptr> bool IsNaN(T value) { - return IsNanAny(value); // NOTE: Here we consider fvec a NaN if at least one of its words is NaN + return isnan(value).isNotEmpty(); // NOTE: Here we consider fvec a NaN if at least one of its words is NaN } }; // namespace L1NaN diff --git a/reco/L1/vectors/L1vecPseudo.h b/reco/L1/vectors/L1vecPseudo.h index 28abbbe388bbd3097f0766f639365e829b290129..201b8dc4f77ba2603b7f5bbd480b7ee3b4360b85 100644 --- a/reco/L1/vectors/L1vecPseudo.h +++ b/reco/L1/vectors/L1vecPseudo.h @@ -189,6 +189,15 @@ public: friend fmask operator>=(const fvec& a, const fvec& b) { _opComp(a, b, >=) } friend fmask operator==(const fvec& a, const fvec& b) { _opComp(a, b, ==) } + friend fmask isnan(const fvec& a) + { + fmask m; + for (int i = 0; i < size(); i++) { + m[i] = std::isnan(a[i[); + } + return m; + } + friend fvec iif(fmask a, fvec b, fvec c) { fvec z; @@ -277,16 +286,6 @@ inline bool IsHorizontallyEqual(const fvec& v) return ret; } -/// Checks, if any of the bands is NaN -inline bool IsNanAny(const fvec& v) -{ - bool ret = false; - for (int i = 0; i < fvec::size(); i++) { - ret = ret || std::isnan(v[i]); - } - return ret; -} - #include "std_alloc.h" diff --git a/reco/L1/vectors/L1vecVc.h b/reco/L1/vectors/L1vecVc.h index 08253a0c73a1877ca3f51e7dec31fb352c13063b..b0d3c168636ea26b91183e27d9d31b3bf1a95d75 100644 --- a/reco/L1/vectors/L1vecVc.h +++ b/reco/L1/vectors/L1vecVc.h @@ -39,16 +39,6 @@ inline bool IsHorizontallyEqual(const fvec& v) return ret; } -/// Checks, if any of the bands is NaN -inline bool IsNanAny(const fvec& v) -{ - bool ret = false; - for (size_t i = 0; i < fvec::size(); i++) { - ret = ret || std::isnan(v[i]); - } - return ret; -} - #include "std_alloc.h"