diff --git a/Eigen/src/Core/ProductEvaluators.h b/Eigen/src/Core/ProductEvaluators.h index 51228be5f..26145ceff 100644 --- a/Eigen/src/Core/ProductEvaluators.h +++ b/Eigen/src/Core/ProductEvaluators.h @@ -58,7 +58,9 @@ struct product_evaluator, ProductTag, DenseSha product_evaluator(const XprType& xpr) : m_result(xpr.rows(), xpr.cols()) { + ::new (static_cast(this)) Base(m_result); + dense_product_impl::evalTo(m_result, xpr.lhs(), xpr.rhs()); } @@ -186,7 +188,11 @@ struct dense_product_impl template static inline void evalTo(Dst& dst, const Lhs& lhs, const Rhs& rhs) - { dst = lazyprod(lhs,rhs); } + { + // TODO: use the following instead of calling call_assignment + // dst = lazyprod(lhs,rhs); + call_assignment(dst, lazyprod(lhs,rhs), internal::assign_op()); + } template static inline void addTo(Dst& dst, const Lhs& lhs, const Rhs& rhs)