From 3453b00a1ef895a4b2eb5f349ab0bf2d50ca0535 Mon Sep 17 00:00:00 2001 From: Jonathan Hseu Date: Sat, 11 Feb 2017 21:45:32 -0800 Subject: [PATCH] Fix vector indexing with uint64_t --- Eigen/src/Core/util/Meta.h | 24 +++++++++++++----------- test/basicstuff.cpp | 13 +++++++++++++ 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/Eigen/src/Core/util/Meta.h b/Eigen/src/Core/util/Meta.h index ee0531b32..11c089020 100755 --- a/Eigen/src/Core/util/Meta.h +++ b/Eigen/src/Core/util/Meta.h @@ -97,17 +97,19 @@ template<> struct is_arithmetic { enum { value = true }; }; template<> struct is_arithmetic { enum { value = true }; }; template<> struct is_arithmetic { enum { value = true }; }; -template struct is_integral { enum { value = false }; }; -template<> struct is_integral { enum { value = true }; }; -template<> struct is_integral { enum { value = true }; }; -template<> struct is_integral { enum { value = true }; }; -template<> struct is_integral { enum { value = true }; }; -template<> struct is_integral { enum { value = true }; }; -template<> struct is_integral { enum { value = true }; }; -template<> struct is_integral { enum { value = true }; }; -template<> struct is_integral { enum { value = true }; }; -template<> struct is_integral { enum { value = true }; }; -template<> struct is_integral { enum { value = true }; }; +template struct is_integral { enum { value = false }; }; +template<> struct is_integral { enum { value = true }; }; +template<> struct is_integral { enum { value = true }; }; +template<> struct is_integral { enum { value = true }; }; +template<> struct is_integral { enum { value = true }; }; +template<> struct is_integral { enum { value = true }; }; +template<> struct is_integral { enum { value = true }; }; +template<> struct is_integral { enum { value = true }; }; +template<> struct is_integral { enum { value = true }; }; +template<> struct is_integral { enum { value = true }; }; +template<> struct is_integral { enum { value = true }; }; +template<> struct is_integral { enum { value = true }; }; +template<> struct is_integral { enum { value = true }; }; template struct add_const { typedef const T type; }; template struct add_const { typedef T& type; }; diff --git a/test/basicstuff.cpp b/test/basicstuff.cpp index 99d91f9da..52b89c0d6 100644 --- a/test/basicstuff.cpp +++ b/test/basicstuff.cpp @@ -49,6 +49,19 @@ template void basicStuff(const MatrixType& m) v1[r] = x; VERIFY_IS_APPROX(x, v1[r]); + // test fetching with various index types. + x = v1(static_cast(r)); + x = v1(static_cast(r)); + x = v1(static_cast(r)); + x = v1(static_cast(r)); + x = v1(static_cast(r)); + x = v1(static_cast(r)); + x = v1(static_cast(r)); + x = v1(static_cast(r)); + x = v1(static_cast(r)); + x = v1(static_cast(r)); + x = v1(static_cast(r)); + VERIFY_IS_APPROX( v1, v1); VERIFY_IS_NOT_APPROX( v1, 2*v1); VERIFY_IS_MUCH_SMALLER_THAN( vzero, v1);