From c851044eae0b0c4be639f6b4fd09825c8ed64d16 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Wed, 7 Jul 2010 10:52:59 +0200 Subject: [PATCH] fix row cwise-prod column in coeff based products... I really don't know why this worked so far... --- Eigen/src/Core/products/CoeffBasedProduct.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Eigen/src/Core/products/CoeffBasedProduct.h b/Eigen/src/Core/products/CoeffBasedProduct.h index a17ce901b..1474bc1bb 100644 --- a/Eigen/src/Core/products/CoeffBasedProduct.h +++ b/Eigen/src/Core/products/CoeffBasedProduct.h @@ -318,7 +318,7 @@ struct ei_product_coeff_vectorized_dyn_selector typedef typename Lhs::Index Index; EIGEN_STRONG_INLINE static void run(Index row, Index col, const Lhs& lhs, const Rhs& rhs, typename Lhs::Scalar &res) { - res = lhs.row(row).cwiseProduct(rhs.col(col)).sum(); + res = lhs.row(row).transpose().cwiseProduct(rhs.col(col)).sum(); } }; @@ -330,7 +330,7 @@ struct ei_product_coeff_vectorized_dyn_selector typedef typename Lhs::Index Index; EIGEN_STRONG_INLINE static void run(Index /*row*/, Index col, const Lhs& lhs, const Rhs& rhs, typename Lhs::Scalar &res) { - res = lhs.cwiseProduct(rhs.col(col)).sum(); + res = lhs.transpose().cwiseProduct(rhs.col(col)).sum(); } }; @@ -340,7 +340,7 @@ struct ei_product_coeff_vectorized_dyn_selector typedef typename Lhs::Index Index; EIGEN_STRONG_INLINE static void run(Index row, Index /*col*/, const Lhs& lhs, const Rhs& rhs, typename Lhs::Scalar &res) { - res = lhs.row(row).cwiseProduct(rhs).sum(); + res = lhs.row(row).transpose().cwiseProduct(rhs).sum(); } }; @@ -350,7 +350,7 @@ struct ei_product_coeff_vectorized_dyn_selector typedef typename Lhs::Index Index; EIGEN_STRONG_INLINE static void run(Index /*row*/, Index /*col*/, const Lhs& lhs, const Rhs& rhs, typename Lhs::Scalar &res) { - res = lhs.cwiseProduct(rhs).sum(); + res = lhs.transpose().cwiseProduct(rhs).sum(); } };