From 069fd0e4be8620ed33b069267a60c4d1d17fddd9 Mon Sep 17 00:00:00 2001 From: Jitse Niesen Date: Fri, 29 Jun 2012 13:07:21 +0100 Subject: Move (part of) evaluation of products to evaluator objects. * Copy implementation from CoeffBasedProduct. * Copy implementation from GeneralProduct in InnerProduct case. * For GeneralProduct in other cases, call the evalTo() member function with expression objects in constructor of evaluator. --- Eigen/src/Core/Product.h | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) (limited to 'Eigen/src/Core/Product.h') diff --git a/Eigen/src/Core/Product.h b/Eigen/src/Core/Product.h index f7824aa80..6e66888c7 100644 --- a/Eigen/src/Core/Product.h +++ b/Eigen/src/Core/Product.h @@ -42,25 +42,16 @@ template class ProductImpl; * */ +// Use ProductReturnType to get correct traits, in particular vectorization flags namespace internal { template struct traits > -{ - typedef MatrixXpr XprKind; - typedef typename remove_all::type LhsCleaned; - typedef typename remove_all::type RhsCleaned; - typedef typename scalar_product_traits::Scalar, typename traits::Scalar>::ReturnType Scalar; - typedef typename promote_storage_type::StorageKind, - typename traits::StorageKind>::ret StorageKind; - typedef typename promote_index_type::Index, - typename traits::Index>::type Index; + : traits::Type> +{ + // We want A+B*C to be of type Product and not Product + // TODO: This flag should eventually go in a separate evaluator traits class enum { - RowsAtCompileTime = LhsCleaned::RowsAtCompileTime, - ColsAtCompileTime = RhsCleaned::ColsAtCompileTime, - MaxRowsAtCompileTime = LhsCleaned::MaxRowsAtCompileTime, - MaxColsAtCompileTime = RhsCleaned::MaxColsAtCompileTime, - Flags = (MaxRowsAtCompileTime==1 ? RowMajorBit : 0), // TODO should be no storage order - CoeffReadCost = 0 // TODO CoeffReadCost should not be part of the expression traits + Flags = traits::Type>::Flags & ~EvalBeforeNestingBit }; }; } // end namespace internal -- cgit v1.2.3