From 46dd1bb1be49cad4e7eecc12813bd0ee5772cefe Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Fri, 15 Nov 2013 11:19:19 +0100 Subject: [PATCH] Workaround fixing aliasing issue in x = SparseLU::solve(x) --- Eigen/src/Core/PermutationMatrix.h | 3 ++- Eigen/src/SparseLU/SparseLU.h | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Eigen/src/Core/PermutationMatrix.h b/Eigen/src/Core/PermutationMatrix.h index 4fc5dd318..1297b8413 100644 --- a/Eigen/src/Core/PermutationMatrix.h +++ b/Eigen/src/Core/PermutationMatrix.h @@ -553,7 +553,8 @@ struct permut_matrix_product_retval template inline void evalTo(Dest& dst) const { const Index n = Side==OnTheLeft ? rows() : cols(); - + // FIXME we need an is_same for expression that is not sensitive to constness. For instance + // is_same_xpr, Block >::value should be true. if(is_same::value && extract_data(dst) == extract_data(m_matrix)) { // apply the permutation inplace diff --git a/Eigen/src/SparseLU/SparseLU.h b/Eigen/src/SparseLU/SparseLU.h index 71fe844ac..7a9aeec2d 100644 --- a/Eigen/src/SparseLU/SparseLU.h +++ b/Eigen/src/SparseLU/SparseLU.h @@ -229,8 +229,10 @@ class SparseLU : public internal::SparseLUImplmatrixL().solveInPlace(X);