From 66ff9b2c6cdb6b0b105686556e6ef4a87bb9269f Mon Sep 17 00:00:00 2001 From: Benoit Steiner Date: Thu, 19 Nov 2015 15:40:32 -0800 Subject: [PATCH 1/9] Fixed compilation warning generated by clang --- unsupported/test/cxx11_tensor_uint128.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/unsupported/test/cxx11_tensor_uint128.cpp b/unsupported/test/cxx11_tensor_uint128.cpp index 53c09ff0b..ee3767e58 100644 --- a/unsupported/test/cxx11_tensor_uint128.cpp +++ b/unsupported/test/cxx11_tensor_uint128.cpp @@ -14,7 +14,7 @@ using Eigen::internal::TensorUInt128; using Eigen::internal::static_val; -static void VERIFY_EQUAL(TensorUInt128 actual, __uint128_t expected) { +void VERIFY_EQUAL(TensorUInt128 actual, __uint128_t expected) { bool matchl = actual.lower() == static_cast(expected); bool matchh = actual.upper() == static_cast(expected >> 64); if (!matchl || !matchh) { @@ -27,7 +27,7 @@ static void VERIFY_EQUAL(TensorUInt128 actual, __uint128_t e } -static void test_add() { +void test_add() { uint64_t incr = internal::random(1, 9999999999); for (uint64_t i1 = 0; i1 < 100; ++i1) { for (uint64_t i2 = 1; i2 < 100 * incr; i2 += incr) { @@ -46,7 +46,7 @@ static void test_add() { } } -static void test_sub() { +void test_sub() { uint64_t incr = internal::random(1, 9999999999); for (uint64_t i1 = 0; i1 < 100; ++i1) { for (uint64_t i2 = 1; i2 < 100 * incr; i2 += incr) { @@ -65,7 +65,7 @@ static void test_sub() { } } -static void test_mul() { +void test_mul() { uint64_t incr = internal::random(1, 9999999999); for (uint64_t i1 = 0; i1 < 100; ++i1) { for (uint64_t i2 = 1; i2 < 100 * incr; i2 += incr) { @@ -84,7 +84,7 @@ static void test_mul() { } } -static void test_div() { +void test_div() { uint64_t incr = internal::random(1, 9999999999); for (uint64_t i1 = 0; i1 < 100; ++i1) { for (uint64_t i2 = 1; i2 < 100 * incr; i2 += incr) { @@ -103,7 +103,7 @@ static void test_div() { } } -static void test_misc1() { +void test_misc1() { uint64_t incr = internal::random(1, 9999999999); for (uint64_t i2 = 1; i2 < 100 * incr; i2 += incr) { TensorUInt128, uint64_t> i(0, i2); @@ -118,7 +118,7 @@ static void test_misc1() { } } -static void test_misc2() { +void test_misc2() { int64_t incr = internal::random(1, 100); for (int64_t log_div = 0; log_div < 63; ++log_div) { for (int64_t divider = 1; divider <= 1000000 * incr; divider += incr) { From 0ad7c7b1adc142fec4376ccdfdb4e88e4820934d Mon Sep 17 00:00:00 2001 From: Benoit Steiner Date: Thu, 19 Nov 2015 15:52:51 -0800 Subject: [PATCH 2/9] Fixed another clang compilation warning --- unsupported/test/cxx11_tensor_intdiv.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/unsupported/test/cxx11_tensor_intdiv.cpp b/unsupported/test/cxx11_tensor_intdiv.cpp index c6e1890df..48aa6d368 100644 --- a/unsupported/test/cxx11_tensor_intdiv.cpp +++ b/unsupported/test/cxx11_tensor_intdiv.cpp @@ -15,10 +15,10 @@ void test_signed_32bit() { // Divide by one - const Eigen::internal::TensorIntDivisor div(1); + const Eigen::internal::TensorIntDivisor div_by_one(1); for (int32_t j = 0; j < 25000; ++j) { - const int32_t fast_div = j / div; + const int32_t fast_div = j / div_by_one; const int32_t slow_div = j / 1; VERIFY_IS_EQUAL(fast_div, slow_div); } From e52d4f8d8d11137b5e8574c1fcaf9aae0c865128 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Fri, 20 Nov 2015 13:54:28 +0100 Subject: [PATCH 3/9] Add is_integral<> type traits --- Eigen/src/Core/util/Meta.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Eigen/src/Core/util/Meta.h b/Eigen/src/Core/util/Meta.h index e7fa2a1f1..15b80abd9 100644 --- a/Eigen/src/Core/util/Meta.h +++ b/Eigen/src/Core/util/Meta.h @@ -73,6 +73,18 @@ 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 add_const { typedef const T type; }; template struct add_const { typedef T& type; }; From e1b27bcb0bc9383eaaa93a98b635a1d880eb8b19 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Fri, 20 Nov 2015 13:55:34 +0100 Subject: [PATCH 4/9] Workaround MSVC missing overloads of std::fpclassify for integral types --- Eigen/src/Core/MathFunctions.h | 226 ++++++++++++++++++--------------- 1 file changed, 125 insertions(+), 101 deletions(-) diff --git a/Eigen/src/Core/MathFunctions.h b/Eigen/src/Core/MathFunctions.h index 2ac6f4c67..5187b9c90 100644 --- a/Eigen/src/Core/MathFunctions.h +++ b/Eigen/src/Core/MathFunctions.h @@ -675,6 +675,128 @@ inline EIGEN_MATHFUNC_RETVAL(random, Scalar) random() return EIGEN_MATHFUNC_IMPL(random, Scalar)::run(); } +// Implementatin of is* functions + +// std::is* do not work with fast-math and gcc, std::is* are available on MSVC 2013 and newer, as well as in clang. +#if (EIGEN_HAS_CXX11_MATH && !(EIGEN_COMP_GNUC_STRICT && __FINITE_MATH_ONLY__)) || (EIGEN_COMP_MSVC>=1800) || (EIGEN_COMP_CLANG) +#define EIGEN_USE_STD_FPCLASSIFY 1 +#else +#define EIGEN_USE_STD_FPCLASSIFY 0 +#endif + +template +EIGEN_DEVICE_FUNC +typename internal::enable_if::value,bool>::type +isnan_impl(const T &x) { return false; } + +template +EIGEN_DEVICE_FUNC +typename internal::enable_if::value,bool>::type +isinf_impl(const T &x) { return false; } + +template +EIGEN_DEVICE_FUNC +typename internal::enable_if::value,bool>::type +isfinite_impl(const T &x) { return true; } + +template +EIGEN_DEVICE_FUNC +typename internal::enable_if::value,bool>::type +isfinite_impl(const T& x) +{ + #if EIGEN_USE_STD_FPCLASSIFY + using std::isfinite; + return isfinite EIGEN_NOT_A_MACRO (x); + #else + return x::highest() && x>NumTraits::lowest(); + #endif +} + +template +EIGEN_DEVICE_FUNC +typename internal::enable_if::value,bool>::type +isinf_impl(const T& x) +{ + #if EIGEN_USE_STD_FPCLASSIFY + using std::isinf; + return isinf EIGEN_NOT_A_MACRO (x); + #else + return x>NumTraits::highest() || x::lowest(); + #endif +} + +template +EIGEN_DEVICE_FUNC +typename internal::enable_if::value,bool>::type +isnan_impl(const T& x) +{ + #if EIGEN_USE_STD_FPCLASSIFY + using std::isnan; + return isnan EIGEN_NOT_A_MACRO (x); + #else + return x != x; + #endif +} + +#if (!EIGEN_USE_STD_FPCLASSIFY) + +#if EIGEN_COMP_MSVC + +template EIGEN_DEVICE_FUNC bool isinf_msvc_helper(T x) +{ + return _fpclass(x)==_FPCLASS_NINF || _fpclass(x)==_FPCLASS_PINF; +} + +//MSVC defines a _isnan builtin function, but for double only +template<> EIGEN_DEVICE_FUNC inline bool isnan_impl(const long double& x) { return _isnan(x); } +template<> EIGEN_DEVICE_FUNC inline bool isnan_impl(const double& x) { return _isnan(x); } +template<> EIGEN_DEVICE_FUNC inline bool isnan_impl(const float& x) { return _isnan(x); } + +template<> EIGEN_DEVICE_FUNC inline bool isinf_impl(const long double& x) { return isinf_msvc_helper(x); } +template<> EIGEN_DEVICE_FUNC inline bool isinf_impl(const double& x) { return isinf_msvc_helper(x); } +template<> EIGEN_DEVICE_FUNC inline bool isinf_impl(const float& x) { return isinf_msvc_helper(x); } + +#elif (defined __FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ && EIGEN_COMP_GNUC) + +#if EIGEN_GNUC_AT_LEAST(5,0) + #define EIGEN_TMP_NOOPT_ATTRIB EIGEN_DEVICE_FUNC inline __attribute__((optimize("no-finite-math-only"))) +#else + // NOTE the inline qualifier and noinline attribute are both needed: the former is to avoid linking issue (duplicate symbol), + // while the second prevent too aggressive optimizations in fast-math mode: + #define EIGEN_TMP_NOOPT_ATTRIB EIGEN_DEVICE_FUNC inline __attribute__((noinline,optimize("no-finite-math-only"))) +#endif + +template<> EIGEN_TMP_NOOPT_ATTRIB bool isnan_impl(const long double& x) { return __builtin_isnan(x); } +template<> EIGEN_TMP_NOOPT_ATTRIB bool isnan_impl(const double& x) { return __builtin_isnan(x); } +template<> EIGEN_TMP_NOOPT_ATTRIB bool isnan_impl(const float& x) { return __builtin_isnan(x); } +template<> EIGEN_TMP_NOOPT_ATTRIB bool isinf_impl(const double& x) { return __builtin_isinf(x); } +template<> EIGEN_TMP_NOOPT_ATTRIB bool isinf_impl(const float& x) { return __builtin_isinf(x); } +template<> EIGEN_TMP_NOOPT_ATTRIB bool isinf_impl(const long double& x) { return __builtin_isinf(x); } + +#undef EIGEN_TMP_NOOPT_ATTRIB + +#endif + +#endif + +template +bool isfinite_impl(const std::complex& x) +{ + return (numext::isfinite)(numext::real(x)) && (numext::isfinite)(numext::imag(x)); +} + +template +bool isnan_impl(const std::complex& x) +{ + return (numext::isnan)(numext::real(x)) || (numext::isnan)(numext::imag(x)); +} + +template +bool isinf_impl(const std::complex& x) +{ + return ((numext::isinf)(numext::real(x)) || (numext::isinf)(numext::imag(x))) && (!(numext::isnan)(x)); +} + } // end namespace internal /**************************************************************************** @@ -818,107 +940,9 @@ inline EIGEN_MATHFUNC_RETVAL(pow, Scalar) pow(const Scalar& x, const Scalar& y) return EIGEN_MATHFUNC_IMPL(pow, Scalar)::run(x, y); } -// std::is* do not work with fast-math and gcc, std::is* are available on MSVC 2013 and newer, as well as in clang. -#if (EIGEN_HAS_CXX11_MATH && !(EIGEN_COMP_GNUC_STRICT && __FINITE_MATH_ONLY__)) || (EIGEN_COMP_MSVC>=1800) || (EIGEN_COMP_CLANG) -#define EIGEN_USE_STD_FPCLASSIFY 1 -#else -#define EIGEN_USE_STD_FPCLASSIFY 0 -#endif - -template -EIGEN_DEVICE_FUNC -bool (isfinite)(const T& x) -{ - #if EIGEN_USE_STD_FPCLASSIFY - using std::isfinite; - return isfinite EIGEN_NOT_A_MACRO (x); - #else - return x::highest() && x>NumTraits::lowest(); - #endif -} - -template -EIGEN_DEVICE_FUNC -bool (isinf)(const T& x) -{ - #if EIGEN_USE_STD_FPCLASSIFY - using std::isinf; - return isinf EIGEN_NOT_A_MACRO (x); - #else - return x>NumTraits::highest() || x::lowest(); - #endif -} - -template -EIGEN_DEVICE_FUNC -bool (isnan)(const T& x) -{ - #if EIGEN_USE_STD_FPCLASSIFY - using std::isnan; - return isnan EIGEN_NOT_A_MACRO (x); - #else - return x != x; - #endif -} - -#if (!EIGEN_USE_STD_FPCLASSIFY) - -#if EIGEN_COMP_MSVC - -template EIGEN_DEVICE_FUNC bool isinf_msvc_helper(T x) -{ - return _fpclass(x)==_FPCLASS_NINF || _fpclass(x)==_FPCLASS_PINF; -} - -//MSVC defines a _isnan builtin function, but for double only -template<> EIGEN_DEVICE_FUNC inline bool (isnan)(const long double& x) { return _isnan(x); } -template<> EIGEN_DEVICE_FUNC inline bool (isnan)(const double& x) { return _isnan(x); } -template<> EIGEN_DEVICE_FUNC inline bool (isnan)(const float& x) { return _isnan(x); } - -template<> EIGEN_DEVICE_FUNC inline bool (isinf)(const long double& x) { return isinf_msvc_helper(x); } -template<> EIGEN_DEVICE_FUNC inline bool (isinf)(const double& x) { return isinf_msvc_helper(x); } -template<> EIGEN_DEVICE_FUNC inline bool (isinf)(const float& x) { return isinf_msvc_helper(x); } - -#elif (defined __FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ && EIGEN_COMP_GNUC) - -#if EIGEN_GNUC_AT_LEAST(5,0) - #define EIGEN_TMP_NOOPT_ATTRIB EIGEN_DEVICE_FUNC inline __attribute__((optimize("no-finite-math-only"))) -#else - // NOTE the inline qualifier and noinline attribute are both needed: the former is to avoid linking issue (duplicate symbol), - // while the second prevent too aggressive optimizations in fast-math mode: - #define EIGEN_TMP_NOOPT_ATTRIB EIGEN_DEVICE_FUNC inline __attribute__((noinline,optimize("no-finite-math-only"))) -#endif - -template<> EIGEN_TMP_NOOPT_ATTRIB bool (isnan)(const long double& x) { return __builtin_isnan(x); } -template<> EIGEN_TMP_NOOPT_ATTRIB bool (isnan)(const double& x) { return __builtin_isnan(x); } -template<> EIGEN_TMP_NOOPT_ATTRIB bool (isnan)(const float& x) { return __builtin_isnan(x); } -template<> EIGEN_TMP_NOOPT_ATTRIB bool (isinf)(const double& x) { return __builtin_isinf(x); } -template<> EIGEN_TMP_NOOPT_ATTRIB bool (isinf)(const float& x) { return __builtin_isinf(x); } -template<> EIGEN_TMP_NOOPT_ATTRIB bool (isinf)(const long double& x) { return __builtin_isinf(x); } - -#undef EIGEN_TMP_NOOPT_ATTRIB - -#endif - -#endif - -template -bool (isfinite)(const std::complex& x) -{ - return (numext::isfinite)(numext::real(x)) && (numext::isfinite)(numext::imag(x)); -} - -template -bool (isnan)(const std::complex& x) -{ - return (numext::isnan)(numext::real(x)) || (numext::isnan)(numext::imag(x)); -} - -template -bool (isinf)(const std::complex& x) -{ - return ((numext::isinf)(numext::real(x)) || (numext::isinf)(numext::imag(x))) && (!(numext::isnan)(x)); -} +template EIGEN_DEVICE_FUNC bool (isnan) (const T &x) { return internal::isnan_impl(x); } +template EIGEN_DEVICE_FUNC bool (isinf) (const T &x) { return internal::isinf_impl(x); } +template EIGEN_DEVICE_FUNC bool (isfinite)(const T &x) { return internal::isfinite_impl(x); } template EIGEN_DEVICE_FUNC From 5c9c0dca4dcf6c62b5b63c529f18421df3d4f36e Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Fri, 20 Nov 2015 14:51:36 +0100 Subject: [PATCH 5/9] Add missing using statement to enable fast Array / real operations. (was ok for Matrix only) --- Eigen/src/Core/ArrayBase.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Eigen/src/Core/ArrayBase.h b/Eigen/src/Core/ArrayBase.h index 66813c8ea..b4c24a27a 100644 --- a/Eigen/src/Core/ArrayBase.h +++ b/Eigen/src/Core/ArrayBase.h @@ -53,6 +53,7 @@ template class ArrayBase typedef DenseBase Base; using Base::operator*; + using Base::operator/; using Base::RowsAtCompileTime; using Base::ColsAtCompileTime; using Base::SizeAtCompileTime; From 4a985e793c6c6f822c18243f8c10508e4a8b635c Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Fri, 20 Nov 2015 14:52:08 +0100 Subject: [PATCH 6/9] Workaround msvc broken complex/complex division in unit test --- test/array.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/array.cpp b/test/array.cpp index e2b20f9e9..d437105da 100644 --- a/test/array.cpp +++ b/test/array.cpp @@ -365,11 +365,15 @@ template void array_complex(const ArrayType& m) std::complex zero(0.0,0.0); VERIFY((Eigen::isnan)(m1*zero/zero).all()); +#if EIGEN_COMP_MSVC + // msvc complex division is not robust + VERIFY((Eigen::isinf)(m4/RealScalar(0)).all()); +#else #if EIGEN_COMP_CLANG - // clang's complex division is notoriously broken + // clang's complex division is notoriously broken too if((numext::isinf)(m4(0,0)/RealScalar(0))) { #endif - VERIFY((Eigen::isinf)(m4/zero).all()); + VERIFY((Eigen::isinf)(m4/zero).all()); #if EIGEN_COMP_CLANG } else @@ -377,6 +381,8 @@ template void array_complex(const ArrayType& m) VERIFY((Eigen::isinf)(m4.real()/zero.real()).all()); } #endif +#endif // MSVC + VERIFY(((Eigen::isfinite)(m1) && (!(Eigen::isfinite)(m1*zero/zero)) && (!(Eigen::isfinite)(m1/zero))).all()); VERIFY_IS_APPROX(inverse(inverse(m1)),m1); From 4fc36079e778a4944af27f1d71e41fa45bae197e Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Fri, 20 Nov 2015 15:29:03 +0100 Subject: [PATCH 7/9] Fix overload instantiation for clang --- Eigen/src/Core/MathFunctions.h | 51 +++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 23 deletions(-) diff --git a/Eigen/src/Core/MathFunctions.h b/Eigen/src/Core/MathFunctions.h index 5187b9c90..fe1dafe83 100644 --- a/Eigen/src/Core/MathFunctions.h +++ b/Eigen/src/Core/MathFunctions.h @@ -687,21 +687,21 @@ inline EIGEN_MATHFUNC_RETVAL(random, Scalar) random() template EIGEN_DEVICE_FUNC typename internal::enable_if::value,bool>::type -isnan_impl(const T &x) { return false; } +isnan_impl(const T&) { return false; } template EIGEN_DEVICE_FUNC typename internal::enable_if::value,bool>::type -isinf_impl(const T &x) { return false; } +isinf_impl(const T&) { return false; } template EIGEN_DEVICE_FUNC typename internal::enable_if::value,bool>::type -isfinite_impl(const T &x) { return true; } +isfinite_impl(const T&) { return true; } template EIGEN_DEVICE_FUNC -typename internal::enable_if::value,bool>::type +typename internal::enable_if<(!internal::is_integral::value)&&(!NumTraits::IsComplex),bool>::type isfinite_impl(const T& x) { #if EIGEN_USE_STD_FPCLASSIFY @@ -714,7 +714,7 @@ isfinite_impl(const T& x) template EIGEN_DEVICE_FUNC -typename internal::enable_if::value,bool>::type +typename internal::enable_if<(!internal::is_integral::value)&&(!NumTraits::IsComplex),bool>::type isinf_impl(const T& x) { #if EIGEN_USE_STD_FPCLASSIFY @@ -727,7 +727,7 @@ isinf_impl(const T& x) template EIGEN_DEVICE_FUNC -typename internal::enable_if::value,bool>::type +typename internal::enable_if<(!internal::is_integral::value)&&(!NumTraits::IsComplex),bool>::type isnan_impl(const T& x) { #if EIGEN_USE_STD_FPCLASSIFY @@ -779,23 +779,10 @@ template<> EIGEN_TMP_NOOPT_ATTRIB bool isinf_impl(const long double& x) { return #endif -template -bool isfinite_impl(const std::complex& x) -{ - return (numext::isfinite)(numext::real(x)) && (numext::isfinite)(numext::imag(x)); -} - -template -bool isnan_impl(const std::complex& x) -{ - return (numext::isnan)(numext::real(x)) || (numext::isnan)(numext::imag(x)); -} - -template -bool isinf_impl(const std::complex& x) -{ - return ((numext::isinf)(numext::real(x)) || (numext::isinf)(numext::imag(x))) && (!(numext::isnan)(x)); -} +// The following overload are defined at the end of this file +template bool isfinite_impl(const std::complex& x); +template bool isnan_impl(const std::complex& x); +template bool isinf_impl(const std::complex& x); } // end namespace internal @@ -986,6 +973,24 @@ inline int log2(int x) namespace internal { +template +bool isfinite_impl(const std::complex& x) +{ + return (numext::isfinite)(numext::real(x)) && (numext::isfinite)(numext::imag(x)); +} + +template +bool isnan_impl(const std::complex& x) +{ + return (numext::isnan)(numext::real(x)) || (numext::isnan)(numext::imag(x)); +} + +template +bool isinf_impl(const std::complex& x) +{ + return ((numext::isinf)(numext::real(x)) || (numext::isinf)(numext::imag(x))) && (!(numext::isnan)(x)); +} + /**************************************************************************** * Implementation of fuzzy comparisons * ****************************************************************************/ From 4522ffd17c9c6cb74049263ea9de0f8a9d35e2b2 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Fri, 20 Nov 2015 15:29:32 +0100 Subject: [PATCH 8/9] Add regression using test for array/real --- test/linearstructure.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/linearstructure.cpp b/test/linearstructure.cpp index 3c7cdbe41..292f33969 100644 --- a/test/linearstructure.cpp +++ b/test/linearstructure.cpp @@ -108,9 +108,11 @@ void test_linearstructure() CALL_SUBTEST_7( linearStructure(MatrixXi (internal::random(1,EIGEN_TEST_MAX_SIZE), internal::random(1,EIGEN_TEST_MAX_SIZE))) ); CALL_SUBTEST_8( linearStructure(MatrixXcd(internal::random(1,EIGEN_TEST_MAX_SIZE/2), internal::random(1,EIGEN_TEST_MAX_SIZE/2))) ); CALL_SUBTEST_9( linearStructure(ArrayXXf (internal::random(1,EIGEN_TEST_MAX_SIZE), internal::random(1,EIGEN_TEST_MAX_SIZE))) ); + CALL_SUBTEST_10( linearStructure(ArrayXXcf (internal::random(1,EIGEN_TEST_MAX_SIZE), internal::random(1,EIGEN_TEST_MAX_SIZE))) ); - CALL_SUBTEST_10( real_complex() ); - CALL_SUBTEST_10( real_complex(10,10) ); + CALL_SUBTEST_11( real_complex() ); + CALL_SUBTEST_11( real_complex(10,10) ); + CALL_SUBTEST_11( real_complex(10,10) ); } #ifdef EIGEN_TEST_PART_4 From 027a846b3404339ec223daa3178e46a0c676e5ad Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Fri, 20 Nov 2015 15:30:10 +0100 Subject: [PATCH 9/9] Use .data() instead of &coeffRef(0). --- Eigen/src/SuperLUSupport/SuperLUSupport.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Eigen/src/SuperLUSupport/SuperLUSupport.h b/Eigen/src/SuperLUSupport/SuperLUSupport.h index 7c644eef6..afb5904e0 100644 --- a/Eigen/src/SuperLUSupport/SuperLUSupport.h +++ b/Eigen/src/SuperLUSupport/SuperLUSupport.h @@ -659,7 +659,7 @@ void SuperLU::_solve_impl(const MatrixBase &b, MatrixBase &m_sluStat, &info, Scalar()); StatFree(&m_sluStat); - if(&x.coeffRef(0) != x_ref.data()) + if(x.derived().data() != x_ref.data()) x = x_ref; m_info = info==0 ? Success : NumericalIssue;