From 20d030f207a8f92d75e8e4aca9d515b9939aa58a Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Tue, 31 Mar 2015 20:16:02 +0200 Subject: Fix vectorization of swap for non trivial expressions --- Eigen/src/Core/Swap.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'Eigen/src/Core/Swap.h') diff --git a/Eigen/src/Core/Swap.h b/Eigen/src/Core/Swap.h index dcb42821f..3880f7b78 100644 --- a/Eigen/src/Core/Swap.h +++ b/Eigen/src/Core/Swap.h @@ -38,13 +38,17 @@ public: template void assignPacket(Index row, Index col) { - m_functor.template swapPacket(&m_dst.coeffRef(row,col), &const_cast(m_src).coeffRef(row,col)); + PacketScalar tmp = m_src.template packet(row,col); + const_cast(m_src).template writePacket(row,col, m_dst.template packet(row,col)); + m_dst.template writePacket(row,col,tmp); } template void assignPacket(Index index) { - m_functor.template swapPacket(&m_dst.coeffRef(index), &const_cast(m_src).coeffRef(index)); + PacketScalar tmp = m_src.template packet(index); + const_cast(m_src).template writePacket(index, m_dst.template packet(index)); + m_dst.template writePacket(index,tmp); } // TODO find a simple way not to have to copy/paste this function from generic_dense_assignment_kernel, by simple I mean no CRTP (Gael) -- cgit v1.2.3