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(); } };