From 668518aed69c3d20efb480acd5944a79df7e5410 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Fri, 6 Feb 2015 14:25:41 +0100 Subject: [PATCH 1/3] Fix non initialized entries and comparison of very small numbers --- unsupported/test/cxx11_tensor_contraction.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/unsupported/test/cxx11_tensor_contraction.cpp b/unsupported/test/cxx11_tensor_contraction.cpp index 6124818fd..2bcae90b8 100644 --- a/unsupported/test/cxx11_tensor_contraction.cpp +++ b/unsupported/test/cxx11_tensor_contraction.cpp @@ -389,7 +389,7 @@ static void test_matrix_vector() m_result = m_left * m_right; for (size_t i = 0; i < t_result.dimensions().TotalSize(); i++) { - VERIFY_IS_APPROX(t_result(i), m_result(i, 0)); + VERIFY(internal::isApprox(t_result(i), m_result(i, 0), 1)); } } @@ -399,6 +399,10 @@ static void test_tensor_vector() { Tensor t_left(7, 13, 17); Tensor t_right(1, 7); + + t_left.setRandom(); + t_right.setRandom(); + typedef typename Tensor::DimensionPair DimensionPair; Eigen::array dim_pair01{{{0, 1}}}; Tensor t_result = t_left.contract(t_right, dim_pair01); @@ -409,7 +413,7 @@ static void test_tensor_vector() Eigen::Matrix m_result = m_left.transpose() * m_right.transpose(); for (size_t i = 0; i < t_result.dimensions().TotalSize(); i++) { - VERIFY_IS_APPROX(t_result(i), m_result(i, 0)); + VERIFY(internal::isApprox(t_result(i), m_result(i, 0), 1)); } } From c03c73c9b7032f984bcd6c52d9ca3a430ce19c69 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Fri, 6 Feb 2015 14:26:12 +0100 Subject: [PATCH 2/3] Fix clang compilation --- unsupported/test/cxx11_tensor_thread_pool.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/unsupported/test/cxx11_tensor_thread_pool.cpp b/unsupported/test/cxx11_tensor_thread_pool.cpp index e25912279..f49523683 100644 --- a/unsupported/test/cxx11_tensor_thread_pool.cpp +++ b/unsupported/test/cxx11_tensor_thread_pool.cpp @@ -15,6 +15,7 @@ #include using Eigen::Tensor; +using std::isnan; static void test_multithread_elementwise() { From 74e460b9950503ef5a306337a136e1d37795deae Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Fri, 6 Feb 2015 14:26:24 +0100 Subject: [PATCH 3/3] Fix symmetric product --- Eigen/src/Core/products/SelfadjointMatrixMatrix.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Eigen/src/Core/products/SelfadjointMatrixMatrix.h b/Eigen/src/Core/products/SelfadjointMatrixMatrix.h index 21f8175d2..860e233b9 100644 --- a/Eigen/src/Core/products/SelfadjointMatrixMatrix.h +++ b/Eigen/src/Core/products/SelfadjointMatrixMatrix.h @@ -374,7 +374,7 @@ EIGEN_DONT_INLINE void product_selfadjoint_matrix