From 55774b48e4718763214ed9e52faa52dc2622aef0 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Thu, 7 Jun 2018 15:26:25 +0200 Subject: Fix short vs long --- test/main.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/main.h') diff --git a/test/main.h b/test/main.h index 0fcd6cb76..a94e1ab41 100644 --- a/test/main.h +++ b/test/main.h @@ -359,7 +359,7 @@ template<> inline long double test_precision >() { ret inline bool test_isApprox(const short& a, const short& b) { return internal::isApprox(a, b, test_precision()); } inline bool test_isApprox(const unsigned short& a, const unsigned short& b) -{ return internal::isApprox(a, b, test_precision()); } +{ return internal::isApprox(a, b, test_precision()); } inline bool test_isApprox(const unsigned int& a, const unsigned int& b) { return internal::isApprox(a, b, test_precision()); } inline bool test_isApprox(const long& a, const long& b) -- cgit v1.2.3 From 89d65bb9d6ed8ebc9ce297a3fad90d78ba6cbbbb Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Fri, 8 Jun 2018 16:50:17 +0200 Subject: bug #1531: expose NumDimensions for compatibility with Tensor --- Eigen/src/Core/DenseBase.h | 5 +++++ test/indexed_view.cpp | 4 ---- test/main.h | 2 ++ test/mapped_matrix.cpp | 49 +++++++++++++++++++++++++++++++++++++++++++++- 4 files changed, 55 insertions(+), 5 deletions(-) (limited to 'test/main.h') diff --git a/Eigen/src/Core/DenseBase.h b/Eigen/src/Core/DenseBase.h index 53b427b17..8b994f35c 100644 --- a/Eigen/src/Core/DenseBase.h +++ b/Eigen/src/Core/DenseBase.h @@ -157,6 +157,11 @@ template class DenseBase * we are dealing with a column-vector (if there is only one column) or with * a row-vector (if there is only one row). */ + NumDimensions = int(MaxSizeAtCompileTime) == 1 ? 0 : bool(IsVectorAtCompileTime) ? 1 : 2, + /**< This value is equal to Tensor::NumDimensions, i.e. 0 for scalars, 1 for vectors, + * and 2 for matrices. + */ + Flags = internal::traits::Flags, /**< This stores expression \ref flags flags which may or may not be inherited by new expressions * constructed from this one. See the \ref flags "list of flags". diff --git a/test/indexed_view.cpp b/test/indexed_view.cpp index 2d46ffd6b..551dc55b0 100644 --- a/test/indexed_view.cpp +++ b/test/indexed_view.cpp @@ -397,10 +397,6 @@ void test_indexed_view() // } // static checks of some internals: - - #define STATIC_CHECK( COND ) \ - EIGEN_STATIC_ASSERT( (COND) , EIGEN_INTERNAL_ERROR_PLEASE_FILE_A_BUG_REPORT ) - STATIC_CHECK(( internal::is_valid_index_type::value )); STATIC_CHECK(( internal::is_valid_index_type::value )); STATIC_CHECK(( internal::is_valid_index_type::value )); diff --git a/test/main.h b/test/main.h index a94e1ab41..9c8148de2 100644 --- a/test/main.h +++ b/test/main.h @@ -339,6 +339,8 @@ inline void verify_impl(bool condition, const char *testname, const char *file, #define VERIFY_IS_UNITARY(a) VERIFY(test_isUnitary(a)) +#define STATIC_CHECK(COND) EIGEN_STATIC_ASSERT( (COND) , EIGEN_INTERNAL_ERROR_PLEASE_FILE_A_BUG_REPORT ) + #define CALL_SUBTEST(FUNC) do { \ g_test_stack.push_back(EI_PP_MAKE_STRING(FUNC)); \ FUNC; \ diff --git a/test/mapped_matrix.cpp b/test/mapped_matrix.cpp index 6a84c5897..b9f36d8d6 100644 --- a/test/mapped_matrix.cpp +++ b/test/mapped_matrix.cpp @@ -181,6 +181,49 @@ void map_not_aligned_on_scalar() internal::aligned_delete(array1, (size+1)*(size+1)+1); } +#if EIGEN_HAS_CXX11 +template