aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/Product.h
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2013-12-03 17:17:53 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2013-12-03 17:17:53 +0100
commit6c5e915e9a6c79550e7e2db2b53648f163a1411d (patch)
treeaab5c0a07616fcd028d2839f402edcadc0e53d81 /Eigen/src/Core/Product.h
parentf0b82c3ab972a1eafd6aa4f08f4eaffa0d6f1e55 (diff)
Enable use of evaluators for noalias and lazyProduct, add conversion to scalar for inner products
Diffstat (limited to 'Eigen/src/Core/Product.h')
-rw-r--r--Eigen/src/Core/Product.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/Eigen/src/Core/Product.h b/Eigen/src/Core/Product.h
index 3b8fd7d9a..b37fd2ff7 100644
--- a/Eigen/src/Core/Product.h
+++ b/Eigen/src/Core/Product.h
@@ -79,6 +79,12 @@ class Product : public ProductImpl<_Lhs,_Rhs,Option,
const LhsNestedCleaned& lhs() const { return m_lhs; }
const RhsNestedCleaned& rhs() const { return m_rhs; }
+
+ /** Convertion to scalar for inner-products */
+ operator const Scalar() const {
+ EIGEN_STATIC_ASSERT(SizeAtCompileTime==1, IMPLICIT_CONVERSION_TO_SCALAR_IS_FOR_INNER_PRODUCT_ONLY);
+ return typename internal::evaluator<Product>::type(*this).coeff(0,0);
+ }
protected: