From 2630d97c625d642a205ecf00723efd8e28b9639e Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Wed, 13 Apr 2016 18:26:08 +0200 Subject: [PATCH] Fix detection of same matrices when both matrices are not handled by extract_data. --- Eigen/src/Core/ProductEvaluators.h | 5 +++-- Eigen/src/Core/SolveTriangular.h | 3 ++- Eigen/src/Core/TriangularMatrix.h | 3 ++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Eigen/src/Core/ProductEvaluators.h b/Eigen/src/Core/ProductEvaluators.h index 443a58c27..bd63b87ff 100644 --- a/Eigen/src/Core/ProductEvaluators.h +++ b/Eigen/src/Core/ProductEvaluators.h @@ -467,7 +467,7 @@ struct product_evaluator, ProductTag, DenseShape, LhsVecPacketSize = unpacket_traits::size, RhsVecPacketSize = unpacket_traits::size, - // + // Here, we don't care about alignment larger than the usable packet size. LhsAlignment = EIGEN_PLAIN_ENUM_MIN(LhsEtorType::Alignment,LhsVecPacketSize*int(sizeof(typename LhsNestedCleaned::Scalar))), RhsAlignment = EIGEN_PLAIN_ENUM_MIN(RhsEtorType::Alignment,RhsVecPacketSize*int(sizeof(typename RhsNestedCleaned::Scalar))), @@ -1006,7 +1006,8 @@ struct transposition_matrix_product const Index size = tr.size(); StorageIndex j = 0; - if(!(is_same::value && extract_data(dst) == extract_data(mat))) + const typename Dest::Scalar *dst_data = internal::extract_data(dst); + if(!(is_same::value && dst_data == extract_data(mat))) dst = mat; for(Index k=(Transposed?size-1:0) ; Transposed?k>=0:k struct triangular_solv template inline void evalTo(Dest& dst) const { - if(!(is_same::value && extract_data(dst) == extract_data(m_rhs))) + const typename Dest::Scalar *dst_data = internal::extract_data(dst); + if(!(is_same::value && dst_data!=0 && dst_data == extract_data(m_rhs))) dst = m_rhs; m_triangularMatrix.template solveInPlace(dst); } diff --git a/Eigen/src/Core/TriangularMatrix.h b/Eigen/src/Core/TriangularMatrix.h index e6d137e40..fafc2a0c6 100644 --- a/Eigen/src/Core/TriangularMatrix.h +++ b/Eigen/src/Core/TriangularMatrix.h @@ -532,7 +532,8 @@ template class TriangularViewImpl<_Mat template EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE void _solve_impl(const RhsType &rhs, DstType &dst) const { - if(!(internal::is_same::value && internal::extract_data(dst) == internal::extract_data(rhs))) + const typename DstType::Scalar *dst_data = internal::extract_data(dst); + if(!(internal::is_same::value && dst_data!=0 && dst_data == internal::extract_data(rhs))) dst = rhs; this->solveInPlace(dst); }