Get rid of initialization logic for blueNorm by making the computed constants static const or constexpr.

Move macro definition EIGEN_CONSTEXPR to Core and make all methods in NumTraits constexpr when EIGEN_HASH_CONSTEXPR is 1.
This commit is contained in:
Rasmus Munk Larsen
2020-09-18 17:38:58 +00:00
parent 14022f5eb5
commit e55182ac09
8 changed files with 99 additions and 132 deletions

View File

@@ -75,10 +75,10 @@ template<Index n> struct NumTraits<type2index<n> >
MulCost = 1
};
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE Real epsilon() { return 0; }
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE Real dummy_precision() { return 0; }
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE Real highest() { return n; }
EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE Real lowest() { return n; }
EIGEN_DEVICE_FUNC static EIGEN_CONSTEXPR EIGEN_STRONG_INLINE Real epsilon() { return 0; }
EIGEN_DEVICE_FUNC static EIGEN_CONSTEXPR EIGEN_STRONG_INLINE Real dummy_precision() { return 0; }
EIGEN_DEVICE_FUNC static EIGEN_CONSTEXPR EIGEN_STRONG_INLINE Real highest() { return n; }
EIGEN_DEVICE_FUNC static EIGEN_CONSTEXPR EIGEN_STRONG_INLINE Real lowest() { return n; }
};
namespace internal {

View File

@@ -44,13 +44,6 @@
typename internal::enable_if< ( __condition__ ) , int >::type = 0
#if EIGEN_HAS_CONSTEXPR
#define EIGEN_CONSTEXPR constexpr
#else
#define EIGEN_CONSTEXPR
#endif
#if EIGEN_OS_WIN || EIGEN_OS_WIN64
#define EIGEN_SLEEP(n) Sleep(n)
#elif EIGEN_OS_GNULINUX